libpappsomspp
Library for mass spectrometry
pappso::MsRunRetentionTime< T > Class Template Reference

#include <msrunretentiontime.h>

Classes

struct  PeptideMs2Point
 

Public Member Functions

 MsRunRetentionTime (MsRunReaderSPtr msrun_reader_sp)
 
 MsRunRetentionTime (const MsRunRetentionTime< T > &other)
 
 ~MsRunRetentionTime ()
 
void setMs2MedianFilter (const FilterMorphoMedian &ms2MedianFilter)
 
void setMs2MeanFilter (const FilterMorphoMean &ms2MeanFilter)
 
void setMs1MeanFilter (const FilterMorphoMean &ms1MeanFilter)
 
Trace getCommonDeltaRt (const std::vector< MsRunRetentionTimeSeamarkPoint< T >> &other_seamarks) const
 
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 time using computePeptideRetentionTimes More...
 
void computePeptideRetentionTimes ()
 convert Peptide seamarks into PeptideMs2Point this is required before computing alignment More...
 
std::size_t getNumberOfCorrectedValues () const
 
Trace align (const MsRunRetentionTime< T > &msrun_retention_time_reference)
 
const std::vector< MsRunRetentionTimeSeamarkPoint< T > > & getSeamarks () const
 
const std::vector< double > & getAlignedRetentionTimeVector () const
 
const std::vector< RtPoint > & getMs1RetentionTimeVector () const
 
bool isAligned () const
 
double translateOriginal2AlignedRetentionTime (double original_retention_time) const
 

Protected Member Functions

double getFrontRetentionTimeReference () const
 
double getBackRetentionTimeReference () const
 
const std::vector< MsRunRetentionTimeSeamarkPoint< T > > getSeamarksReferences () const
 

Private Types

enum  ComputeRetentionTimeReference { ComputeRetentionTimeReference::maximum_intensity, ComputeRetentionTimeReference::weighted_intensity, ComputeRetentionTimeReference::last }
 

Private Member Functions

void getCommonDeltaRt (Trace &delta_rt, const std::vector< MsRunRetentionTimeSeamarkPoint< T >> &other_seamarks) const
 
void correctNewTimeValues (Trace &ms1_aligned_points, double correction_parameter)
 
void linearRegressionMs2toMs1 (Trace &ms1_aligned_points, const Trace &common_points)
 

Private Attributes

FilterMorphoMedian m_ms2MedianFilter
 
FilterMorphoMean m_ms2MeanFilter
 
FilterMorphoMean m_ms1MeanFilter
 
pappso::MsRunReaderSPtr msp_msrunReader
 
pappso::MsRunIdCstSPtr mcsp_msrunId
 
std::vector< RtPointm_ms1RetentionTimeVector
 
std::vector< double > m_alignedRetentionTimeVector
 
std::vector< MsRunRetentionTimeSeamarkPoint< T > > m_seamarks
 
std::size_t m_valuesCorrected = 0
 
std::vector< PeptideMs2Pointm_allMs2Points
 
ComputeRetentionTimeReference m_retentionTimeReferenceMethod
 

Detailed Description

template<class T>
class pappso::MsRunRetentionTime< T >

Definition at line 67 of file msrunretentiontime.h.

Member Enumeration Documentation

◆ ComputeRetentionTimeReference

template<class T >
enum pappso::MsRunRetentionTime::ComputeRetentionTimeReference
strongprivate
Enumerator
maximum_intensity 
weighted_intensity 
last 

Definition at line 77 of file msrunretentiontime.h.

Constructor & Destructor Documentation

◆ MsRunRetentionTime() [1/2]

template<class T >
MsRunRetentionTime::MsRunRetentionTime ( MsRunReaderSPtr  msrun_reader_sp)

Definition at line 82 of file msrunretentiontime.cpp.

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 }

References pappso::a, pappso::b, pappso::MsRunRetentionTime< T >::m_ms1RetentionTimeVector, pappso::MsRunRetentionTime< T >::mcsp_msrunId, and pappso::MsRunRetentionTime< T >::msp_msrunReader.

◆ MsRunRetentionTime() [2/2]

◆ ~MsRunRetentionTime()

template<class T >
MsRunRetentionTime::~MsRunRetentionTime

Definition at line 118 of file msrunretentiontime.cpp.

119 {
120 }

Member Function Documentation

◆ addPeptideAsSeamark()

template<class T >
void MsRunRetentionTime::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 time using computePeptideRetentionTimes

Definition at line 184 of file msrunretentiontime.cpp.

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 }

References pappso::MsRunRetentionTime< T >::PeptideMs2Point::entityHash, pappso::QualifiedMassSpectrum::getPrecursorIntensity(), pappso::QualifiedMassSpectrum::getRtInSeconds(), pappso::MsRunRetentionTime< T >::PeptideMs2Point::precursorIntensity, and pappso::MsRunRetentionTime< T >::PeptideMs2Point::retentionTime.

◆ align()

template<class T >
Trace MsRunRetentionTime::align ( const MsRunRetentionTime< T > &  msrun_retention_time_reference)

Definition at line 416 of file msrunretentiontime.cpp.

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) >=
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
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 }

References pappso::Trace::filter(), pappso::MsRunRetentionTime< T >::getBackRetentionTimeReference(), pappso::MsRunRetentionTime< T >::getFrontRetentionTimeReference(), pappso::MsRunRetentionTime< T >::getSeamarks(), pappso::MsRunRetentionTime< T >::getSeamarksReferences(), pappso::MsRunRetentionTime< T >::isAligned(), pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.

◆ computePeptideRetentionTimes()

template<class T >
void MsRunRetentionTime::computePeptideRetentionTimes

convert Peptide seamarks into PeptideMs2Point this is required before computing alignment

Definition at line 211 of file msrunretentiontime.cpp.

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();
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 }

References pappso::a, and pappso::b.

◆ correctNewTimeValues()

template<class T >
void MsRunRetentionTime::correctNewTimeValues ( Trace ms1_aligned_points,
double  correction_parameter 
)
private

Definition at line 579 of file msrunretentiontime.cpp.

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  {
592  new_nextit->y = new_it->y + correction_parameter;
593  }
594  }
595 }

◆ getAlignedRetentionTimeVector()

template<class T >
const std::vector< double > & MsRunRetentionTime::getAlignedRetentionTimeVector

Definition at line 154 of file msrunretentiontime.cpp.

155 {
157 }

◆ getBackRetentionTimeReference()

template<class T >
double MsRunRetentionTime::getBackRetentionTimeReference
protected

Definition at line 332 of file msrunretentiontime.cpp.

333 {
334  if(isAligned())
335  {
336  return m_alignedRetentionTimeVector.back();
337  }
338  return m_ms1RetentionTimeVector.back().retentionTime;
339 }

Referenced by pappso::MsRunRetentionTime< T >::align().

◆ getCommonDeltaRt() [1/2]

template<class T >
Trace MsRunRetentionTime::getCommonDeltaRt ( const std::vector< MsRunRetentionTimeSeamarkPoint< T >> &  other_seamarks) const

Definition at line 174 of file msrunretentiontime.cpp.

176 {
177  Trace common_points;
178  getCommonDeltaRt(common_points, other_seamarks);
179  return common_points;
180 }

◆ getCommonDeltaRt() [2/2]

template<class T >
void MsRunRetentionTime::getCommonDeltaRt ( Trace delta_rt,
const std::vector< MsRunRetentionTimeSeamarkPoint< T >> &  other_seamarks 
) const
private

Definition at line 265 of file msrunretentiontime.cpp.

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 }

References pappso::Trace::sortX(), and pappso::Trace::unique().

◆ getFrontRetentionTimeReference()

template<class T >
double MsRunRetentionTime::getFrontRetentionTimeReference
protected

Definition at line 322 of file msrunretentiontime.cpp.

323 {
324  if(isAligned())
325  {
326  return m_alignedRetentionTimeVector.front();
327  }
328  return m_ms1RetentionTimeVector.front().retentionTime;
329 }

Referenced by pappso::MsRunRetentionTime< T >::align().

◆ getMs1RetentionTimeVector()

template<class T >
const std::vector< RtPoint > & MsRunRetentionTime::getMs1RetentionTimeVector

Definition at line 167 of file msrunretentiontime.cpp.

168 {
170 }

◆ getNumberOfCorrectedValues()

template<class T >
std::size_t MsRunRetentionTime::getNumberOfCorrectedValues

Definition at line 161 of file msrunretentiontime.cpp.

162 {
163  return m_valuesCorrected;
164 }

◆ getSeamarks()

template<class T >
const std::vector< MsRunRetentionTimeSeamarkPoint< T > > & MsRunRetentionTime::getSeamarks

Definition at line 146 of file msrunretentiontime.cpp.

147 {
148  qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()";
149  return m_seamarks;
150 }

Referenced by pappso::MsRunRetentionTime< T >::align().

◆ getSeamarksReferences()

template<class T >
const std::vector< MsRunRetentionTimeSeamarkPoint< T > > MsRunRetentionTime::getSeamarksReferences
protected

Definition at line 396 of file msrunretentiontime.cpp.

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 }

Referenced by pappso::MsRunRetentionTime< T >::align().

◆ isAligned()

template<class T >
bool MsRunRetentionTime::isAligned

Definition at line 409 of file msrunretentiontime.cpp.

410 {
411  return (m_alignedRetentionTimeVector.size() > 0);
412 }

Referenced by pappso::MsRunRetentionTime< T >::align().

◆ linearRegressionMs2toMs1()

template<class T >
void MsRunRetentionTime::linearRegressionMs2toMs1 ( Trace ms1_aligned_points,
const Trace common_points 
)
private

Definition at line 525 of file msrunretentiontime.cpp.

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 }

References pappso::DataPoint::x, and pappso::DataPoint::y.

◆ setMs1MeanFilter()

template<class T >
void MsRunRetentionTime::setMs1MeanFilter ( const FilterMorphoMean ms1MeanFilter)

Definition at line 139 of file msrunretentiontime.cpp.

140 {
141  m_ms1MeanFilter = ms1MeanFilter;
142 }

◆ setMs2MeanFilter()

template<class T >
void MsRunRetentionTime::setMs2MeanFilter ( const FilterMorphoMean ms2MeanFilter)

Definition at line 132 of file msrunretentiontime.cpp.

133 {
134  m_ms2MeanFilter = ms2MeanFilter;
135 }

◆ setMs2MedianFilter()

template<class T >
void MsRunRetentionTime::setMs2MedianFilter ( const FilterMorphoMedian ms2MedianFilter)

Definition at line 124 of file msrunretentiontime.cpp.

126 {
127  m_ms2MedianFilter = ms2MedianFilter;
128 }

◆ translateOriginal2AlignedRetentionTime()

template<class T >
double MsRunRetentionTime::translateOriginal2AlignedRetentionTime ( double  original_retention_time) const

Definition at line 344 of file msrunretentiontime.cpp.

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  }
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(),
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 }

Member Data Documentation

◆ m_alignedRetentionTimeVector

template<class T >
std::vector<double> pappso::MsRunRetentionTime< T >::m_alignedRetentionTimeVector
private

◆ m_allMs2Points

template<class T >
std::vector<PeptideMs2Point> pappso::MsRunRetentionTime< T >::m_allMs2Points
private

◆ m_ms1MeanFilter

template<class T >
FilterMorphoMean pappso::MsRunRetentionTime< T >::m_ms1MeanFilter
private

Definition at line 140 of file msrunretentiontime.h.

◆ m_ms1RetentionTimeVector

template<class T >
std::vector<RtPoint> pappso::MsRunRetentionTime< T >::m_ms1RetentionTimeVector
private

◆ m_ms2MeanFilter

template<class T >
FilterMorphoMean pappso::MsRunRetentionTime< T >::m_ms2MeanFilter
private

Definition at line 139 of file msrunretentiontime.h.

◆ m_ms2MedianFilter

template<class T >
FilterMorphoMedian pappso::MsRunRetentionTime< T >::m_ms2MedianFilter
private

Definition at line 138 of file msrunretentiontime.h.

◆ m_retentionTimeReferenceMethod

template<class T >
ComputeRetentionTimeReference pappso::MsRunRetentionTime< T >::m_retentionTimeReferenceMethod
private

◆ m_seamarks

template<class T >
std::vector<MsRunRetentionTimeSeamarkPoint<T> > pappso::MsRunRetentionTime< T >::m_seamarks
private

◆ m_valuesCorrected

template<class T >
std::size_t pappso::MsRunRetentionTime< T >::m_valuesCorrected = 0
private

◆ mcsp_msrunId

template<class T >
pappso::MsRunIdCstSPtr pappso::MsRunRetentionTime< T >::mcsp_msrunId
private

◆ msp_msrunReader

template<class T >
pappso::MsRunReaderSPtr pappso::MsRunRetentionTime< T >::msp_msrunReader
private

The documentation for this class was generated from the following files:
pappso::MsRunRetentionTime::msp_msrunReader
pappso::MsRunReaderSPtr msp_msrunReader
Definition: msrunretentiontime.h:141
pappso::MsRunRetentionTime::m_valuesCorrected
std::size_t m_valuesCorrected
Definition: msrunretentiontime.h:147
pappso::DataPoint::y
pappso_double y
Definition: datapoint.h:23
pappso::MsRunRetentionTime::m_allMs2Points
std::vector< PeptideMs2Point > m_allMs2Points
Definition: msrunretentiontime.h:149
pappso::MsRunRetentionTime::correctNewTimeValues
void correctNewTimeValues(Trace &ms1_aligned_points, double correction_parameter)
Definition: msrunretentiontime.cpp:579
pappso::MsRunRetentionTime::getSeamarksReferences
const std::vector< MsRunRetentionTimeSeamarkPoint< T > > getSeamarksReferences() const
Definition: msrunretentiontime.cpp:396
pappso::FilterMorphoWindowBase::filter
virtual Trace & filter(Trace &data_points) const override
Definition: filtermorpho.cpp:60
pappso::PeptideIonNter::a
@ a
pappso::MsRunRetentionTime::getCommonDeltaRt
Trace getCommonDeltaRt(const std::vector< MsRunRetentionTimeSeamarkPoint< T >> &other_seamarks) const
Definition: msrunretentiontime.cpp:174
pappso::DataPoint
Definition: datapoint.h:21
pappso::ExceptionNotPossible
Definition: exceptionnotpossible.h:53
pappso::QualifiedMassSpectrum::getPrecursorIntensity
pappso_double getPrecursorIntensity() const
Get the intensity of the precursor ion.
Definition: qualifiedmassspectrum.cpp:319
pappso::MsRunRetentionTime::m_ms2MeanFilter
FilterMorphoMean m_ms2MeanFilter
Definition: msrunretentiontime.h:139
pappso::MsRunRetentionTime::m_ms1RetentionTimeVector
std::vector< RtPoint > m_ms1RetentionTimeVector
Definition: msrunretentiontime.h:143
pappso::MsRunRetentionTime::getBackRetentionTimeReference
double getBackRetentionTimeReference() const
Definition: msrunretentiontime.cpp:332
RetentionTimeReader
Definition: msrunretentiontime.cpp:55
pappso::MsRunRetentionTimeSeamarkPoint
Definition: msrunretentiontime.h:59
pappso::MsRunRetentionTime::m_ms2MedianFilter
FilterMorphoMedian m_ms2MedianFilter
Definition: msrunretentiontime.h:138
pappso::MsRunRetentionTime::ComputeRetentionTimeReference::maximum_intensity
@ maximum_intensity
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:132
pappso::FilterMorphoWindowBase::getHalfWindowSize
virtual std::size_t getHalfWindowSize() const
Definition: filtermorpho.cpp:45
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:86
pappso::Trace::unique
void unique()
Definition: trace.cpp:757
pappso::DataPoint::x
pappso_double x
Definition: datapoint.h:22
pappso::Trace::sortX
void sortX()
Definition: trace.cpp:748
pappso::MsRunRetentionTime::linearRegressionMs2toMs1
void linearRegressionMs2toMs1(Trace &ms1_aligned_points, const Trace &common_points)
Definition: msrunretentiontime.cpp:525
pappso::RtPoint
Definition: msrunretentiontime.h:51
pappso::MsRunRetentionTime::m_ms1MeanFilter
FilterMorphoMean m_ms1MeanFilter
Definition: msrunretentiontime.h:140
pappso::MsRunRetentionTime::m_retentionTimeReferenceMethod
ComputeRetentionTimeReference m_retentionTimeReferenceMethod
Definition: msrunretentiontime.h:151
pappso::MsRunRetentionTime::isAligned
bool isAligned() const
Definition: msrunretentiontime.cpp:409
pappso::PeptideIonNter::b
@ b
pappso::MsRunRetentionTime::m_alignedRetentionTimeVector
std::vector< double > m_alignedRetentionTimeVector
Definition: msrunretentiontime.h:144
pappso::MsRunRetentionTime::mcsp_msrunId
pappso::MsRunIdCstSPtr mcsp_msrunId
Definition: msrunretentiontime.h:142
pappso::MsRunRetentionTime::translateOriginal2AlignedRetentionTime
double translateOriginal2AlignedRetentionTime(double original_retention_time) const
Definition: msrunretentiontime.cpp:344
pappso::MsRunRetentionTime::m_seamarks
std::vector< MsRunRetentionTimeSeamarkPoint< T > > m_seamarks
Definition: msrunretentiontime.h:146
pappso::MsRunRetentionTime::getFrontRetentionTimeReference
double getFrontRetentionTimeReference() const
Definition: msrunretentiontime.cpp:322
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:248