libpappsomspp
Library for mass spectrometry
pappso::TimsFrameBase Class Reference

#include <timsframebase.h>

Inheritance diagram for pappso::TimsFrameBase:
pappso::TimsFrame pappso::TimsFrameType1

Public Member Functions

 TimsFrameBase (std::size_t timsId, quint32 scanNum)
 constructor for binary independant tims frame More...
 
 TimsFrameBase (const TimsFrameBase &other)
 
virtual ~TimsFrameBase ()
 
virtual bool hasSameCalibrationData (const TimsFrameBase &other) const
 tells if 2 tims frame has the same calibration data Usefull to know if raw data can be handled between frames More...
 
virtual std::size_t getNbrPeaks (std::size_t scanNum) const
 get the number of peaks in this spectrum need the binary file More...
 
virtual std::size_t getTotalNumberOfScans () const
 get the number of scans contained in this frame each scan represents an ion mobility slice More...
 
virtual quint32 getMaximumRawMassIndex () const
 get the maximum raw mass index contained in this frame More...
 
virtual MassSpectrumSPtr getMassSpectrumSPtr (std::size_t scanNum) const
 get Mass spectrum with peaks for this scan number need the binary file More...
 
virtual Trace cumulateScanToTrace (std::size_t scanNumBegin, std::size_t scanNumEnd) const
 cumulate spectrum given a scan number range need the binary file The intensities are normalized with respect to the frame accumulation time More...
 
virtual void cumulateScansInRawMap (std::map< quint32, quint32 > &rawSpectrum, std::size_t scanNumBegin, std::size_t scanNumEnd) const
 cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time More...
 
virtual quint64 cumulateSingleScanIntensities (std::size_t scanNum) const
 
virtual quint64 cumulateScansIntensities (std::size_t scanNumBegin, std::size_t scanNumEnd) const
 
bool checkScanNum (std::size_t scanNum) const
 check that this scan number exists More...
 
void setAccumulationTime (double accumulation_time_ms)
 
void setMzCalibration (double T1_frame, double T2_frame, double digitizerTimebase, double digitizerDelay, double C0, double C1, double C2, double C3, double C4, double T1_ref, double T2_ref, double dC1, double dC2)
 
void setTimsCalibration (int tims_model_type, double C0, double C1, double C2, double C3, double C4, double C5, double C6, double C7, double C8, double C9)
 
void setTime (double time)
 
void setMsMsType (quint8 type)
 
unsigned int getMsLevel () const
 
double getTime () const
 
std::size_t getId () const
 
double getDriftTime (std::size_t scanNum) const
 get drift time of a scan number in milliseconds More...
 
double getOneOverK0Transformation (std::size_t scanNum) const
 get 1/K0 value of a given scan (mobility value) More...
 
std::size_t getScanNumFromOneOverK0 (double one_over_k0) const
 get the scan number from a given 1/Ko mobility value More...
 
double getVoltageTransformation (std::size_t scanNum) const
 get voltage for a given scan number More...
 
pappso::Trace getTraceFromCumulatedScans (std::map< quint32, quint32 > &accumulated_scans) const
 transform accumulation of raw scans into a real mass spectrum More...
 
pappso::Trace getTraceFromCumulatedScansBuiltinCentroid (std::map< quint32, quint32 > &accumulated_scans) const
 transform accumulation of raw scans into a real mass spectrum with a simple centroid on raw integers More...
 
virtual const MzCalibrationInterfaceSPtrgetMzCalibrationInterfaceSPtr () const final
 get the MzCalibration model to compute mz and TOF for this frame More...
 
void setMzCalibrationInterfaceSPtr (MzCalibrationInterfaceSPtr mzCalibration)
 
virtual std::vector< quint32 > getScanIndexList (std::size_t scanNum) const
 get raw index list for one given scan index are not TOF nor m/z, just index on digitizer More...
 
virtual std::vector< quint32 > getScanIntensities (std::size_t scanNum) const
 get raw intensities without transformation from one scan it needs intensity normalization More...
 
virtual Trace getIonMobilityTraceByMzIndexRange (std::size_t mz_index_lower_bound, std::size_t mz_index_upper_bound, XicExtractMethod method) const
 get a mobility trace cumulating intensities inside the given mass index range More...
 

Protected Attributes

quint32 m_scanNumber
 total number of scans contained in this frame More...
 
std::size_t m_timsId
 Tims frame database id (the SQL identifier of this frame) More...
 
double m_accumulationTime = 0
 accumulation time in milliseconds More...
 
quint8 m_msMsType = 0
 
double m_time = 0
 retention time More...
 
double m_timsDvStart = 0
 
double m_timsSlope
 
double m_timsTtrans = 0
 
double m_timsNdelay = 0
 
double m_timsVmin = 0
 
double m_timsVmax = 0
 
double m_timsC6 = 0
 
double m_timsC7 = 0
 
MzCalibrationInterfaceSPtr msp_mzCalibration = nullptr
 

Detailed Description

Todo:
write docs

Definition at line 47 of file timsframebase.h.

Constructor & Destructor Documentation

◆ TimsFrameBase() [1/2]

pappso::TimsFrameBase::TimsFrameBase ( std::size_t  timsId,
quint32  scanNum 
)

constructor for binary independant tims frame

Parameters
timsIdtims frame identifier in the database
scanNumthe total number of scans contained in this frame

Definition at line 39 of file timsframebase.cpp.

40 {
41  qDebug() << timsId;
42  m_timsId = timsId;
43 
44  m_scanNumber = scanNum;
45 }
quint32 m_scanNumber
total number of scans contained in this frame
std::size_t m_timsId
Tims frame database id (the SQL identifier of this frame)

References m_scanNumber, and m_timsId.

◆ TimsFrameBase() [2/2]

pappso::TimsFrameBase::TimsFrameBase ( const TimsFrameBase other)

Copy constructor

Parameters
otherTODO

◆ ~TimsFrameBase()

pappso::TimsFrameBase::~TimsFrameBase ( )
virtual

Destructor

Definition at line 51 of file timsframebase.cpp.

52 {
53 }

Member Function Documentation

◆ checkScanNum()

bool pappso::TimsFrameBase::checkScanNum ( std::size_t  scanNum) const

check that this scan number exists

Parameters
scanNumscan number in the frame in the order it lies in binary file, from 0 to N-1

Definition at line 103 of file timsframebase.cpp.

104 {
105  if(scanNum >= m_scanNumber)
106  {
108  QObject::tr("Invalid scan number : scanNum %1 > m_scanNumber %2")
109  .arg(scanNum)
110  .arg(m_scanNumber));
111  }
112 
113  return true;
114 }

References m_scanNumber.

Referenced by pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getNbrPeaks(), pappso::TimsFrame::getScanIndexList(), pappso::TimsFrameType1::getScanIndexList(), pappso::TimsFrame::getScanIntensities(), and pappso::TimsFrameType1::getScanIntensities().

◆ cumulateScansInRawMap()

void pappso::TimsFrameBase::cumulateScansInRawMap ( std::map< quint32, quint32 > &  rawSpectrum,
std::size_t  scanNumBegin,
std::size_t  scanNumEnd 
) const
virtual

cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time

Parameters
rawSpectrumsimple map of integers to cumulate raw counts
scanNumBeginscan number in the frame in the order it lies in binary file, from 0 to N-1
scanNumEndscan number in the frame in the order it lies in binary file, from 0 to N-1

Reimplemented in pappso::TimsFrame.

Definition at line 150 of file timsframebase.cpp.

154 {
155  throw PappsoException(
156  QObject::tr(
157  "ERROR unable to cumulateScansInRawMap in TimsFrameBase for scan "
158  "number begin %1 end %2")
159  .arg(scanNumBegin)
160  .arg(scanNumEnd));
161 }

◆ cumulateScansIntensities()

quint64 pappso::TimsFrameBase::cumulateScansIntensities ( std::size_t  scanNumBegin,
std::size_t  scanNumEnd 
) const
virtual

Reimplemented in pappso::TimsFrame.

Definition at line 177 of file timsframebase.cpp.

179 {
180  throw PappsoException(
181  QObject::tr(
182  "ERROR unable to cumulateScansInRawMap in TimsFrameBase for scan "
183  "number begin %1 end %2")
184  .arg(scanNumBegin)
185  .arg(scanNumEnd));
186 
187  return 0;
188 }

◆ cumulateScanToTrace()

Trace pappso::TimsFrameBase::cumulateScanToTrace ( std::size_t  scanNumBegin,
std::size_t  scanNumEnd 
) const
virtual

cumulate spectrum given a scan number range need the binary file The intensities are normalized with respect to the frame accumulation time

Parameters
scanNumBeginscan number in the frame in the order it lies in binary file, from 0 to N-1
scanNumEndscan number in the frame in the order it lies in binary file, from 0 to N-1

Reimplemented in pappso::TimsFrame.

Definition at line 140 of file timsframebase.cpp.

142 {
143  throw PappsoException(
144  QObject::tr("ERROR unable to cumulateScanToTrace in TimsFrameBase for scan "
145  "number begin %1 end %2")
146  .arg(scanNumBegin)
147  .arg(scanNumEnd));
148 }

◆ cumulateSingleScanIntensities()

quint64 pappso::TimsFrameBase::cumulateSingleScanIntensities ( std::size_t  scanNum) const
virtual

Reimplemented in pappso::TimsFrame.

Definition at line 165 of file timsframebase.cpp.

166 {
167  throw PappsoException(
168  QObject::tr(
169  "ERROR unable to cumulateSingleScanIntensities in TimsFrameBase for scan "
170  "number %1.").arg(scanNum));
171 
172  return 0;
173 }

◆ getDriftTime()

double pappso::TimsFrameBase::getDriftTime ( std::size_t  scanNum) const

get drift time of a scan number in milliseconds

Parameters
scanNumscan number in the frame in the order it lies in binary file, from 0 to N-1
Returns
time in milliseconds of mobility delay (drift time)

Definition at line 277 of file timsframebase.cpp.

278 {
279  return (m_accumulationTime / (double)m_scanNumber) * ((double)scanNum);
280 }
double m_accumulationTime
accumulation time in milliseconds

References m_accumulationTime, and m_scanNumber.

◆ getId()

std::size_t pappso::TimsFrameBase::getId ( ) const

◆ getIonMobilityTraceByMzIndexRange()

Trace pappso::TimsFrameBase::getIonMobilityTraceByMzIndexRange ( std::size_t  mz_index_lower_bound,
std::size_t  mz_index_upper_bound,
XicExtractMethod  method 
) const
virtual

get a mobility trace cumulating intensities inside the given mass index range

Parameters
mz_index_lower_boundraw mass index lower bound
mz_index_upper_boundraw mass index upper bound
methodmax or sum intensities

Definition at line 526 of file timsframebase.cpp.

530 {
531  Trace im_trace;
532  DataPoint data_point;
533  for(quint32 i = 0; i < m_scanNumber; i++)
534  {
535  data_point.x = i;
536  data_point.y = 0;
537  qDebug() << "m_scanNumber=" << m_scanNumber << " i=" << i;
538  std::vector<quint32> index_list = getScanIndexList(i);
539  auto it_lower = std::find_if(index_list.begin(),
540  index_list.end(),
541  [mz_index_lower_bound](quint32 to_compare) {
542  if(to_compare < mz_index_lower_bound)
543  {
544  return false;
545  }
546  return true;
547  });
548 
549 
550  if(it_lower == index_list.end())
551  {
552  }
553  else
554  {
555 
556 
557  auto it_upper =
558  std::find_if(index_list.begin(),
559  index_list.end(),
560  [mz_index_upper_bound](quint32 to_compare) {
561  if(mz_index_upper_bound >= to_compare)
562  {
563  return false;
564  }
565  return true;
566  });
567  std::vector<quint32> intensity_list = getScanIntensities(i);
568  for(int j = std::distance(index_list.begin(), it_lower);
569  j < std::distance(index_list.begin(), it_upper);
570  j++)
571  {
572  if(method == XicExtractMethod::sum)
573  {
574  data_point.y += intensity_list[j];
575  }
576  else
577  {
578  data_point.y =
579  std::max((double)intensity_list[j], data_point.y);
580  }
581  }
582  }
583  im_trace.push_back(data_point);
584  }
585  qDebug();
586  return im_trace;
587 }
virtual std::vector< quint32 > getScanIndexList(std::size_t scanNum) const
get raw index list for one given scan index are not TOF nor m/z, just index on digitizer
virtual std::vector< quint32 > getScanIntensities(std::size_t scanNum) const
get raw intensities without transformation from one scan it needs intensity normalization
@ sum
sum of intensities

References getScanIndexList(), getScanIntensities(), m_scanNumber, pappso::sum, pappso::DataPoint::x, and pappso::DataPoint::y.

◆ getMassSpectrumSPtr()

MassSpectrumSPtr pappso::TimsFrameBase::getMassSpectrumSPtr ( std::size_t  scanNum) const
virtual

get Mass spectrum with peaks for this scan number need the binary file

Parameters
scanNumscan number in the frame in the order it lies in binary file, from 0 to N-1

Reimplemented in pappso::TimsFrameType1, and pappso::TimsFrame.

Definition at line 132 of file timsframebase.cpp.

133 {
134  throw PappsoException(
135  QObject::tr(
136  "ERROR unable to getMassSpectrumSPtr in TimsFrameBase for scan number %1")
137  .arg(scanNum));
138 }

◆ getMaximumRawMassIndex()

quint32 pappso::TimsFrameBase::getMaximumRawMassIndex ( ) const
virtual

get the maximum raw mass index contained in this frame

Definition at line 490 of file timsframebase.cpp.

491 {
492  quint32 max_value = 0;
493  for(quint32 i = 0; i < m_scanNumber; i++)
494  {
495  qDebug() << "m_scanNumber=" << m_scanNumber << " i=" << i;
496  std::vector<quint32> index_list = getScanIndexList(i);
497  auto it = std::max_element(index_list.begin(), index_list.end());
498  if(it != index_list.end())
499  {
500  max_value = std::max(max_value, *it);
501  }
502  }
503  return max_value;
504 }

References getScanIndexList(), and m_scanNumber.

◆ getMsLevel()

unsigned int pappso::TimsFrameBase::getMsLevel ( ) const

Definition at line 205 of file timsframebase.cpp.

206 {
207  if(m_msMsType == 0)
208  return 1;
209  return 2;
210 }

References m_msMsType.

◆ getMzCalibrationInterfaceSPtr()

const MzCalibrationInterfaceSPtr & pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr ( ) const
finalvirtual

get the MzCalibration model to compute mz and TOF for this frame

Definition at line 457 of file timsframebase.cpp.

458 {
459  if(msp_mzCalibration == nullptr)
460  {
461 
463  QObject::tr("ERROR in %1, %2, %3 msp_mzCalibration is null")
464  .arg(__FILE__)
465  .arg(__FUNCTION__)
466  .arg(__LINE__));
467  }
468  return msp_mzCalibration;
469 }
MzCalibrationInterfaceSPtr msp_mzCalibration

References msp_mzCalibration.

Referenced by pappso::TimsFrame::XicComputeStructure::XicComputeStructure(), pappso::TimsFrame::cumulateScanToTrace(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), getTraceFromCumulatedScans(), and getTraceFromCumulatedScansBuiltinCentroid().

◆ getNbrPeaks()

std::size_t pappso::TimsFrameBase::getNbrPeaks ( std::size_t  scanNum) const
virtual

get the number of peaks in this spectrum need the binary file

Parameters
scanNumscan number in the frame in the order it lies in binary file, from 0 to N-1

Reimplemented in pappso::TimsFrameType1, and pappso::TimsFrame.

Definition at line 117 of file timsframebase.cpp.

118 {
119  throw PappsoException(
120  QObject::tr(
121  "ERROR unable to get number of peaks in TimsFrameBase for scan number %1")
122  .arg(scanNum));
123 }

◆ getOneOverK0Transformation()

double pappso::TimsFrameBase::getOneOverK0Transformation ( std::size_t  scanNum) const

get 1/K0 value of a given scan (mobility value)

Parameters
scanNumscan number in the frame in the order it lies in binary file, from 0 to N-1

Definition at line 283 of file timsframebase.cpp.

284 {
285  return 1 / (m_timsC6 + (m_timsC7 / getVoltageTransformation(scanNum)));
286 }
double getVoltageTransformation(std::size_t scanNum) const
get voltage for a given scan number

References getVoltageTransformation(), m_timsC6, and m_timsC7.

◆ getScanIndexList()

std::vector< quint32 > pappso::TimsFrameBase::getScanIndexList ( std::size_t  scanNum) const
virtual

get raw index list for one given scan index are not TOF nor m/z, just index on digitizer

Reimplemented in pappso::TimsFrameType1, and pappso::TimsFrame.

Definition at line 507 of file timsframebase.cpp.

508 {
509  throw PappsoException(
510  QObject::tr(
511  "ERROR unable to getScanIndexList in TimsFrameBase for scan number %1")
512  .arg(scanNum));
513 }

Referenced by getIonMobilityTraceByMzIndexRange(), and getMaximumRawMassIndex().

◆ getScanIntensities()

std::vector< quint32 > pappso::TimsFrameBase::getScanIntensities ( std::size_t  scanNum) const
virtual

get raw intensities without transformation from one scan it needs intensity normalization

Reimplemented in pappso::TimsFrameType1, and pappso::TimsFrame.

Definition at line 517 of file timsframebase.cpp.

518 {
519  throw PappsoException(
520  QObject::tr(
521  "ERROR unable to getScanIntensities in TimsFrameBase for scan number %1")
522  .arg(scanNum));
523 }

Referenced by getIonMobilityTraceByMzIndexRange().

◆ getScanNumFromOneOverK0()

std::size_t pappso::TimsFrameBase::getScanNumFromOneOverK0 ( double  one_over_k0) const

get the scan number from a given 1/Ko mobility value

Parameters
one_over_k0the mobility value to tranform
Returns
integer the scan number in the frame in the order it lies in binary file, from 0 to N-1

Definition at line 290 of file timsframebase.cpp.

291 {
292  double temp = 1 / one_over_k0;
293  temp = temp - m_timsC6;
294  temp = temp / m_timsC7;
295  temp = 1 / temp;
296  temp = temp - m_timsDvStart;
297  temp = temp / m_timsSlope + m_timsTtrans + m_timsNdelay;
298  return (std::size_t)std::round(temp);
299 }

References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, and m_timsTtrans.

◆ getTime()

double pappso::TimsFrameBase::getTime ( ) const

Definition at line 213 of file timsframebase.cpp.

214 {
215  return m_time;
216 }
double m_time
retention time

References m_time.

◆ getTotalNumberOfScans()

std::size_t pappso::TimsFrameBase::getTotalNumberOfScans ( ) const
virtual

get the number of scans contained in this frame each scan represents an ion mobility slice

Definition at line 126 of file timsframebase.cpp.

127 {
128  return m_scanNumber;
129 }

References m_scanNumber.

Referenced by pappso::BaseColorMapPlotWidget::addColorMap().

◆ getTraceFromCumulatedScans()

pappso::Trace pappso::TimsFrameBase::getTraceFromCumulatedScans ( std::map< quint32, quint32 > &  accumulated_scans) const

transform accumulation of raw scans into a real mass spectrum

Definition at line 317 of file timsframebase.cpp.

319 {
320  qDebug();
321  // qDebug();
322  // add flanking peaks
323  pappso::Trace local_trace;
324 
325  MzCalibrationInterface *mz_calibration_p =
327 
328 
329  DataPoint element;
330  for(auto &scan_element : accumulated_scans)
331  {
332  // intensity normalization
333  element.y = ((double)scan_element.second) * 100.0 / m_accumulationTime;
334 
335  // mz calibration
336  element.x = mz_calibration_p->getMzFromTofIndex(scan_element.first);
337 
338  local_trace.push_back(element);
339  }
340  local_trace.sortX();
341 
342  qDebug();
343  // qDebug();
344  return local_trace;
345 }
virtual const MzCalibrationInterfaceSPtr & getMzCalibrationInterfaceSPtr() const final
get the MzCalibration model to compute mz and TOF for this frame
A simple container of DataPoint instances.
Definition: trace.h:38
Q_INVOKABLE void sortX()
Definition: trace.cpp:983

References getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), m_accumulationTime, pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.

◆ getTraceFromCumulatedScansBuiltinCentroid()

pappso::Trace pappso::TimsFrameBase::getTraceFromCumulatedScansBuiltinCentroid ( std::map< quint32, quint32 > &  accumulated_scans) const

transform accumulation of raw scans into a real mass spectrum with a simple centroid on raw integers

Definition at line 348 of file timsframebase.cpp.

350 {
351  qDebug();
352  // qDebug();
353  // add flanking peaks
354  std::vector<quint32> keys;
355  transform(begin(accumulated_scans),
356  end(accumulated_scans),
357  back_inserter(keys),
358  [](std::map<quint32, quint32>::value_type const &pair) {
359  return pair.first;
360  });
361  std::sort(keys.begin(), keys.end());
362  pappso::DataPoint data_point_cumul;
363  data_point_cumul.x = 0;
364  data_point_cumul.y = 0;
365 
366  pappso::Trace local_trace;
367 
368  MzCalibrationInterface *mz_calibration_p =
370 
371 
372  quint32 last_key = 0;
373 
374  for(quint32 key : keys)
375  {
376  if(key == last_key + 1)
377  {
378  // cumulate
379  if(accumulated_scans[key] > accumulated_scans[last_key])
380  {
381  if(data_point_cumul.x == last_key)
382  {
383  // growing peak
384  data_point_cumul.x = key;
385  data_point_cumul.y += accumulated_scans[key];
386  }
387  else
388  {
389  // new peak
390  // flush
391  if(data_point_cumul.y > 0)
392  {
393  // intensity normalization
394  data_point_cumul.y *= 100.0 / m_accumulationTime;
395 
396 
397  // mz calibration
398  data_point_cumul.x =
399  mz_calibration_p->getMzFromTofIndex(data_point_cumul.x);
400  local_trace.push_back(data_point_cumul);
401  }
402 
403  // new point
404  data_point_cumul.x = key;
405  data_point_cumul.y = accumulated_scans[key];
406  }
407  }
408  else
409  {
410  data_point_cumul.y += accumulated_scans[key];
411  }
412  }
413  else
414  {
415  // flush
416  if(data_point_cumul.y > 0)
417  {
418  // intensity normalization
419  data_point_cumul.y *= 100.0 / m_accumulationTime;
420 
421 
422  // qDebug() << "raw data x=" << data_point_cumul.x;
423  // mz calibration
424  data_point_cumul.x =
425  mz_calibration_p->getMzFromTofIndex(data_point_cumul.x);
426  // qDebug() << "mz=" << data_point_cumul.x;
427  local_trace.push_back(data_point_cumul);
428  }
429 
430  // new point
431  data_point_cumul.x = key;
432  data_point_cumul.y = accumulated_scans[key];
433  }
434 
435  last_key = key;
436  }
437  // flush
438  if(data_point_cumul.y > 0)
439  {
440  // intensity normalization
441  data_point_cumul.y *= 100.0 / m_accumulationTime;
442 
443 
444  // mz calibration
445  data_point_cumul.x =
446  mz_calibration_p->getMzFromTofIndex(data_point_cumul.x);
447  local_trace.push_back(data_point_cumul);
448  }
449 
450  local_trace.sortX();
451  qDebug();
452  // qDebug();
453  return local_trace;
454 }
pappso_double x
Definition: datapoint.h:23
pappso_double y
Definition: datapoint.h:24

References getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), m_accumulationTime, pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.

◆ getVoltageTransformation()

double pappso::TimsFrameBase::getVoltageTransformation ( std::size_t  scanNum) const

get voltage for a given scan number

Parameters
scanNumscan number in the frame in the order it lies in binary file, from 0 to N-1
Returns
double volt measure

Definition at line 255 of file timsframebase.cpp.

256 {
257  double v = m_timsDvStart +
258  m_timsSlope * ((double)scanNum - m_timsTtrans - m_timsNdelay);
259 
260  if(v < m_timsVmin)
261  {
263  QObject::tr("ERROR in TimsFrame::getVoltageTransformation invalid tims "
264  "calibration, v < m_timsVmin"));
265  }
266 
267 
268  if(v > m_timsVmax)
269  {
271  QObject::tr("ERROR in TimsFrame::getVoltageTransformation invalid tims "
272  "calibration, v > m_timsVmax"));
273  }
274  return v;
275 }

References m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.

Referenced by getOneOverK0Transformation().

◆ hasSameCalibrationData()

bool pappso::TimsFrameBase::hasSameCalibrationData ( const TimsFrameBase other) const
virtual

tells if 2 tims frame has the same calibration data Usefull to know if raw data can be handled between frames

Definition at line 302 of file timsframebase.cpp.

303 {
304  if((m_timsDvStart == other.m_timsDvStart) &&
305  (m_timsTtrans == other.m_timsTtrans) &&
306  (m_timsNdelay == other.m_timsNdelay) && (m_timsVmin == other.m_timsVmin) &&
307  (m_timsVmax == other.m_timsVmax) && (m_timsC6 == other.m_timsC6) &&
308  (m_timsC7 == other.m_timsC7) && (m_timsSlope == other.m_timsSlope))
309  {
310  return true;
311  }
312  return false;
313 }

References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.

◆ setAccumulationTime()

void pappso::TimsFrameBase::setAccumulationTime ( double  accumulation_time_ms)

Definition at line 56 of file timsframebase.cpp.

57 {
58  m_accumulationTime = accumulation_time_ms;
59 }

References m_accumulationTime.

◆ setMsMsType()

void pappso::TimsFrameBase::setMsMsType ( quint8  type)

Definition at line 197 of file timsframebase.cpp.

198 {
199 
200  qDebug() << " m_msMsType=" << type;
201  m_msMsType = type;
202 }

References m_msMsType.

◆ setMzCalibration()

void pappso::TimsFrameBase::setMzCalibration ( double  T1_frame,
double  T2_frame,
double  digitizerTimebase,
double  digitizerDelay,
double  C0,
double  C1,
double  C2,
double  C3,
double  C4,
double  T1_ref,
double  T2_ref,
double  dC1,
double  dC2 
)

Definition at line 63 of file timsframebase.cpp.

76 {
77 
78  /* MzCalibrationModel1 mzCalibration(temperature_correction,
79  digitizerTimebase,
80  digitizerDelay,
81  C0,
82  C1,
83  C2,
84  C3,
85  C4);
86  */
87  msp_mzCalibration = std::make_shared<MzCalibrationModel1>(T1_frame,
88  T2_frame,
89  digitizerTimebase,
90  digitizerDelay,
91  C0,
92  C1,
93  C2,
94  C3,
95  C4,
96  T1_ref,
97  T2_ref,
98  dC1,
99  dC2);
100 }

References msp_mzCalibration.

◆ setMzCalibrationInterfaceSPtr()

void pappso::TimsFrameBase::setMzCalibrationInterfaceSPtr ( MzCalibrationInterfaceSPtr  mzCalibration)

Definition at line 472 of file timsframebase.cpp.

474 {
475 
476  if(mzCalibration == nullptr)
477  {
478 
480  QObject::tr("ERROR in %1, %2, %3 msp_mzCalibration is null")
481  .arg(__FILE__)
482  .arg(__FUNCTION__)
483  .arg(__LINE__));
484  }
485  msp_mzCalibration = mzCalibration;
486 }

References msp_mzCalibration.

◆ setTime()

void pappso::TimsFrameBase::setTime ( double  time)

Definition at line 191 of file timsframebase.cpp.

192 {
193  m_time = time;
194 }

References m_time.

◆ setTimsCalibration()

void pappso::TimsFrameBase::setTimsCalibration ( int  tims_model_type,
double  C0,
double  C1,
double  C2,
double  C3,
double  C4,
double  C5,
double  C6,
double  C7,
double  C8,
double  C9 
)

Definition at line 224 of file timsframebase.cpp.

235 {
236  if(tims_model_type != 2)
237  {
238  throw pappso::PappsoException(QObject::tr(
239  "ERROR in TimsFrame::setTimsCalibration tims_model_type != 2"));
240  }
241  m_timsDvStart = C2; // C2 from TimsCalibration
242  m_timsTtrans = C4; // C4 from TimsCalibration
243  m_timsNdelay = C0; // C0 from TimsCalibration
244  m_timsVmin = C8; // C8 from TimsCalibration
245  m_timsVmax = C9; // C9 from TimsCalibration
246  m_timsC6 = C6;
247  m_timsC7 = C7;
248 
249 
250  m_timsSlope =
251  (C3 - m_timsDvStart) / C1; // //C3 from TimsCalibration // C2 from
252  // TimsCalibration // C1 from TimsCalibration
253 }

References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.

Member Data Documentation

◆ m_accumulationTime

◆ m_msMsType

quint8 pappso::TimsFrameBase::m_msMsType = 0
protected

Definition at line 253 of file timsframebase.h.

Referenced by getMsLevel(), and setMsMsType().

◆ m_scanNumber

◆ m_time

double pappso::TimsFrameBase::m_time = 0
protected

retention time

Definition at line 257 of file timsframebase.h.

Referenced by pappso::TimsFrame::extractTimsXicListInRtRange(), getTime(), and setTime().

◆ m_timsC6

double pappso::TimsFrameBase::m_timsC6 = 0
protected

◆ m_timsC7

double pappso::TimsFrameBase::m_timsC7 = 0
protected

◆ m_timsDvStart

double pappso::TimsFrameBase::m_timsDvStart = 0
protected

◆ m_timsId

std::size_t pappso::TimsFrameBase::m_timsId
protected

Tims frame database id (the SQL identifier of this frame)

Warning
in sqlite, there is another field called TimsId : this is not that, because it is in fact an offset in bytes in the binary file.

Definition at line 247 of file timsframebase.h.

Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), getId(), and pappso::TimsFrameType1::lzfDecompressScan().

◆ m_timsNdelay

double pappso::TimsFrameBase::m_timsNdelay = 0
protected

◆ m_timsSlope

double pappso::TimsFrameBase::m_timsSlope
protected

◆ m_timsTtrans

double pappso::TimsFrameBase::m_timsTtrans = 0
protected

◆ m_timsVmax

double pappso::TimsFrameBase::m_timsVmax = 0
protected

◆ m_timsVmin

double pappso::TimsFrameBase::m_timsVmin = 0
protected

◆ msp_mzCalibration

MzCalibrationInterfaceSPtr pappso::TimsFrameBase::msp_mzCalibration = nullptr
protected

The documentation for this class was generated from the following files: