libpappsomspp
Library for mass spectrometry
msrunretentiontime.cpp
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
4  *
5  * This file is part of the PAPPSOms++ library.
6  *
7  * PAPPSOms++ is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * PAPPSOms++ is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Contributors:
21  * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
22  *implementation
23  ******************************************************************************/
24 
25 #include "msrunretentiontime.h"
26 #include "../../exception/exceptionnotpossible.h"
27 #include <QDebug>
28 //#include <odsstream/odsexception.h>
29 //#include <odsstream/odsdocwriter.h>
30 //#include <QFileInfo>
31 
32 using namespace pappso;
33 
34 /*
35 void
36 writeTrace(const QString &filename, const pappso::Trace &trace)
37 {
38  QFile file(filename);
39  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "() "
40  << QFileInfo(filename).absoluteFilePath();
41  // file.open(QIODevice::WriteOnly);
42  OdsDocWriter writer(&file);
43 
44  for(auto &data_point : trace)
45  {
46  writer.writeCell(data_point.x);
47  writer.writeCell(data_point.y);
48  writer.writeLine();
49  }
50  writer.close();
51 }
52 */
53 
55 {
56 
57  public:
58  RetentionTimeReader(std::vector<RtPoint> &rt_points)
59  : m_rtPoints(rt_points){};
60  virtual ~RetentionTimeReader(){};
61  virtual void
63  {
64  if(spectrum.getMsLevel() == 1)
65  {
66  m_rtPoints.push_back({spectrum.getRtInSeconds(),
67  spectrum.getMassSpectrumId().getSpectrumIndex()});
68  }
69  };
70  virtual bool
71  needPeakList() const override
72  {
73  return false;
74  };
75 
76  private:
77  std::vector<RtPoint> &m_rtPoints;
78 };
79 
80 
81 template <class T>
83  : m_ms2MedianFilter(10), m_ms2MeanFilter(15), m_ms1MeanFilter(1)
84 {
85  msp_msrunReader = msrun_reader_sp;
86  mcsp_msrunId = msp_msrunReader.get()->getMsRunId();
88  msrun_reader_sp.get()->readSpectrumCollection(handler);
89 
90 
91  std::sort(m_ms1RetentionTimeVector.begin(),
93  [](const RtPoint &a, const RtPoint &b) {
94  return (a.retentionTime < b.retentionTime);
95  });
96 }
97 
98 template <class T>
100  : m_ms2MedianFilter(other.m_ms2MedianFilter),
101  m_ms2MeanFilter(other.m_ms2MeanFilter),
102  m_ms1MeanFilter(other.m_ms1MeanFilter)
103 {
105  mcsp_msrunId = other.mcsp_msrunId;
108 
109  m_seamarks = other.m_seamarks;
111 
113 
115 }
116 
117 template <class T>
119 {
120 }
121 
122 template <class T>
123 void
125  const FilterMorphoMedian &ms2MedianFilter)
126 {
127  m_ms2MedianFilter = ms2MedianFilter;
128 }
129 
130 template <class T>
131 void
133 {
134  m_ms2MeanFilter = ms2MeanFilter;
135 }
136 
137 template <class T>
138 void
140 {
141  m_ms1MeanFilter = ms1MeanFilter;
142 }
143 
144 template <class T>
145 const std::vector<MsRunRetentionTimeSeamarkPoint<T>> &
147 {
148  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
149  return m_seamarks;
150 }
151 
152 template <class T>
153 const std::vector<double> &
155 {
156  return m_alignedRetentionTimeVector;
157 }
158 
159 template <class T>
160 std::size_t
162 {
163  return m_valuesCorrected;
164 }
165 template <class T>
166 const std::vector<RtPoint> &
168 {
169  return m_ms1RetentionTimeVector;
170 }
171 
172 template <class T>
173 Trace
175  const std::vector<MsRunRetentionTimeSeamarkPoint<T>> &other_seamarks) const
176 {
177  Trace common_points;
178  getCommonDeltaRt(common_points, other_seamarks);
179  return common_points;
180 }
181 
182 template <class T>
183 void
185  std::size_t ms2_spectrum_index)
186 {
187 
188  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
189  PeptideMs2Point ms2point;
190  ms2point.entityHash = peptide_id;
191  QualifiedMassSpectrum spectrum =
192  msp_msrunReader.get()->qualifiedMassSpectrum(ms2_spectrum_index, false);
193  ms2point.precursorIntensity = spectrum.getPrecursorIntensity();
194  ms2point.retentionTime = spectrum.getRtInSeconds();
195 
196  /*
197  QualifiedMassSpectrum ms1_spectrum =
198  msp_msrunReader.get()->qualifiedMassSpectrum(
199  spectrum.getPrecursorSpectrumIndex(), false);
200  ms2point.ms1_retentionTime = ms1_spectrum.getRtInSeconds();
201  */
202  // addSeamark(m_hash_fn(peptide_str.toStdString()), retentionTime);
203 
204  m_allMs2Points.push_back(ms2point);
205 
206  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
207 }
208 
209 template <class T>
210 void
212 {
213 
214  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
215  if(msp_msrunReader == nullptr)
216  {
217  throw ExceptionNotPossible(
218  QObject::tr("ERROR : msp_msrunReader == nullptr"));
219  }
220  m_seamarks.clear();
221  if(m_retentionTimeReferenceMethod ==
222  ComputeRetentionTimeReference::maximum_intensity)
223  {
224 
225 
226  std::sort(m_allMs2Points.begin(),
227  m_allMs2Points.end(),
228  [](const PeptideMs2Point &a, const PeptideMs2Point &b) {
229  if(a.entityHash == b.entityHash)
230  {
231  return (a.precursorIntensity > b.precursorIntensity);
232  }
233  return (a.entityHash < b.entityHash);
234  });
235 
236  auto itend =
237  std::unique(m_allMs2Points.begin(),
238  m_allMs2Points.end(),
239  [](const PeptideMs2Point &a, const PeptideMs2Point &b) {
240  return (a.entityHash == b.entityHash);
241  });
242 
243  auto it = m_allMs2Points.begin();
244  while(it != itend)
245  {
246  m_seamarks.push_back(
247  {it->entityHash, it->retentionTime, it->precursorIntensity});
248  it++;
249  }
250  }
251  msp_msrunReader = nullptr;
252  m_allMs2Points.clear();
253 
254  std::sort(m_seamarks.begin(),
255  m_seamarks.end(),
258  return (a.entityHash < b.entityHash);
259  });
260  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
261 }
262 
263 template <class T>
264 void
266  Trace &delta_rt,
267  const std::vector<MsRunRetentionTimeSeamarkPoint<T>> &other_seamarks) const
268 {
269 
270  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
271  auto it = other_seamarks.begin();
272 
273  for(const MsRunRetentionTimeSeamarkPoint<T> &seamark : m_seamarks)
274  {
275  while((it != other_seamarks.end()) &&
276  (it->entityHash < seamark.entityHash))
277  {
278  it++;
279  }
280  if(it == other_seamarks.end())
281  break;
282  if(it->entityHash == seamark.entityHash)
283  {
284  delta_rt.push_back(DataPoint(
285  seamark.retentionTime, seamark.retentionTime - it->retentionTime));
286  }
287  }
288 
289  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
290  if((m_ms2MedianFilter.getHalfWindowSize() * 2 + 1) >= delta_rt.size())
291  {
292  throw ExceptionNotPossible(
293  QObject::tr("ERROR : MS2 alignment of MS run '%1' (%2)' not possible : "
294  "\ntoo few MS2 points (%3) in common")
295  .arg(msp_msrunReader.get()->getMsRunId().get()->getXmlId())
296  .arg(msp_msrunReader.get()->getMsRunId().get()->getFileName())
297  .arg(delta_rt.size()));
298  }
299 
300  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
301  if((m_ms2MeanFilter.getHalfWindowSize() * 2 + 1) >= delta_rt.size())
302  {
303  throw ExceptionNotPossible(
304  QObject::tr("ERROR : MS2 alignment of MS run '%1' (%2)' not possible : "
305  "\ntoo few MS2 points (%3) in common")
306  .arg(msp_msrunReader.get()->getMsRunId().get()->getXmlId())
307  .arg(msp_msrunReader.get()->getMsRunId().get()->getFileName())
308  .arg(delta_rt.size()));
309  }
310  delta_rt.sortX();
311 
312  // there can be multiple entities (peptides) at one retention time
313  // in this case, avoid retention time redundancy by applying unique on trace :
314  delta_rt.unique();
315 
316  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
317 }
318 
319 
320 template <class T>
321 double
323 {
324  if(isAligned())
325  {
326  return m_alignedRetentionTimeVector.front();
327  }
328  return m_ms1RetentionTimeVector.front().retentionTime;
329 }
330 template <class T>
331 double
333 {
334  if(isAligned())
335  {
336  return m_alignedRetentionTimeVector.back();
337  }
338  return m_ms1RetentionTimeVector.back().retentionTime;
339 }
340 
341 
342 template <class T>
343 double
345  double original_retention_time) const
346 {
347  if(m_alignedRetentionTimeVector.size() < 3)
348  {
349  throw ExceptionNotPossible(
350  QObject::tr("ERROR : too few aligned points to compute aligned "
351  "retention time (%1)")
352  .arg(m_ms1RetentionTimeVector.size()));
353  }
354  if(m_alignedRetentionTimeVector.size() != m_ms1RetentionTimeVector.size())
355  {
356  throw ExceptionNotPossible(
357  QObject::tr("ERROR : m_alignedRetentionTimeVector.size() %1 != %2 "
358  "m_ms1RetentionTimeVector.size()")
359  .arg(m_alignedRetentionTimeVector.size())
360  .arg(m_ms1RetentionTimeVector.size()));
361  }
362  auto it_plus =
363  std::find_if(m_ms1RetentionTimeVector.begin(),
364  m_ms1RetentionTimeVector.end(),
365  [original_retention_time](const RtPoint &rt_point) {
366  return original_retention_time < rt_point.retentionTime;
367  });
368  double rt1_a, rt2_a, rt1_b, rt2_b;
369  if(it_plus == m_ms1RetentionTimeVector.end())
370  {
371  it_plus--;
372  }
373  if(it_plus == m_ms1RetentionTimeVector.begin())
374  {
375  it_plus++;
376  }
377  auto it_minus = it_plus - 1;
378 
379  rt1_a = it_minus->retentionTime;
380  rt2_a = it_plus->retentionTime;
381 
382  double ratio = (original_retention_time - rt1_a) / (rt2_a - rt1_a);
383 
384  auto itref = m_alignedRetentionTimeVector.begin() +
385  std::distance(m_ms1RetentionTimeVector.begin(), it_minus);
386 
387  rt1_b = *itref;
388  itref++;
389  rt2_b = *itref;
390 
391  return (((rt2_b - rt1_b) * ratio) + rt1_b);
392 }
393 
394 template <class T>
395 const std::vector<MsRunRetentionTimeSeamarkPoint<T>>
397 {
398  std::vector<MsRunRetentionTimeSeamarkPoint<T>> other_seamarks = m_seamarks;
399  for(auto &seamark : other_seamarks)
400  {
401  seamark.retentionTime =
402  translateOriginal2AlignedRetentionTime(seamark.retentionTime);
403  }
404  return other_seamarks;
405 }
406 
407 template <class T>
408 bool
410 {
411  return (m_alignedRetentionTimeVector.size() > 0);
412 }
413 
414 template <class T>
415 Trace
417  const MsRunRetentionTime<T> &msrun_retention_time_reference)
418 {
419  std::vector<MsRunRetentionTimeSeamarkPoint<T>> other_seamarks;
420  if(msrun_retention_time_reference.isAligned())
421  {
422  other_seamarks = msrun_retention_time_reference.getSeamarksReferences();
423  }
424  else
425  {
426  other_seamarks = msrun_retention_time_reference.getSeamarks();
427  }
428  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
429  if((m_ms1MeanFilter.getHalfWindowSize() * 2 + 1) >=
430  m_ms1RetentionTimeVector.size())
431  {
432  throw ExceptionNotPossible(
433  QObject::tr("ERROR : MS1 alignment of MS run '%1' (%2)' not possible : "
434  "\ntoo few MS1 points (%3)")
435  .arg(msp_msrunReader.get()->getMsRunId().get()->getXmlId())
436  .arg(msp_msrunReader.get()->getMsRunId().get()->getFileName())
437  .arg(m_ms1RetentionTimeVector.size()));
438  }
439 
440  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "() "
441  << m_seamarks[0].entityHash << " " << m_seamarks[0].retentionTime
442  << " " << other_seamarks[0].entityHash
443  << other_seamarks[0].retentionTime << " ";
444  // both seamarks has to be ordered
445  Trace common_points;
446  getCommonDeltaRt(common_points, other_seamarks);
447 
448  // writeTrace("lib_ms2_delta_rt.ods", common_points);
449 
450  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "() "
451  << common_points.front().x << " " << common_points.front().y;
452  m_ms2MedianFilter.filter(common_points);
453  // writeTrace("lib_ms2_delta_rt_median.ods", common_points);
454  m_ms2MeanFilter.filter(common_points);
455  // writeTrace("lib_ms2_delta_rt_mean.ods", common_points);
456  // convert common delta rt to real retention times (for convenience)
457  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "() "
458  << common_points.front().x << " " << common_points.front().y;
459 
460 
461  // add a first point to ensure coherence:
462  DataPoint first_point;
463  first_point.x = m_ms1RetentionTimeVector.front().retentionTime - (double)1;
464  if(first_point.x < 0)
465  {
466  first_point.x = 0;
467  }
468  first_point.y =
469  m_ms1RetentionTimeVector.front().retentionTime -
470  msrun_retention_time_reference.getFrontRetentionTimeReference();
471 
472  common_points.push_back(first_point);
473  // add a last point to ensure coherence:
474  DataPoint last_point;
475  last_point.x = m_ms1RetentionTimeVector.back().retentionTime + 1;
476  last_point.y = m_ms1RetentionTimeVector.back().retentionTime -
477  msrun_retention_time_reference.getBackRetentionTimeReference();
478  common_points.push_back(last_point);
479  common_points.sortX();
480 
481  // now, it is possible for each time range to give a new MS1 time using a
482  // linear regression on MS2 corrected times
483  m_alignedRetentionTimeVector.clear();
484 
485  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "() "
486  << common_points.front().x << " " << common_points.front().y;
487 
488  Trace ms1_aligned_points;
489 
490  linearRegressionMs2toMs1(ms1_aligned_points, common_points);
491 
492  // writeTrace("lib_ms1_map_rt.ods", ms1_aligned_points);
493  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
494  // smoothing on MS1 points
495  m_ms1MeanFilter.filter(ms1_aligned_points);
496 
497  // writeTrace("lib_ms1_map_rt_mean.ods", ms1_aligned_points);
498  // final aligned retentionTime vector
499 
500  for(DataPoint &data_point : ms1_aligned_points)
501  {
502  data_point.y = (data_point.x - data_point.y);
503  }
504 
505  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
506  // Here, the correction parameter is the slope of old rt points curve
507  // (divided by 4 to get a finer correction).
508  double correction_parameter =
509  (m_ms1RetentionTimeVector.back().retentionTime -
510  m_ms1RetentionTimeVector.front().retentionTime) /
511  (ms1_aligned_points.size());
512  // set_correction_parameter(correction_parameter / 4);
513  correction_parameter = correction_parameter / (double)4;
514  correctNewTimeValues(ms1_aligned_points, correction_parameter);
515 
516  m_alignedRetentionTimeVector = ms1_aligned_points.yValues();
517 
518  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
519  return ms1_aligned_points;
520 }
521 
522 
523 template <class T>
524 void
526  const Trace &common_points)
527 {
528 
529  // first slope :
530  std::vector<DataPoint>::const_iterator itms2 = common_points.begin();
531  std::vector<DataPoint>::const_iterator itms2next = itms2 + 1;
532  if(itms2next == common_points.end())
533  {
534  // error
535  throw ExceptionNotPossible(
536  QObject::tr("ERROR : MS1 alignment of MS run '%1' (%2)' not possible : "
537  "\ntoo few common points (%3)")
538  .arg(msp_msrunReader.get()->getMsRunId().get()->getXmlId())
539  .arg(msp_msrunReader.get()->getMsRunId().get()->getFileName())
540  .arg(common_points.size()));
541  }
542  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__
543  << "() itms2->x=" << itms2->x << " itms2->y=" << itms2->y;
544 
545  for(RtPoint &original_rt_point : m_ms1RetentionTimeVector)
546  {
547  DataPoint ms1_point;
548  ms1_point.x = original_rt_point.retentionTime;
549 
550  while(ms1_point.x > itms2next->x)
551  {
552  itms2++;
553  itms2next++;
554  }
555 
556  double ratio = (itms2next->x - itms2->x);
557  if(ratio != 0)
558  {
559  ratio = (ms1_point.x - itms2->x) / ratio;
560  }
561  else
562  {
563  // avoid division by zero
564  ratio = 1;
565  }
566  // qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "() " <<
567  // ratio;
568 
569  ms1_point.y = itms2->y + ((itms2next->y - itms2->y) * ratio);
570 
571  // qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "() "
572  // << ms1_point.y;
573  ms1_aligned_points.push_back(ms1_point);
574  }
575 }
576 
577 template <class T>
578 void
580  double correction_parameter)
581 {
582 
583  m_valuesCorrected = 0;
584  auto new_it(ms1_aligned_points.begin());
585  auto new_nextit(ms1_aligned_points.begin());
586  new_nextit++;
587  for(; new_nextit != ms1_aligned_points.end(); ++new_nextit, ++new_it)
588  {
589  if(new_nextit->y < new_it->y)
590  {
591  ++m_valuesCorrected;
592  new_nextit->y = new_it->y + correction_parameter;
593  }
594  }
595 }
pappso::MsRunRetentionTime::PeptideMs2Point::precursorIntensity
double precursorIntensity
Definition: msrunretentiontime.h:55
pappso::MsRunRetentionTime::msp_msrunReader
pappso::MsRunReaderSPtr msp_msrunReader
Definition: msrunretentiontime.h:123
pappso::QualifiedMassSpectrum::getMsLevel
uint getMsLevel() const
Get the mass spectrum level.
Definition: qualifiedmassspectrum.cpp:214
pappso::MsRunRetentionTime::getAlignedRetentionTimeVector
const std::vector< double > & getAlignedRetentionTimeVector() const
Definition: msrunretentiontime.cpp:154
RetentionTimeReader::RetentionTimeReader
RetentionTimeReader(std::vector< RtPoint > &rt_points)
Definition: msrunretentiontime.cpp:58
pappso::MsRunRetentionTime::PeptideMs2Point
Definition: msrunretentiontime.h:53
pappso::MsRunRetentionTime::PeptideMs2Point::retentionTime
double retentionTime
Definition: msrunretentiontime.h:54
pappso::MsRunRetentionTime::setMs2MedianFilter
void setMs2MedianFilter(const FilterMorphoMedian &ms2MedianFilter)
Definition: msrunretentiontime.cpp:124
pappso::FilterMorphoMedian
median filter apply median of y values inside the window
Definition: filtermorpho.h:178
pappso::MsRunRetentionTime::m_valuesCorrected
std::size_t m_valuesCorrected
Definition: msrunretentiontime.h:129
RetentionTimeReader::m_rtPoints
std::vector< RtPoint > & m_rtPoints
Definition: msrunretentiontime.cpp:74
pappso::DataPoint::y
pappso_double y
Definition: datapoint.h:23
pappso::MsRunRetentionTime::m_allMs2Points
std::vector< PeptideMs2Point > m_allMs2Points
Definition: msrunretentiontime.h:131
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
Definition: aa.cpp:39
pappso::MsRunRetentionTime::getMs1RetentionTimeVector
const std::vector< RtPoint > & getMs1RetentionTimeVector() const
Definition: msrunretentiontime.cpp:167
pappso::MsRunReaderSPtr
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition: msrunreader.h:151
pappso::MsRunRetentionTime::getSeamarksReferences
const std::vector< MsRunRetentionTimeSeamarkPoint< T > > getSeamarksReferences() const
Definition: msrunretentiontime.cpp:396
pappso::MsRunRetentionTime::getCommonDeltaRt
Trace getCommonDeltaRt(const std::vector< MsRunRetentionTimeSeamarkPoint< T >> &other_seamarks) const
Definition: msrunretentiontime.cpp:174
pappso::DataPoint
Definition: datapoint.h:21
pappso::MsRunRetentionTime::computePeptideRetentionTimes
void computePeptideRetentionTimes()
convert Peptide seamarks into PeptideMs2Point this is required before computing alignment
Definition: msrunretentiontime.cpp:211
pappso::MsRunRetentionTime::setMs2MeanFilter
void setMs2MeanFilter(const FilterMorphoMean &ms2MeanFilter)
Definition: msrunretentiontime.cpp:132
pappso::ExceptionNotPossible
Definition: exceptionnotpossible.h:32
pappso::QualifiedMassSpectrum::getPrecursorIntensity
pappso_double getPrecursorIntensity() const
Get the intensity of the precursor ion.
Definition: qualifiedmassspectrum.cpp:301
pappso::MsRunRetentionTime::m_ms1RetentionTimeVector
std::vector< RtPoint > m_ms1RetentionTimeVector
Definition: msrunretentiontime.h:125
pappso::MsRunRetentionTime::setMs1MeanFilter
void setMs1MeanFilter(const FilterMorphoMean &ms1MeanFilter)
Definition: msrunretentiontime.cpp:139
pappso::Trace::filter
virtual Trace & filter(const FilterInterface &filter) final
apply a filter on this trace
Definition: trace.cpp:828
pappso::MsRunRetentionTime::getNumberOfCorrectedValues
std::size_t getNumberOfCorrectedValues() const
Definition: msrunretentiontime.cpp:161
pappso::MsRunRetentionTime::getBackRetentionTimeReference
double getBackRetentionTimeReference() const
Definition: msrunretentiontime.cpp:332
RetentionTimeReader
Definition: msrunretentiontime.cpp:55
pappso::MsRunRetentionTimeSeamarkPoint
Definition: msrunretentiontime.h:41
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:132
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:68
pappso::Trace::unique
void unique()
Definition: trace.cpp:799
msrunretentiontime.h
pappso::MsRunRetentionTime
Definition: msrunretentiontime.h:50
pappso::DataPoint::x
pappso_double x
Definition: datapoint.h:22
pappso::MassSpectrumId::getSpectrumIndex
std::size_t getSpectrumIndex() const
Definition: massspectrumid.cpp:110
pappso::Trace::sortX
void sortX()
Definition: trace.cpp:790
pappso::MsRunRetentionTime::MsRunRetentionTime
MsRunRetentionTime(MsRunReaderSPtr msrun_reader_sp)
Definition: msrunretentiontime.cpp:82
pappso::RtPoint
Definition: msrunretentiontime.h:33
pappso::FilterMorphoMean
mean filter apply mean of y values inside the window : this results in a kind of smoothing
Definition: filtermorpho.h:197
pappso::MsRunRetentionTime::addPeptideAsSeamark
void addPeptideAsSeamark(const T &peptide_str, std::size_t ms2_spectrum_index)
collects all peptide evidences of a given MSrun seamarks has to be converted to peptide retention tim...
Definition: msrunretentiontime.cpp:184
pappso::QualifiedMassSpectrum::getMassSpectrumId
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
Definition: qualifiedmassspectrum.cpp:128
pappso::MsRunRetentionTime::m_retentionTimeReferenceMethod
ComputeRetentionTimeReference m_retentionTimeReferenceMethod
Definition: msrunretentiontime.h:133
pappso::MsRunRetentionTime::isAligned
bool isAligned() const
Definition: msrunretentiontime.cpp:409
pappso::MsRunRetentionTime::m_alignedRetentionTimeVector
std::vector< double > m_alignedRetentionTimeVector
Definition: msrunretentiontime.h:126
pappso::MsRunRetentionTime::mcsp_msrunId
pappso::MsRunIdCstSPtr mcsp_msrunId
Definition: msrunretentiontime.h:124
pappso::MsRunRetentionTime::PeptideMs2Point::entityHash
T entityHash
Definition: msrunretentiontime.h:56
RetentionTimeReader::~RetentionTimeReader
virtual ~RetentionTimeReader()
Definition: msrunretentiontime.cpp:60
pappso::MsRunRetentionTime::~MsRunRetentionTime
~MsRunRetentionTime()
Definition: msrunretentiontime.cpp:118
pappso::MsRunRetentionTime::m_seamarks
std::vector< MsRunRetentionTimeSeamarkPoint< T > > m_seamarks
Definition: msrunretentiontime.h:128
pappso::MsRunRetentionTime::getFrontRetentionTimeReference
double getFrontRetentionTimeReference() const
Definition: msrunretentiontime.cpp:322
RetentionTimeReader::setQualifiedMassSpectrum
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
Definition: msrunretentiontime.cpp:62
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition: msrunreader.h:59
RetentionTimeReader::needPeakList
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
Definition: msrunretentiontime.cpp:71
pappso::MsRunRetentionTime::getSeamarks
const std::vector< MsRunRetentionTimeSeamarkPoint< T > > & getSeamarks() const
Definition: msrunretentiontime.cpp:146
pappso::QualifiedMassSpectrum::getRtInSeconds
pappso_double getRtInSeconds() const
Get the retention time in seconds.
Definition: qualifiedmassspectrum.cpp:230