pappso::PeptideNaturalIsotopeAverage Class Reference

`#include <peptidenaturalisotopeaverage.h>`

## Public Member Functions

| PeptideNaturalIsotopeAverage (const PeptideInterfaceSp &peptide, unsigned int askedIsotopeRank, unsigned int isotopeLevel, unsigned int charge, PrecisionPtr precision)
| PeptideNaturalIsotopeAverage (const PeptideNaturalIsotopeList &isotopeList, unsigned int askedIsotopeRank, unsigned int isotopeLevel, unsigned int charge, PrecisionPtr precision)
| PeptideNaturalIsotopeAverage (const PeptideNaturalIsotopeAverage &other)
| ~PeptideNaturalIsotopeAverage ()
PeptideNaturalIsotopeAverageSp | makePeptideNaturalIsotopeAverageSp () const
pappso_double | getMz () const
pappso_double | getIntensityRatio () const
unsigned int | getCharge () const
unsigned int | getIsotopeNumber () const
unsigned int | getIsotopeRank () const
const std::vector< PeptideNaturalIsotopeSp > & | getComponents () const
const PeptideInterfaceSp & | getPeptideInterfaceSp () const
PrecisionPtr | getPrecision () const
virtual bool | matchPeak (pappso_double peak_mz) const final
bool | isEmpty () const

## Private Member Functions

void | recursiveDepletion (std::vector< PeptideNaturalIsotopeSp > &v_isotope_list, unsigned int rank)

## Private Attributes

const PeptideInterfaceSp | mcsp_peptideSp
std::vector< PeptideNaturalIsotopeSp > | m_peptideNaturalIsotopeSpList
pappso_double | m_averageMz
pappso_double | m_abundanceRatio
unsigned int | m_isotopeLevel
unsigned int | m_isotopeRank = 1
unsigned int | m_z
PrecisionPtr | mp_precision = nullptr

## Detailed Description

Definition at line 42 of file peptidenaturalisotopeaverage.h.

## Constructor & Destructor Documentation

## PeptideNaturalIsotopeAverage() [1/3]

pappso::PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage | ( | const PeptideInterfaceSp & | peptide,
|  | unsigned int | askedIsotopeRank,
|  | unsigned int | isotopeLevel,
|  | unsigned int | charge,
|  | PrecisionPtr | precision
| ) |  |

Definition at line 32 of file peptidenaturalisotopeaverage.cpp.

: PeptideNaturalIsotopeAverage(PeptideNaturalIsotopeList(peptide),
askedIsotopeRank,
isotopeLevel,
charge,
precision)
{
}
pappso::PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage
PeptideNaturalIsotopeAverage(const PeptideInterfaceSp &peptide, unsigned int askedIsotopeRank, unsigned int isotopeLevel, unsigned int charge, PrecisionPtr precision)
Definition: peptidenaturalisotopeaverage.cpp:32

## PeptideNaturalIsotopeAverage() [2/3]

pappso::PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage | ( | const PeptideNaturalIsotopeList & | isotopeList,
|  | unsigned int | askedIsotopeRank,
|  | unsigned int | isotopeLevel,
|  | unsigned int | charge,
|  | PrecisionPtr | precision
| ) |  |

Definition at line 46 of file peptidenaturalisotopeaverage.cpp.

: mcsp_peptideSp(isotopeList.getPeptideInterfaceSp()),
m_isotopeLevel(isotope_number),
m_isotopeRank(askedIsotopeRank),
m_z(charge),
mp_precision(precision)
{ // get the askedIsotopeRank :
std::vector<PeptideNaturalIsotopeSp> v_isotope_list(
isotopeList.getByIsotopeNumber(isotope_number, m_z));
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
// << "v_isotope_list.size()=" << v_isotope_list.size() << " "
// << isotope_number << " " << askedIsotopeRank;
m_abundanceRatio = 0;
m_averageMz = 0;
if(askedIsotopeRank > v_isotope_list.size())
{
// there is no isotope at this rank
return;
// throw PappsoException(QObject::tr("askedIsotopeRank greater than
// v_isotope_list.size() %1 vs
// %2").arg(askedIsotopeRank).arg(v_isotope_list.size()));
}
else if(askedIsotopeRank < 1)
{
throw PappsoException(
QObject::tr("askedIsotopeRank must be 1 or more and not %1")
.arg(askedIsotopeRank));
}
unsigned int rank = 0;
recursiveDepletion(v_isotope_list, rank);
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
}
pappso::PeptideNaturalIsotopeAverage::m_abundanceRatio
pappso_double m_abundanceRatio
Definition: peptidenaturalisotopeaverage.h:81
pappso::PeptideNaturalIsotopeAverage::mcsp_peptideSp
const PeptideInterfaceSp mcsp_peptideSp
Definition: peptidenaturalisotopeaverage.h:77
pappso::PeptideNaturalIsotopeAverage::m_isotopeRank
unsigned int m_isotopeRank
Definition: peptidenaturalisotopeaverage.h:83
pappso::PeptideNaturalIsotopeAverage::m_isotopeLevel
unsigned int m_isotopeLevel
Definition: peptidenaturalisotopeaverage.h:82
pappso::PeptideNaturalIsotopeAverage::recursiveDepletion
void recursiveDepletion(std::vector< PeptideNaturalIsotopeSp > &v_isotope_list, unsigned int rank)
Definition: peptidenaturalisotopeaverage.cpp:90
pappso::PeptideNaturalIsotopeAverage::m_averageMz
pappso_double m_averageMz
Definition: peptidenaturalisotopeaverage.h:80
pappso::PeptideNaturalIsotopeAverage::m_z
unsigned int m_z
Definition: peptidenaturalisotopeaverage.h:84
pappso::PeptideNaturalIsotopeAverage::mp_precision
PrecisionPtr mp_precision
Definition: peptidenaturalisotopeaverage.h:85

References pappso::PeptideNaturalIsotopeList::getByIsotopeNumber(), m_abundanceRatio, m_averageMz, m_z, and recursiveDepletion().

## PeptideNaturalIsotopeAverage() [3/3]

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

Definition at line 159 of file peptidenaturalisotopeaverage.cpp.

: mcsp_peptideSp(other.mcsp_peptideSp), mp_precision(other.mp_precision)
{
m_peptideNaturalIsotopeSpList = other.m_peptideNaturalIsotopeSpList;
m_averageMz = other.m_averageMz;
m_abundanceRatio = other.m_abundanceRatio;
m_isotopeLevel = other.m_isotopeLevel;
m_isotopeRank = other.m_isotopeRank;
m_z = other.m_z;
}
pappso::PeptideNaturalIsotopeAverage::m_peptideNaturalIsotopeSpList
std::vector< PeptideNaturalIsotopeSp > m_peptideNaturalIsotopeSpList
Definition: peptidenaturalisotopeaverage.h:78

References m_abundanceRatio, m_averageMz, m_isotopeLevel, m_isotopeRank, m_peptideNaturalIsotopeSpList, and m_z.

## ~PeptideNaturalIsotopeAverage()

pappso::PeptideNaturalIsotopeAverage::~PeptideNaturalIsotopeAverage | ( |  | ) |

Definition at line 173 of file peptidenaturalisotopeaverage.cpp.

{
}

## Member Function Documentation

## getCharge()

unsigned int pappso::PeptideNaturalIsotopeAverage::getCharge | ( |  | ) | const

Definition at line 190 of file peptidenaturalisotopeaverage.cpp.

{
return m_z;
}

References m_z.

## getComponents()

const std::vector< PeptideNaturalIsotopeSp > & pappso::PeptideNaturalIsotopeAverage::getComponents | ( |  | ) | const

Definition at line 208 of file peptidenaturalisotopeaverage.cpp.

{
return m_peptideNaturalIsotopeSpList;
}

References m_peptideNaturalIsotopeSpList.

## getIntensityRatio()

pappso_double pappso::PeptideNaturalIsotopeAverage::getIntensityRatio | ( |  | ) | const

Definition at line 184 of file peptidenaturalisotopeaverage.cpp.

{
return m_abundanceRatio;
}

References m_abundanceRatio.

Referenced by pappso::MassSpectrumWidget::computeIsotopeMassList(), and pappso::PeptideNaturalIsotopeList::getByIntensityRatio().

## getIsotopeNumber()

unsigned int pappso::PeptideNaturalIsotopeAverage::getIsotopeNumber | ( |  | ) | const

Definition at line 196 of file peptidenaturalisotopeaverage.cpp.

{
return m_isotopeLevel;
}

References m_isotopeLevel.

## getIsotopeRank()

unsigned int pappso::PeptideNaturalIsotopeAverage::getIsotopeRank | ( |  | ) | const

Definition at line 202 of file peptidenaturalisotopeaverage.cpp.

{
return m_isotopeRank;
}

References m_isotopeRank.

Referenced by pappso::MassSpectrumWidget::computeIsotopeMassList(), pappso::PeptideNaturalIsotopeList::getByIntensityRatio(), and pappso::getByIntensityRatioByIsotopeNumber().

## getMz()

pappso_double pappso::PeptideNaturalIsotopeAverage::getMz | ( |  | ) | const

Definition at line 178 of file peptidenaturalisotopeaverage.cpp.

{
return m_averageMz;
}

References m_averageMz.

Referenced by matchPeak(), and recursiveDepletion().

## getPeptideInterfaceSp()

const PeptideInterfaceSp & pappso::PeptideNaturalIsotopeAverage::getPeptideInterfaceSp | ( |  | ) | const

Definition at line 214 of file peptidenaturalisotopeaverage.cpp.

{
return mcsp_peptideSp;
}

References mcsp_peptideSp.

## getPrecision()

PrecisionPtr pappso::PeptideNaturalIsotopeAverage::getPrecision | ( |  | ) | const

Definition at line 220 of file peptidenaturalisotopeaverage.cpp.

{
return mp_precision;
}

References mp_precision.

## isEmpty()

bool pappso::PeptideNaturalIsotopeAverage::isEmpty | ( |  | ) | const

Definition at line 235 of file peptidenaturalisotopeaverage.cpp.

{
return (m_peptideNaturalIsotopeSpList.size() == 0);
}

References m_peptideNaturalIsotopeSpList.

Referenced by pappso::getByIntensityRatioByIsotopeNumber().

## makePeptideNaturalIsotopeAverageSp()

PeptideNaturalIsotopeAverageSp pappso::PeptideNaturalIsotopeAverage::makePeptideNaturalIsotopeAverageSp | ( |  | ) | const

Definition at line 154 of file peptidenaturalisotopeaverage.cpp.

{
return std::make_shared<PeptideNaturalIsotopeAverage>(*this);
}

Referenced by pappso::MassSpectrumWidget::computeIsotopeMassList(), pappso::PeptideNaturalIsotopeList::getByIntensityRatio(), and pappso::getByIntensityRatioByIsotopeNumber().

## matchPeak()

bool pappso::PeptideNaturalIsotopeAverage::matchPeak | ( | pappso_double | peak_mz | ) | const

final virtual

Definition at line 226 of file peptidenaturalisotopeaverage.cpp.

{
// qDebug() << "PeptideNaturalIsotopeAverage::matchPeak";
// qDebug() << "PeptideNaturalIsotopeAverage::matchPeak precision " <<
// mp_precision.getDelta(200);
return (MzRange(getMz(), mp_precision).contains(peak_mz));
}
pappso::PeptideNaturalIsotopeAverage::getMz
pappso_double getMz() const
Definition: peptidenaturalisotopeaverage.cpp:178

References getMz(), and mp_precision.

Referenced by pappso::PeptideIsotopeSpectrumMatch::getBestPeakIterator().

## recursiveDepletion()

void pappso::PeptideNaturalIsotopeAverage::recursiveDepletion | ( | std::vector< PeptideNaturalIsotopeSp > & | v_isotope_list,
|  | unsigned int | rank
| ) |  |

private

Definition at line 90 of file peptidenaturalisotopeaverage.cpp.

{
rank++;
m_abundanceRatio = 0;
m_averageMz = 0;
m_peptideNaturalIsotopeSpList.clear();
std::vector<PeptideNaturalIsotopeSp> peptide_list;
// select neighbors in the precision range :
MzRange mz_range(v_isotope_list[0].get()->getMz(m_z), mp_precision);
for(auto &isotope_sp : v_isotope_list)
{
if(mz_range.contains(isotope_sp.get()->getMz(m_z)))
{
peptide_list.push_back(isotope_sp);
m_abundanceRatio += isotope_sp.get()->getIntensityRatio(m_z);
m_averageMz += (isotope_sp.get()->getMz(m_z) *
isotope_sp.get()->getIntensityRatio(m_z));
}
}
if(peptide_list.size() > 0)
{
m_averageMz = m_averageMz / m_abundanceRatio;
// depletion
auto it_remove = std::remove_if(
v_isotope_list.begin(),
v_isotope_list.end(),
[peptide_list](const PeptideNaturalIsotopeSp &isotope_sp) {
auto it =
std::find(peptide_list.begin(), peptide_list.end(), isotope_sp);
return (it != peptide_list.end());
});
v_isotope_list.erase(it_remove, v_isotope_list.end());
if(rank == m_isotopeRank)
{
m_peptideNaturalIsotopeSpList = peptide_list;
return;
}
else
{
unsigned int charge = m_z;
std::sort(v_isotope_list.begin(),
v_isotope_list.end(),
[charge](const PeptideNaturalIsotopeSp &m,
const PeptideNaturalIsotopeSp &n) {
return (m.get()->getIntensityRatio(charge) >
n.get()->getIntensityRatio(charge));
});
recursiveDepletion(v_isotope_list, rank);
}
}
else
{
m_abundanceRatio = 0;
m_averageMz = 0;
}
}
pappso::PeptideNaturalIsotopeSp
std::shared_ptr< const PeptideNaturalIsotope > PeptideNaturalIsotopeSp
Definition: peptidenaturalisotope.h:41

References pappso::MzRange::contains(), getMz(), m_abundanceRatio, m_averageMz, m_isotopeRank, m_peptideNaturalIsotopeSpList, m_z, and mp_precision.

Referenced by PeptideNaturalIsotopeAverage().

## Member Data Documentation

## m_abundanceRatio

pappso_double pappso::PeptideNaturalIsotopeAverage::m_abundanceRatio

private

Definition at line 81 of file peptidenaturalisotopeaverage.h.

Referenced by PeptideNaturalIsotopeAverage(), getIntensityRatio(), and recursiveDepletion().

## m_averageMz

pappso_double pappso::PeptideNaturalIsotopeAverage::m_averageMz

private

Definition at line 80 of file peptidenaturalisotopeaverage.h.

Referenced by PeptideNaturalIsotopeAverage(), getMz(), and recursiveDepletion().

## m_isotopeLevel

unsigned int pappso::PeptideNaturalIsotopeAverage::m_isotopeLevel

private

Definition at line 82 of file peptidenaturalisotopeaverage.h.

Referenced by PeptideNaturalIsotopeAverage(), and getIsotopeNumber().

## m_isotopeRank

unsigned int pappso::PeptideNaturalIsotopeAverage::m_isotopeRank = 1

private

Definition at line 83 of file peptidenaturalisotopeaverage.h.

Referenced by PeptideNaturalIsotopeAverage(), getIsotopeRank(), and recursiveDepletion().

## m_peptideNaturalIsotopeSpList

std::vector<PeptideNaturalIsotopeSp> pappso::PeptideNaturalIsotopeAverage::m_peptideNaturalIsotopeSpList

private

Definition at line 78 of file peptidenaturalisotopeaverage.h.

Referenced by PeptideNaturalIsotopeAverage(), getComponents(), isEmpty(), and recursiveDepletion().

## m_z

unsigned int pappso::PeptideNaturalIsotopeAverage::m_z

private

Definition at line 84 of file peptidenaturalisotopeaverage.h.

Referenced by PeptideNaturalIsotopeAverage(), getCharge(), and recursiveDepletion().

## mcsp_peptideSp

const PeptideInterfaceSp pappso::PeptideNaturalIsotopeAverage::mcsp_peptideSp

private

Definition at line 77 of file peptidenaturalisotopeaverage.h.

Referenced by getPeptideInterfaceSp().

## mp_precision

PrecisionPtr pappso::PeptideNaturalIsotopeAverage::mp_precision = nullptr

private

Definition at line 85 of file peptidenaturalisotopeaverage.h.

Referenced by getPrecision(), matchPeak(), and recursiveDepletion().

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

- pappsomspp/peptide/peptidenaturalisotopeaverage.h
- pappsomspp/peptide/peptidenaturalisotopeaverage.cpp