libpappsomspp
Library for mass spectrometry
pappso::PeptideIsotopeSpectrumMatch Class Reference

#include <peptideisotopespectrummatch.h>

Public Types

typedef std::list< PeakIonIsotopeMatch >::const_iterator const_iterator
 

Public Member Functions

 PeptideIsotopeSpectrumMatch (const MassSpectrum &spectrum, const PeptideSp &peptide_sp, unsigned int parent_charge, PrecisionPtr precision, std::list< PeptideIon > ion_list, unsigned int max_isotope_number, unsigned int max_isotope_rank)
 annotate spectrum with peptide ions and isotopes More...
 
 PeptideIsotopeSpectrumMatch (const MassSpectrum &spectrum, std::vector< PeptideNaturalIsotopeAverageSp > v_peptideIsotopeList, std::vector< PeptideFragmentIonSp > v_peptideIonList, PrecisionPtr precision)
 
 PeptideIsotopeSpectrumMatch (const PeptideIsotopeSpectrumMatch &other)
 
 ~PeptideIsotopeSpectrumMatch ()
 
const std::list< PeakIonIsotopeMatch > & getPeakIonIsotopeMatchList () const
 
unsigned int size () const
 
const_iterator begin () const
 
const_iterator end () const
 

Private Member Functions

virtual std::list< DataPoint >::iterator getBestPeakIterator (std::list< DataPoint > &peak_list, const PeptideNaturalIsotopeAverage &ion) const
 

Private Attributes

PrecisionPtr _precision
 
std::list< PeakIonIsotopeMatch_peak_ion_match_list
 

Detailed Description

Definition at line 39 of file peptideisotopespectrummatch.h.

Member Typedef Documentation

◆ const_iterator

Constructor & Destructor Documentation

◆ PeptideIsotopeSpectrumMatch() [1/3]

pappso::PeptideIsotopeSpectrumMatch::PeptideIsotopeSpectrumMatch ( const MassSpectrum spectrum,
const PeptideSp peptide_sp,
unsigned int  parent_charge,
PrecisionPtr  precision,
std::list< PeptideIon ion_list,
unsigned int  max_isotope_number,
unsigned int  max_isotope_rank 
)

annotate spectrum with peptide ions and isotopes

Parameters
spectrumthe spectrum to annotate
peptide_sppeptide to fragment
parent_chargecharge of the ion parent
precisionMS2 mass measurement precision
ion_listion types to compute fragments
max_isotope_numbermaximum isotope number to compute (0 means only monoisotope is computed)
max_isotope_rankmaximum rank inside isotope level to compute

◆ PeptideIsotopeSpectrumMatch() [2/3]

pappso::PeptideIsotopeSpectrumMatch::PeptideIsotopeSpectrumMatch ( const MassSpectrum spectrum,
std::vector< PeptideNaturalIsotopeAverageSp v_peptideIsotopeList,
std::vector< PeptideFragmentIonSp v_peptideIonList,
PrecisionPtr  precision 
)

Definition at line 116 of file peptideisotopespectrummatch.cpp.

121  : _precision(precision)
122 {
123  qDebug() << "PeptideIsotopeSpectrumMatch::PeptideIsotopeSpectrumMatch begin";
124  if(v_peptideIsotopeList.size() != v_peptideIonList.size())
125  {
126  throw PappsoException(
127  QObject::tr(
128  "v_peptideIsotopeList.size() %1 != v_peptideIonList.size() %2")
129  .arg(v_peptideIsotopeList.size())
130  .arg(v_peptideIonList.size()));
131  }
132 
133  auto isotopeIt = v_peptideIsotopeList.begin();
134  auto ionIt = v_peptideIonList.begin();
135  std::list<DataPoint> peak_list(spectrum.begin(), spectrum.end());
136 
137  while(isotopeIt != v_peptideIsotopeList.end())
138  {
139  std::list<DataPoint>::iterator it_peak =
140  getBestPeakIterator(peak_list, *(isotopeIt->get()));
141  if(it_peak != peak_list.end())
142  {
143  _peak_ion_match_list.push_back(
144  PeakIonIsotopeMatch(*it_peak, *isotopeIt, *ionIt));
145  peak_list.erase(it_peak);
146  }
147  isotopeIt++;
148  ionIt++;
149  }
150  qDebug() << "PeptideIsotopeSpectrumMatch::PeptideIsotopeSpectrumMatch end";
151 }

References _peak_ion_match_list, and getBestPeakIterator().

◆ PeptideIsotopeSpectrumMatch() [3/3]

pappso::PeptideIsotopeSpectrumMatch::PeptideIsotopeSpectrumMatch ( const PeptideIsotopeSpectrumMatch other)

Definition at line 154 of file peptideisotopespectrummatch.cpp.

156  : _precision(other._precision),
157  _peak_ion_match_list(other._peak_ion_match_list)
158 {
159 }

◆ ~PeptideIsotopeSpectrumMatch()

pappso::PeptideIsotopeSpectrumMatch::~PeptideIsotopeSpectrumMatch ( )

Definition at line 161 of file peptideisotopespectrummatch.cpp.

162 {
163 }

Member Function Documentation

◆ begin()

const_iterator pappso::PeptideIsotopeSpectrumMatch::begin ( ) const
inline

Definition at line 79 of file peptideisotopespectrummatch.h.

80  {
81  return _peak_ion_match_list.begin();
82  }

◆ end()

const_iterator pappso::PeptideIsotopeSpectrumMatch::end ( ) const
inline

Definition at line 84 of file peptideisotopespectrummatch.h.

85  {
86  return _peak_ion_match_list.end();
87  }

◆ getBestPeakIterator()

std::list< DataPoint >::iterator pappso::PeptideIsotopeSpectrumMatch::getBestPeakIterator ( std::list< DataPoint > &  peak_list,
const PeptideNaturalIsotopeAverage ion 
) const
privatevirtual

Definition at line 167 of file peptideisotopespectrummatch.cpp.

170 {
171  // qDebug();
172  std::list<DataPoint>::iterator itpeak = peak_list.begin();
173  std::list<DataPoint>::iterator itend = peak_list.end();
174  std::list<DataPoint>::iterator itselect = peak_list.end();
175 
176  pappso_double best_intensity = 0;
177 
178  while(itpeak != itend)
179  {
180  if(ion.matchPeak(itpeak->x))
181  {
182  if(itpeak->y > best_intensity)
183  {
184  best_intensity = itpeak->y;
185  itselect = itpeak;
186  }
187  }
188  itpeak++;
189  }
190  // qDebug();
191  return (itselect);
192 }

References pappso::PeptideNaturalIsotopeAverage::matchPeak().

Referenced by PeptideIsotopeSpectrumMatch().

◆ getPeakIonIsotopeMatchList()

const std::list< PeakIonIsotopeMatch > & pappso::PeptideIsotopeSpectrumMatch::getPeakIonIsotopeMatchList ( ) const

◆ size()

unsigned int pappso::PeptideIsotopeSpectrumMatch::size ( ) const
inline

Definition at line 74 of file peptideisotopespectrummatch.h.

75  {
76  return _peak_ion_match_list.size();
77  }

Member Data Documentation

◆ _peak_ion_match_list

std::list<PeakIonIsotopeMatch> pappso::PeptideIsotopeSpectrumMatch::_peak_ion_match_list
private

◆ _precision

PrecisionPtr pappso::PeptideIsotopeSpectrumMatch::_precision
private

Definition at line 94 of file peptideisotopespectrummatch.h.


The documentation for this class was generated from the following files:
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
pappso::PeptideIsotopeSpectrumMatch::_peak_ion_match_list
std::list< PeakIonIsotopeMatch > _peak_ion_match_list
Definition: peptideisotopespectrummatch.h:95
pappso::PeptideIsotopeSpectrumMatch::getBestPeakIterator
virtual std::list< DataPoint >::iterator getBestPeakIterator(std::list< DataPoint > &peak_list, const PeptideNaturalIsotopeAverage &ion) const
Definition: peptideisotopespectrummatch.cpp:167
pappso::PeptideIsotopeSpectrumMatch::_precision
PrecisionPtr _precision
Definition: peptideisotopespectrummatch.h:94