pappso::PeptideSpectrumMatch Class Reference

`#include <peptidespectrummatch.h>`

## Public Types

typedef std::list< PeakIonMatch >::const_iterator | const_iterator

## Public Member Functions

| PeptideSpectrumMatch (const MassSpectrum &spectrum, const pappso::PeptideSp &peptideSp, unsigned int parent_charge, PrecisionPtr precision, const std::list< PeptideIon > &ion_type_list)
| PeptideSpectrumMatch (const MassSpectrum &spectrum, const PeptideFragmentIonListBase &peptide_fragment_ion_list, unsigned int parent_charge, PrecisionPtr precision, const std::list< PeptideIon > &ion_type_list)
| PeptideSpectrumMatch (const MassSpectrum &spectrum, std::vector< PeptideFragmentIonSp > &v_peptide_fragment_ion, std::vector< unsigned int > &v_peptide_fragment_ion_charge, PrecisionPtr precision)
| PeptideSpectrumMatch (const PeptideSpectrumMatch &other)
| ~PeptideSpectrumMatch ()
bool | contains (const PeptideFragmentIon *peptideFragmentIonSp, unsigned int z) const
unsigned int | size () const
const_iterator | begin () const
const_iterator | end () const
unsigned int | countTotalMatchedIons () const
const std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT > & | getIonTypeCountArray () const

## Private Member Functions

void | privMatchIonList (const MassSpectrum &spectrum, const PeptideFragmentIonListBase &fragmentIonList, unsigned int max_charge, const std::list< PeptideIon > &ion_type_list)
virtual std::list< DataPoint >::iterator | getBestPeakIterator (std::list< DataPoint > &peak_list, const PeptideFragmentIonSp &ion, unsigned int charge) const

## Private Attributes

PrecisionPtr | _precision
std::list< PeakIonMatch > | _peak_ion_match_list
std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT > | _ion_type_count = {{0}}

## Detailed Description

Definition at line 43 of file peptidespectrummatch.h.

## Member Typedef Documentation

## const_iterator

typedef std::list<PeakIonMatch>::const_iterator pappso::PeptideSpectrumMatch::const_iterator

Definition at line 69 of file peptidespectrummatch.h.

## Constructor & Destructor Documentation

## PeptideSpectrumMatch() [1/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch | ( | const MassSpectrum & | spectrum,
|  | const pappso::PeptideSp & | peptideSp,
|  | unsigned int | parent_charge,
|  | PrecisionPtr | precision,
|  | const std::list< PeptideIon > & | ion_type_list
| ) |  |

Definition at line 146 of file peptidespectrummatch.cpp.

: _precision(precision)
{
PeptideFragmentIonListBase fragmentIonList(peptideSp, ion_type_list);
privMatchIonList(spectrum, fragmentIonList, parent_charge, ion_type_list);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
<< " _ion_type_count[PeptideIon::y]="
<< _ion_type_count[(std::int8_t)PeptideIon::y];
}
pappso::PeptideSpectrumMatch::privMatchIonList
void privMatchIonList(const MassSpectrum &spectrum, const PeptideFragmentIonListBase &fragmentIonList, unsigned int max_charge, const std::list< PeptideIon > &ion_type_list)
Definition: peptidespectrummatch.cpp:45
pappso::PeptideSpectrumMatch::_ion_type_count
std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT > _ion_type_count
Definition: peptidespectrummatch.h:96
pappso::PeptideSpectrumMatch::_precision
PrecisionPtr _precision
Definition: peptidespectrummatch.h:92
pappso::PeptideIon::y
@ y
Cter amino ions.

References _ion_type_count, privMatchIonList(), and pappso::y.

## PeptideSpectrumMatch() [2/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch | ( | const MassSpectrum & | spectrum,
|  | const PeptideFragmentIonListBase & | peptide_fragment_ion_list,
|  | unsigned int | parent_charge,
|  | PrecisionPtr | precision,
|  | const std::list< PeptideIon > & | ion_type_list
| ) |  |

Definition at line 132 of file peptidespectrummatch.cpp.

: _precision(precision)
{
privMatchIonList(spectrum, fragmentIonList, max_charge, ion_type_list);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
<< " _ion_type_count[PeptideIon::y]="
<< _ion_type_count[(std::int8_t)PeptideIon::y];
}

References _ion_type_count, privMatchIonList(), and pappso::y.

## PeptideSpectrumMatch() [3/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch | ( | const MassSpectrum & | spectrum,
|  | std::vector< PeptideFragmentIonSp > & | v_peptide_fragment_ion,
|  | std::vector< unsigned int > & | v_peptide_fragment_ion_charge,
|  | PrecisionPtr | precision
| ) |  |

Definition at line 86 of file peptidespectrummatch.cpp.

: _precision(precision)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
// throw PappsoException(QObject::tr("v_peptideIsotopeList.size() %1 !=
// v_peptideIonList.size()
// %2").arg(v_peptideIsotopeList.size()).arg(v_peptideIonList.size()));
if(v_peptide_fragment_ion.size() != v_peptide_fragment_ion_charge.size())
{
throw PappsoException(
QObject::tr("v_peptide_fragment_ion.size() != "
"v_peptide_fragment_ion_charge.size() %2")
.arg(v_peptide_fragment_ion.size())
.arg(v_peptide_fragment_ion_charge.size()));
}
auto ionIt = v_peptide_fragment_ion.begin();
auto chargeIt = v_peptide_fragment_ion_charge.begin();
std::list<DataPoint> peak_list(spectrum.begin(), spectrum.end());
while(ionIt != v_peptide_fragment_ion.end())
{
std::list<DataPoint>::iterator it_peak =
getBestPeakIterator(peak_list, *ionIt, *chargeIt);
if(it_peak != peak_list.end())
{
_peak_ion_match_list.push_back(
PeakIonMatch(*it_peak, *ionIt, *chargeIt));
_ion_type_count[(std::int8_t)ionIt->get()->getPeptideIonType()]++;
peak_list.erase(it_peak);
}
ionIt++;
chargeIt++;
}
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
<< " _ion_type_count[PeptideIon::y]="
<< _ion_type_count[(std::int8_t)PeptideIon::y];
}
pappso::PeptideSpectrumMatch::getBestPeakIterator
virtual std::list< DataPoint >::iterator getBestPeakIterator(std::list< DataPoint > &peak_list, const PeptideFragmentIonSp &ion, unsigned int charge) const
Definition: peptidespectrummatch.cpp:169
pappso::PeptideSpectrumMatch::_peak_ion_match_list
std::list< PeakIonMatch > _peak_ion_match_list
Definition: peptidespectrummatch.h:94

References _ion_type_count, _peak_ion_match_list, getBestPeakIterator(), and pappso::y.

## PeptideSpectrumMatch() [4/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch | ( | const PeptideSpectrumMatch & | other | ) |

Definition at line 162 of file peptidespectrummatch.cpp.

: _precision(other._precision),
_peak_ion_match_list(other._peak_ion_match_list)
{
}

## ~PeptideSpectrumMatch()

pappso::PeptideSpectrumMatch::~PeptideSpectrumMatch | ( |  | ) |

Definition at line 202 of file peptidespectrummatch.cpp.

{
}

## Member Function Documentation

## begin()

PeptideSpectrumMatch::const_iterator pappso::PeptideSpectrumMatch::begin | ( |  | ) | const

Definition at line 214 of file peptidespectrummatch.cpp.

{
return _peak_ion_match_list.begin();
}

References _peak_ion_match_list.

## contains()

bool pappso::PeptideSpectrumMatch::contains | ( | const PeptideFragmentIon * | peptideFragmentIonSp,
|  | unsigned int | z
| ) |  | const

Definition at line 237 of file peptidespectrummatch.cpp.

{
auto it = _peak_ion_match_list.begin();
while(it != _peak_ion_match_list.end())
{
const PeakIonMatch &ref = *it;
if((ref.getCharge() == z) &&
(ref.getPeptideFragmentIonSp().get() == peptideFragmentIonSp))
{
return true;
}
it++;
}
return false;
}

References _peak_ion_match_list, pappso::PeakIonMatch::getCharge(), pappso::PeakIonMatch::getPeptideFragmentIonSp(), and pappso::z.

## countTotalMatchedIons()

unsigned int pappso::PeptideSpectrumMatch::countTotalMatchedIons | ( |  | ) | const

Definition at line 225 of file peptidespectrummatch.cpp.

{
return std::accumulate(_ion_type_count.begin(), _ion_type_count.end(), 0);
}

References _ion_type_count.

## end()

PeptideSpectrumMatch::const_iterator pappso::PeptideSpectrumMatch::end | ( |  | ) | const

Definition at line 219 of file peptidespectrummatch.cpp.

{
return _peak_ion_match_list.end();
}

References _peak_ion_match_list.

## getBestPeakIterator()

std::list< DataPoint >::iterator pappso::PeptideSpectrumMatch::getBestPeakIterator | ( | std::list< DataPoint > & | peak_list,
|  | const PeptideFragmentIonSp & | ion,
|  | unsigned int | charge
| ) |  | const

private virtual

Definition at line 169 of file peptidespectrummatch.cpp.

{
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
// << " peak_list.size()=" << peak_list.size();
std::list<DataPoint>::iterator itpeak = peak_list.begin();
std::list<DataPoint>::iterator itend = peak_list.end();
std::list<DataPoint>::iterator itselect = peak_list.end();
pappso_double best_intensity = 0;
while(itpeak != itend)
{
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
// << " itpeak->x=" << itpeak->x;
if(ion.get()->matchPeak(_precision, itpeak->x, charge))
{
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
// << " ion.get()->matchPeak";
if(itpeak->y > best_intensity)
{
best_intensity = itpeak->y;
itselect = itpeak;
}
}
itpeak++;
}
return (itselect);
}
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48

References _precision.

Referenced by PeptideSpectrumMatch(), and privMatchIonList().

## getIonTypeCountArray()

const std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT > & pappso::PeptideSpectrumMatch::getIonTypeCountArray | ( |  | ) | const

Definition at line 231 of file peptidespectrummatch.cpp.

{
return _ion_type_count;
}

References _ion_type_count.

## privMatchIonList()

void pappso::PeptideSpectrumMatch::privMatchIonList | ( | const MassSpectrum & | spectrum,
|  | const PeptideFragmentIonListBase & | fragmentIonList,
|  | unsigned int | max_charge,
|  | const std::list< PeptideIon > & | ion_type_list
| ) |  |

private

Definition at line 45 of file peptidespectrummatch.cpp.

{
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
// << " ion_type_list.size()=" << ion_type_list.size();
std::list<DataPoint> peak_list(spectrum.begin(), spectrum.end());
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
// << " peak_list.size()=" << peak_list.size();
for(auto ion_type : ion_type_list)
{
auto ion_list = fragmentIonList.getPeptideFragmentIonSp(ion_type);
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
// << " ion_list.size()=" << ion_list.size();
for(unsigned int charge = 1; charge <= max_charge; charge++)
{
for(auto &&ion : ion_list)
{
std::list<DataPoint>::iterator it_peak =
getBestPeakIterator(peak_list, ion, charge);
if(it_peak != peak_list.end())
{
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " <<
// __LINE__
// << " peak FOUND";
_peak_ion_match_list.push_back(
PeakIonMatch(*it_peak, ion, charge));
_ion_type_count[(std::int8_t)ion->getPeptideIonType()]++;
peak_list.erase(it_peak);
}
}
}
}
}

References _ion_type_count, _peak_ion_match_list, getBestPeakIterator(), and pappso::PeptideFragmentIonListBase::getPeptideFragmentIonSp().

Referenced by PeptideSpectrumMatch().

## size()

unsigned int pappso::PeptideSpectrumMatch::size | ( |  | ) | const

Definition at line 208 of file peptidespectrummatch.cpp.

{
return _peak_ion_match_list.size();
}

References _peak_ion_match_list.

## Member Data Documentation

## _ion_type_count

std::array<unsigned int, PEPTIDE_ION_TYPE_COUNT> pappso::PeptideSpectrumMatch::_ion_type_count = {{0}}

private

Definition at line 96 of file peptidespectrummatch.h.

Referenced by PeptideSpectrumMatch(), countTotalMatchedIons(), getIonTypeCountArray(), and privMatchIonList().

## _peak_ion_match_list

std::list<PeakIonMatch> pappso::PeptideSpectrumMatch::_peak_ion_match_list

private

Definition at line 94 of file peptidespectrummatch.h.

Referenced by PeptideSpectrumMatch(), begin(), contains(), end(), privMatchIonList(), and size().

## _precision

PrecisionPtr pappso::PeptideSpectrumMatch::_precision

private

Definition at line 92 of file peptidespectrummatch.h.

Referenced by getBestPeakIterator().

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

- pappsomspp/psm/peptidespectrummatch.h
- pappsomspp/psm/peptidespectrummatch.cpp