libpappsomspp
Library for mass spectrometry
pappso::TimsFrame Class Reference

#include <timsframe.h>

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

Classes

struct  XicComputeStructure
 

Public Member Functions

 TimsFrame (std::size_t timsId, quint32 scanNum, char *p_bytes, std::size_t len)
 
 TimsFrame (const TimsFrame &other)
 
 ~TimsFrame ()
 
virtual std::size_t getNbrPeaks (std::size_t scanNum) const override
 
virtual Trace cumulateScanToTrace (std::size_t scanNumBegin, std::size_t scanNumEnd) const override
 cumulate scan list into a trace More...
 
void cumulateScans (std::size_t scanNumBegin, std::size_t scanNumEnd, std::map< quint32, quint32 > &accumulate_into) const
 cumulate a scan list into a map of integers More...
 
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...
 
std::vector< quint32 > getScanIntensities (std::size_t scanNum) const
 get raw intensities without transformation from one scan it needs intensity normalization More...
 
pappso::MassSpectrumCstSPtr getMassSpectrumCstSPtr (std::size_t scanNum) const
 get the mass spectrum corresponding to a scan number More...
 
virtual pappso::MassSpectrumSPtr getMassSpectrumSPtr (std::size_t scanNum) const override
 
pappso::Trace getTraceFromCumulatedScans (std::map< quint32, quint32 > &accumulated_scans) const
 transform accumulation of raw scans into a real mass spectrum More...
 
- Public Member Functions inherited from pappso::TimsFrameBase
 TimsFrameBase (std::size_t timsId, quint32 scanNum)
 constructor for binary independant tims frame More...
 
 TimsFrameBase (const TimsFrameBase &other)
 
 ~TimsFrameBase ()
 
bool checkScanNum (std::size_t scanNum) const
 
void setAccumulationTime (double accumulation_time_ms)
 
void setMzCalibration (double temperature_correction, double digitizerTimebase, double digitizerDelay, double C0, double C1, double C2, double C3)
 
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...
 
double getMzFromTof (double tof) const
 get m/z from time of flight More...
 
quint32 getRawIndexFromMz (double mz) const
 get raw index of a given m/z 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
 
double getTofFromIndex (quint32 index) const
 get time of flight from raw index More...
 
double getTofFromIndex (double index) const
 get time of flight from double index More...
 

Protected Member Functions

void extractTimsXicListInRtRange (std::vector< TimsXicStructure >::iterator &itXicListbegin, std::vector< TimsXicStructure >::iterator &itXicListend, XicExtractMethod method) const
 

Private Member Functions

void unshufflePacket (const char *src)
 
std::size_t getScanOffset (std::size_t scanNum) const
 
void cumulateScan (std::size_t scanNum, std::map< quint32, quint32 > &accumulate_into) const
 cumulate a scan into a map More...
 
pappso::TraceSPtr getRawTraceSPtr (std::size_t scanNum) const
 

Private Attributes

friend TimsDirectXicExtractor
 
QByteArray m_timsDataFrame
 

Additional Inherited Members

- Protected Attributes inherited from pappso::TimsFrameBase
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...
 
double m_digitizerTimebase = 0
 
double m_digitizerDelay = 0
 
std::vector< double > m_mzCalibrationArr
 MZ calibration parameters. 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
 

Detailed Description

Todo:
write docs

Definition at line 52 of file timsframe.h.

Constructor & Destructor Documentation

◆ TimsFrame() [1/2]

pappso::TimsFrame::TimsFrame ( std::size_t  timsId,
quint32  scanNum,
char *  p_bytes,
std::size_t  len 
)

Default constructor

Definition at line 54 of file timsframe.cpp.

58  : TimsFrameBase(timsId, scanNum)
59 {
60  // langella@themis:~/developpement/git/bruker/cbuild$
61  // ./src/sample/timsdataSamplePappso
62  // /gorgone/pappso/fichiers_fabricants/Bruker/Demo_TimsTOF_juin2019/Samples/1922001/1922001-1_S-415_Pep_Pur-1ul_Slot1-10_1_2088.d/
63  qDebug() << timsId;
64 
65  m_timsDataFrame.resize(len);
66 
67  if(p_bytes != nullptr)
68  {
69  unshufflePacket(p_bytes);
70  }
71  else
72  {
73  if(m_scanNumber == 0)
74  {
75 
77  QObject::tr("TimsFrame::TimsFrame(%1,%2,nullptr,%3) FAILED")
78  .arg(m_timsId)
79  .arg(m_scanNumber)
80  .arg(len));
81  }
82  }
83 }

References pappso::TimsFrameBase::m_scanNumber, m_timsDataFrame, pappso::TimsFrameBase::m_timsId, and unshufflePacket().

◆ TimsFrame() [2/2]

pappso::TimsFrame::TimsFrame ( const TimsFrame other)

Copy constructor

Parameters
otherTODO

Definition at line 85 of file timsframe.cpp.

85  : TimsFrameBase(other)
86 {
87 }

◆ ~TimsFrame()

pappso::TimsFrame::~TimsFrame ( )

Destructor

Definition at line 89 of file timsframe.cpp.

90 {
91 }

Member Function Documentation

◆ cumulateScan()

void pappso::TimsFrame::cumulateScan ( std::size_t  scanNum,
std::map< quint32, quint32 > &  accumulate_into 
) const
private

cumulate a scan into a map

Definition at line 213 of file timsframe.cpp.

215 {
216  qDebug();
217 
218  if(m_timsDataFrame.size() == 0)
219  return;
220  checkScanNum(scanNum);
221 
222 
223  std::size_t size = getNbrPeaks(scanNum);
224 
225  std::size_t offset = getScanOffset(scanNum);
226 
227  qint32 previous = -1;
228  for(std::size_t i = 0; i < size; i++)
229  {
230  quint32 x =
231  (*(quint32 *)((m_timsDataFrame.constData() + (offset * 4) + (i * 8))) +
232  previous);
233  quint32 y = (*(quint32 *)(m_timsDataFrame.constData() + (offset * 4) +
234  (i * 8) + 4));
235 
236  previous = x;
237 
238  auto ret = accumulate_into.insert(std::pair<quint32, quint32>(x, y));
239 
240  if(ret.second == false)
241  {
242  // already existed : cumulate
243  ret.first->second += y;
244  }
245  }
246  qDebug();
247 }

References pappso::TimsFrameBase::checkScanNum(), getNbrPeaks(), getScanOffset(), m_timsDataFrame, and pappso::y.

Referenced by cumulateScanToTrace().

◆ cumulateScans()

void pappso::TimsFrame::cumulateScans ( std::size_t  scanNumBegin,
std::size_t  scanNumEnd,
std::map< quint32, quint32 > &  accumulate_into 
) const

cumulate a scan list into a map of integers

Parameters
scanNumBeginfirst scan to cumulate
scanNumEndlast scan to cumulate
accumulate_intomap of x and y integer values

◆ cumulateScanToTrace()

Trace pappso::TimsFrame::cumulateScanToTrace ( std::size_t  scanNumBegin,
std::size_t  scanNumEnd 
) const
overridevirtual

cumulate scan list into a trace

Parameters
scanNumBeginfirst scan to cumulate
scanNumEndlast scan to cumulate
Returns
Trace mz and intensity values

Reimplemented from pappso::TimsFrameBase.

Definition at line 251 of file timsframe.cpp.

253 {
254  qDebug();
255 
256  Trace new_trace;
257 
258  try
259  {
260  if(m_timsDataFrame.size() == 0)
261  return new_trace;
262  std::map<quint32, quint32> raw_spectrum;
263  // double local_accumulationTime = 0;
264 
265  std::size_t imax = scanNumEnd + 1;
266  qDebug();
267  for(std::size_t i = scanNumBegin; i < imax; i++)
268  {
269  qDebug() << i;
270  cumulateScan(i, raw_spectrum);
271  qDebug() << i;
272  // local_accumulationTime += m_accumulationTime;
273  }
274  qDebug();
275  pappso::DataPoint data_point_cumul;
276 
277  for(std::pair<quint32, quint32> pair_tof_intensity : raw_spectrum)
278  {
279  data_point_cumul.x =
280  getMzFromTof(getTofFromIndex(pair_tof_intensity.first));
281  // normalization
282  data_point_cumul.y =
283  pair_tof_intensity.second * ((double)100.0 / m_accumulationTime);
284  new_trace.push_back(data_point_cumul);
285  }
286  new_trace.sortX();
287  qDebug();
288  }
289 
290  catch(std::exception &error)
291  {
292  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()"
293  << QString(
294  "Failure in TimsFrame::cumulateScanToTrace %1 to %2 :\n %3")
295  .arg(scanNumBegin, scanNumEnd)
296  .arg(error.what());
297  }
298  return new_trace;
299 }

References cumulateScan(), pappso::TimsFrameBase::getMzFromTof(), pappso::TimsFrameBase::getTofFromIndex(), pappso::TimsFrameBase::m_accumulationTime, m_timsDataFrame, pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.

◆ extractTimsXicListInRtRange()

void pappso::TimsFrame::extractTimsXicListInRtRange ( std::vector< TimsXicStructure >::iterator &  itXicListbegin,
std::vector< TimsXicStructure >::iterator &  itXicListend,
XicExtractMethod  method 
) const
protected

Definition at line 476 of file timsframe.cpp.

480 {
481  std::vector<TimsFrame::XicComputeStructure> tmp_xic_list;
482 
483  for(auto it = itXicListbegin; it != itXicListend; it++)
484  {
485  tmp_xic_list.push_back(TimsFrame::XicComputeStructure(this, *it));
486  }
487  if(tmp_xic_list.size() == 0)
488  return;
489  /*
490  std::sort(tmp_xic_list.begin(), tmp_xic_list.end(), [](const TimsXicStructure
491  &a, const TimsXicStructure &b) { return a.mobilityIndexBegin <
492  b.mobilityIndexBegin;
493  });
494  */
495  std::vector<std::size_t> unique_scan_num_list;
496  for(auto &&struct_xic : tmp_xic_list)
497  {
498  for(std::size_t scan = struct_xic.mobilityIndexBegin;
499  scan <= struct_xic.mobilityIndexEnd;
500  scan++)
501  {
502  unique_scan_num_list.push_back(scan);
503  }
504  }
505  std::sort(unique_scan_num_list.begin(), unique_scan_num_list.end());
506  auto it_scan_num_end =
507  std::unique(unique_scan_num_list.begin(), unique_scan_num_list.end());
508  auto it_scan_num = unique_scan_num_list.begin();
509 
510  while(it_scan_num != it_scan_num_end)
511  {
512  TraceSPtr ms_spectrum = getRawTraceSPtr(*it_scan_num);
513  for(auto &&tmp_xic_struct : tmp_xic_list)
514  {
515  if(((*it_scan_num) >= tmp_xic_struct.mobilityIndexBegin) &&
516  ((*it_scan_num) <= tmp_xic_struct.mobilityIndexEnd))
517  {
518  if(method == XicExtractMethod::max)
519  {
520  tmp_xic_struct.tmpIntensity +=
521  ms_spectrum.get()->maxY(tmp_xic_struct.mzIndexLowerBound,
522  tmp_xic_struct.mzIndexUpperBound);
523  }
524  else
525  {
526  // sum
527  tmp_xic_struct.tmpIntensity +=
528  ms_spectrum.get()->sumY(tmp_xic_struct.mzIndexLowerBound,
529  tmp_xic_struct.mzIndexUpperBound);
530  }
531  }
532  }
533  it_scan_num++;
534  }
535 
536  for(auto &&tmp_xic_struct : tmp_xic_list)
537  {
538  if(tmp_xic_struct.tmpIntensity != 0)
539  {
540  tmp_xic_struct.xic_ptr->push_back(
541  {m_time, tmp_xic_struct.tmpIntensity});
542  }
543  }
544 }

References getRawTraceSPtr(), pappso::TimsFrameBase::m_time, and pappso::sum.

◆ getMassSpectrumCstSPtr()

pappso::MassSpectrumCstSPtr pappso::TimsFrame::getMassSpectrumCstSPtr ( std::size_t  scanNum) const

get the mass spectrum corresponding to a scan number

Parameters
scanNumthe scan number to retrieve

Definition at line 421 of file timsframe.cpp.

422 {
423  qDebug();
424  return getMassSpectrumSPtr(scanNum);
425 }

References getMassSpectrumSPtr().

◆ getMassSpectrumSPtr()

pappso::MassSpectrumSPtr pappso::TimsFrame::getMassSpectrumSPtr ( std::size_t  scanNum) const
overridevirtual

Reimplemented from pappso::TimsFrameBase.

Definition at line 428 of file timsframe.cpp.

429 {
430 
431  qDebug() << " scanNum=" << scanNum;
432 
433  checkScanNum(scanNum);
434 
435  qDebug();
436 
437  pappso::MassSpectrumSPtr mass_spectrum_sptr =
438  std::make_shared<pappso::MassSpectrum>();
439  // std::vector<DataPoint>
440 
441  if(m_timsDataFrame.size() == 0)
442  return mass_spectrum_sptr;
443  qDebug();
444 
445  std::size_t size = getNbrPeaks(scanNum);
446 
447  std::size_t offset = getScanOffset(scanNum);
448 
449  qint32 previous = -1;
450  std::vector<quint32> index_list;
451  for(std::size_t i = 0; i < size; i++)
452  {
453  DataPoint data_point(
454  (*(quint32 *)((m_timsDataFrame.constData() + (offset * 4) + (i * 8))) +
455  previous),
456  (*(quint32 *)(m_timsDataFrame.constData() + (offset * 4) + (i * 8) +
457  4)));
458 
459  // intensity normalization
460  data_point.y *= 100.0 / m_accumulationTime;
461 
462  previous = data_point.x;
463 
464 
465  // mz calibration
466  double tof = (data_point.x * m_digitizerTimebase) + m_digitizerDelay;
467  data_point.x = getMzFromTof(tof);
468  mass_spectrum_sptr.get()->push_back(data_point);
469  }
470  qDebug();
471  return mass_spectrum_sptr;
472 }

References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::getMzFromTof(), getNbrPeaks(), getScanOffset(), pappso::TimsFrameBase::m_accumulationTime, pappso::TimsFrameBase::m_digitizerDelay, pappso::TimsFrameBase::m_digitizerTimebase, m_timsDataFrame, pappso::DataPoint::x, and pappso::DataPoint::y.

Referenced by getMassSpectrumCstSPtr().

◆ getNbrPeaks()

std::size_t pappso::TimsFrame::getNbrPeaks ( std::size_t  scanNum) const
overridevirtual

Reimplemented from pappso::TimsFrameBase.

Definition at line 122 of file timsframe.cpp.

123 {
124  if(m_timsDataFrame.size() == 0)
125  return 0;
126  /*
127  if(scanNum == 0)
128  {
129  quint32 res = (*(quint32 *)(m_timsDataFrame.constData() + 4)) -
130  (*(quint32 *)(m_timsDataFrame.constData()-4));
131  return res / 2;
132  }*/
133  if(scanNum == (m_scanNumber - 1))
134  {
135  auto nb_uint4 = m_timsDataFrame.size() / 4;
136 
137  std::size_t cumul = 0;
138  for(quint32 i = 0; i < m_scanNumber; i++)
139  {
140  cumul += (*(quint32 *)(m_timsDataFrame.constData() + (i * 4)));
141  }
142  return (nb_uint4 - cumul) / 2;
143  }
144  checkScanNum(scanNum);
145 
146  // quint32 *res = (quint32 *)(m_timsDataFrame.constData() + (scanNum * 4));
147  // qDebug() << " res=" << *res;
148  return (*(quint32 *)(m_timsDataFrame.constData() + ((scanNum + 1) * 4))) / 2;
149 }

References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::m_scanNumber, and m_timsDataFrame.

Referenced by cumulateScan(), getMassSpectrumSPtr(), getRawTraceSPtr(), getScanIndexList(), and getScanIntensities().

◆ getRawTraceSPtr()

pappso::TraceSPtr pappso::TimsFrame::getRawTraceSPtr ( std::size_t  scanNum) const
private

Definition at line 548 of file timsframe.cpp.

549 {
550 
551  qDebug();
552 
553  pappso::TraceSPtr trace_sptr = std::make_shared<pappso::Trace>();
554  // std::vector<DataPoint>
555 
556  if(m_timsDataFrame.size() == 0)
557  return trace_sptr;
558  qDebug();
559 
560  std::size_t size = getNbrPeaks(scanNum);
561 
562  std::size_t offset = getScanOffset(scanNum);
563 
564  qint32 previous = -1;
565  std::vector<quint32> index_list;
566  for(std::size_t i = 0; i < size; i++)
567  {
568  DataPoint data_point(
569  (*(quint32 *)((m_timsDataFrame.constData() + (offset * 4) + (i * 8))) +
570  previous),
571  (*(quint32 *)(m_timsDataFrame.constData() + (offset * 4) + (i * 8) +
572  4)));
573 
574  // intensity normalization
575  data_point.y *= 100.0 / m_accumulationTime;
576 
577  previous = data_point.x;
578  }
579  qDebug();
580  return trace_sptr;
581 }

References getNbrPeaks(), getScanOffset(), pappso::TimsFrameBase::m_accumulationTime, m_timsDataFrame, pappso::DataPoint::x, and pappso::DataPoint::y.

Referenced by extractTimsXicListInRtRange().

◆ getScanIndexList()

std::vector< quint32 > pappso::TimsFrame::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

Definition at line 164 of file timsframe.cpp.

165 {
166  qDebug();
167  checkScanNum(scanNum);
168  std::vector<quint32> scan_tof;
169 
170  if(m_timsDataFrame.size() == 0)
171  return scan_tof;
172  scan_tof.resize(getNbrPeaks(scanNum));
173 
174  std::size_t offset = getScanOffset(scanNum);
175 
176  qint32 previous = -1;
177  for(std::size_t i = 0; i < scan_tof.size(); i++)
178  {
179  scan_tof[i] =
180  (*(quint32 *)(m_timsDataFrame.constData() + (offset * 4) + (i * 8))) +
181  previous;
182  previous = scan_tof[i];
183  }
184  qDebug();
185  return scan_tof;
186 }

References pappso::TimsFrameBase::checkScanNum(), getNbrPeaks(), getScanOffset(), and m_timsDataFrame.

◆ getScanIntensities()

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

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

Definition at line 189 of file timsframe.cpp.

190 {
191  qDebug();
192  checkScanNum(scanNum);
193  std::vector<quint32> scan_intensities;
194 
195  if(m_timsDataFrame.size() == 0)
196  return scan_intensities;
197 
198  scan_intensities.resize(getNbrPeaks(scanNum));
199 
200  std::size_t offset = getScanOffset(scanNum);
201 
202  for(std::size_t i = 0; i < scan_intensities.size(); i++)
203  {
204  scan_intensities[i] = (*(quint32 *)(m_timsDataFrame.constData() +
205  (offset * 4) + (i * 8) + 4));
206  }
207  qDebug();
208  return scan_intensities;
209 }

References pappso::TimsFrameBase::checkScanNum(), getNbrPeaks(), getScanOffset(), and m_timsDataFrame.

◆ getScanOffset()

std::size_t pappso::TimsFrame::getScanOffset ( std::size_t  scanNum) const
private

Definition at line 152 of file timsframe.cpp.

153 {
154  std::size_t offset = 0;
155  for(std::size_t i = 0; i < (scanNum + 1); i++)
156  {
157  offset += (*(quint32 *)(m_timsDataFrame.constData() + (i * 4)));
158  }
159  return offset;
160 }

References m_timsDataFrame.

Referenced by cumulateScan(), getMassSpectrumSPtr(), getRawTraceSPtr(), getScanIndexList(), and getScanIntensities().

◆ getTraceFromCumulatedScans()

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

transform accumulation of raw scans into a real mass spectrum

Definition at line 303 of file timsframe.cpp.

305 {
306  qDebug();
307  // qDebug();
308  // add flanking peaks
309  std::vector<quint32> keys;
310  transform(begin(accumulated_scans),
311  end(accumulated_scans),
312  back_inserter(keys),
313  [](std::map<quint32, quint32>::value_type const &pair) {
314  return pair.first;
315  });
316  std::sort(keys.begin(), keys.end());
317  pappso::DataPoint data_point_cumul;
318  data_point_cumul.x = 0;
319  quint32 previous = 0;
320  quint32 hole_width = 2;
321 
322  pappso::Trace local_trace;
323 
324  bool go_up = true;
325  double previous_intensity = 0;
326  /*
327  for(quint32 key : keys)
328  {
329 
330  data_point_cumul.x =
331  getMzFromTof(getTofFromIndex(key));
332  // normalization
333  data_point_cumul.y =
334  accumulated_scans[key] * ((double)100.0 / m_accumulationTime);
335  mass_spectrum_sptr.get()->push_back(data_point_cumul);
336  }
337 */
338  for(quint32 key : keys)
339  {
340  if((key - previous) > hole_width)
341  {
342 
343  // qDebug() << " key:" << key << " previous:" << previous
344  // << " (key - previous):" << (key - previous);
345  if(data_point_cumul.x != 0)
346  {
347  data_point_cumul.x = data_point_cumul.x / data_point_cumul.y;
348 
349  data_point_cumul.x =
350  getMzFromTof(getTofFromIndex(data_point_cumul.x));
351  // normalization
352  data_point_cumul.y =
353  data_point_cumul.y * ((double)100.0 / m_accumulationTime);
354  local_trace.push_back(data_point_cumul);
355  }
356  // reset
357  data_point_cumul.x = 0;
358  data_point_cumul.y = 0;
359  previous_intensity = 0;
360  go_up = true;
361  }
362  double intensity = accumulated_scans[key];
363 
364  if(previous_intensity < intensity)
365  {
366  if(!go_up)
367  {
368  // stop
369  data_point_cumul.x = data_point_cumul.x / data_point_cumul.y;
370 
371  data_point_cumul.x =
372  getMzFromTof(getTofFromIndex(data_point_cumul.x));
373  // normalization
374  data_point_cumul.y =
375  data_point_cumul.y * ((double)100.0 / m_accumulationTime);
376  local_trace.push_back(data_point_cumul);
377 
378  // reset
379  data_point_cumul.x = 0;
380  data_point_cumul.y = 0;
381  previous_intensity = 0;
382  go_up = true;
383  }
384  }
385  else
386  {
387  if(go_up)
388  {
389  go_up = false;
390  }
391  else
392  {
393  }
394  }
395 
396 
397  data_point_cumul.x += ((double)key * intensity);
398  data_point_cumul.y += intensity;
399  previous = key;
400  previous_intensity = intensity;
401  }
402 
403 
404  if(data_point_cumul.x != 0)
405  {
406  data_point_cumul.x = data_point_cumul.x / data_point_cumul.y;
407 
408  data_point_cumul.x = getMzFromTof(getTofFromIndex(data_point_cumul.x));
409  // normalization
410  data_point_cumul.y =
411  data_point_cumul.y * ((double)100.0 / m_accumulationTime);
412  local_trace.push_back(data_point_cumul);
413  }
414  local_trace.sortX();
415  qDebug();
416  // qDebug();
417  return local_trace;
418 }

References pappso::TimsFrameBase::getMzFromTof(), pappso::TimsFrameBase::getTofFromIndex(), pappso::TimsFrameBase::m_accumulationTime, pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.

◆ unshufflePacket()

void pappso::TimsFrame::unshufflePacket ( const char *  src)
private

Definition at line 95 of file timsframe.cpp.

96 {
97  qDebug();
98  quint64 len = m_timsDataFrame.size();
99  if(len % 4 != 0)
100  {
102  QObject::tr("TimsFrame::unshufflePacket error: len%4 != 0"));
103  }
104 
105  quint64 nb_uint4 = len / 4;
106 
107  char *dest = m_timsDataFrame.data();
108  quint64 src_offset = 0;
109 
110  for(quint64 j = 0; j < 4; j++)
111  {
112  for(quint64 i = 0; i < nb_uint4; i++)
113  {
114  dest[(i * 4) + j] = src[src_offset];
115  src_offset++;
116  }
117  }
118  qDebug();
119 }

References m_timsDataFrame.

Referenced by TimsFrame().

Member Data Documentation

◆ m_timsDataFrame

QByteArray pappso::TimsFrame::m_timsDataFrame
private

◆ TimsDirectXicExtractor

friend pappso::TimsFrame::TimsDirectXicExtractor
private

Definition at line 54 of file timsframe.h.


The documentation for this class was generated from the following files:
pappso::TimsFrameBase::m_digitizerTimebase
double m_digitizerTimebase
Definition: timsframebase.h:160
pappso::TimsFrameBase::checkScanNum
bool checkScanNum(std::size_t scanNum) const
Definition: timsframebase.cpp:84
pappso::TimsFrameBase::m_timsId
std::size_t m_timsId
Tims frame database id (the SQL identifier of this frame)
Definition: timsframebase.h:154
pappso::DataPoint::y
pappso_double y
Definition: datapoint.h:23
pappso::TimsFrame::getMassSpectrumSPtr
virtual pappso::MassSpectrumSPtr getMassSpectrumSPtr(std::size_t scanNum) const override
Definition: timsframe.cpp:428
pappso::DataPoint
Definition: datapoint.h:21
pappso::TimsFrame::getRawTraceSPtr
pappso::TraceSPtr getRawTraceSPtr(std::size_t scanNum) const
Definition: timsframe.cpp:548
pappso::PeptideIonCter::y
@ y
pappso::TimsFrameBase::m_accumulationTime
double m_accumulationTime
accumulation time in milliseconds
Definition: timsframebase.h:158
pappso::TimsFrameBase::m_time
double m_time
retention time
Definition: timsframebase.h:171
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:132
pappso::TimsFrame::m_timsDataFrame
QByteArray m_timsDataFrame
Definition: timsframe.h:154
pappso::TimsFrame::unshufflePacket
void unshufflePacket(const char *src)
Definition: timsframe.cpp:95
pappso::TraceSPtr
std::shared_ptr< Trace > TraceSPtr
Definition: trace.h:119
pappso::TimsFrame::getNbrPeaks
virtual std::size_t getNbrPeaks(std::size_t scanNum) const override
Definition: timsframe.cpp:122
pappso::DataPoint::x
pappso_double x
Definition: datapoint.h:22
pappso::Trace::sortX
void sortX()
Definition: trace.cpp:790
pappso::TimsFrameBase::TimsFrameBase
TimsFrameBase(std::size_t timsId, quint32 scanNum)
constructor for binary independant tims frame
Definition: timsframebase.cpp:37
pappso::XicExtractMethod::sum
@ sum
sum of intensities
pappso::TimsFrameBase::getMzFromTof
double getMzFromTof(double tof) const
get m/z from time of flight
Definition: timsframebase.cpp:136
pappso::TimsFrame::getScanOffset
std::size_t getScanOffset(std::size_t scanNum) const
Definition: timsframe.cpp:152
pappso::TimsFrameBase::m_scanNumber
quint32 m_scanNumber
total number of scans contained in this frame
Definition: timsframebase.h:148
pappso::TimsFrameBase::getTofFromIndex
double getTofFromIndex(quint32 index) const
get time of flight from raw index
Definition: timsframebase.cpp:130
pappso::TimsFrameBase::m_digitizerDelay
double m_digitizerDelay
Definition: timsframebase.h:161
pappso::TimsFrame::cumulateScan
void cumulateScan(std::size_t scanNum, std::map< quint32, quint32 > &accumulate_into) const
cumulate a scan into a map
Definition: timsframe.cpp:213
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:54
pappso::PappsoException
Definition: pappsoexception.h:42