Loading...
Searching...
No Matches
pappso::PeptideNaturalIsotopeAverage Class Reference

`#include <peptidenaturalisotopeaverage.h>`

## Public Member Functions

| PeptideNaturalIsotopeAverage (const PeptideInterfaceSp &peptide, unsigned int isotopeNumber, unsigned int charge, PrecisionPtr precision)
| fast constructor simple isotope build, not computing isotope ratio
| 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)
virtual | ~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
virtual QString | toString () 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/4]

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

fast constructor simple isotope build, not computing isotope ratio

Definition at line 34 of file peptidenaturalisotopeaverage.cpp.

: mcsp_peptideSp(peptide),
m_isotopeLevel(isotopeNumber),
m_isotopeRank(1),
m_z(charge),
mp_precision(precision)
{
m_peptideNaturalIsotopeSpList.clear();
double diffC13 = ((double)isotopeNumber * DIFFC12C13) / (double)charge;
m_averageMz = peptide.get()->getMz(charge) + diffC13;
m_abundanceRatio = 0;
}
pappso::PeptideNaturalIsotopeAverage::m_peptideNaturalIsotopeSpList
std::vector< PeptideNaturalIsotopeSp > m_peptideNaturalIsotopeSpList
Definition peptidenaturalisotopeaverage.h:87
pappso::PeptideNaturalIsotopeAverage::m_abundanceRatio
pappso_double m_abundanceRatio
Definition peptidenaturalisotopeaverage.h:90
pappso::PeptideNaturalIsotopeAverage::mcsp_peptideSp
const PeptideInterfaceSp mcsp_peptideSp
Definition peptidenaturalisotopeaverage.h:86
pappso::PeptideNaturalIsotopeAverage::m_isotopeRank
unsigned int m_isotopeRank
Definition peptidenaturalisotopeaverage.h:92
pappso::PeptideNaturalIsotopeAverage::m_isotopeLevel
unsigned int m_isotopeLevel
Definition peptidenaturalisotopeaverage.h:91
pappso::PeptideNaturalIsotopeAverage::m_averageMz
pappso_double m_averageMz
Definition peptidenaturalisotopeaverage.h:89
pappso::PeptideNaturalIsotopeAverage::m_z
unsigned int m_z
Definition peptidenaturalisotopeaverage.h:93
pappso::PeptideNaturalIsotopeAverage::mp_precision
PrecisionPtr mp_precision
Definition peptidenaturalisotopeaverage.h:94
pappso::DIFFC12C13
const pappso_double DIFFC12C13(1.0033548378)

References pappso::DIFFC12C13(), m_abundanceRatio, m_averageMz, and m_peptideNaturalIsotopeSpList.

## PeptideNaturalIsotopeAverage() [2/4]

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

Definition at line 54 of file peptidenaturalisotopeaverage.cpp.

: PeptideNaturalIsotopeAverage(PeptideNaturalIsotopeList(peptide),
askedIsotopeRank,
isotopeLevel,
charge,
precision)
{
}
pappso::PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage
PeptideNaturalIsotopeAverage(const PeptideInterfaceSp &peptide, unsigned int isotopeNumber, unsigned int charge, PrecisionPtr precision)
fast constructor simple isotope build, not computing isotope ratio
Definition peptidenaturalisotopeaverage.cpp:34

## PeptideNaturalIsotopeAverage() [3/4]

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

Definition at line 68 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() << "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::recursiveDepletion
void recursiveDepletion(std::vector< PeptideNaturalIsotopeSp > &v_isotope_list, unsigned int rank)
Definition peptidenaturalisotopeaverage.cpp:111

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

## PeptideNaturalIsotopeAverage() [4/4]

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

Definition at line 180 of file peptidenaturalisotopeaverage.cpp.

: mcsp_peptideSp(other.mcsp_peptideSp), mp_precision(other.mp_precision)
{
qDebug();
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;
qDebug();
}

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

## ~PeptideNaturalIsotopeAverage()

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

virtual

Definition at line 196 of file peptidenaturalisotopeaverage.cpp.

{
}

## Member Function Documentation

## getCharge()

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

Definition at line 213 of file peptidenaturalisotopeaverage.cpp.

{
return m_z;
}

References m_z.

Referenced by toString().

## getComponents()

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

Definition at line 231 of file peptidenaturalisotopeaverage.cpp.

{
return m_peptideNaturalIsotopeSpList;
}

References m_peptideNaturalIsotopeSpList.

## getIntensityRatio()

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

Definition at line 207 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 219 of file peptidenaturalisotopeaverage.cpp.

{
return m_isotopeLevel;
}

References m_isotopeLevel.

Referenced by toString().

## getIsotopeRank()

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

Definition at line 225 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 201 of file peptidenaturalisotopeaverage.cpp.

{
return m_averageMz;
}

References m_averageMz.

Referenced by pappso::PeptideIsotopeSpectrumMatch::PeptideIsotopeSpectrumMatch(), matchPeak(), recursiveDepletion(), and toString().

## getPeptideInterfaceSp()

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

Definition at line 237 of file peptidenaturalisotopeaverage.cpp.

{
return mcsp_peptideSp;
}

References mcsp_peptideSp.

Referenced by toString().

## getPrecision()

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

Definition at line 243 of file peptidenaturalisotopeaverage.cpp.

{
return mp_precision;
}

References mp_precision.

## isEmpty()

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

Definition at line 258 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 175 of file peptidenaturalisotopeaverage.cpp.

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

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

## matchPeak()

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

final virtual

Definition at line 249 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:201

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 111 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:43

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

Referenced by PeptideNaturalIsotopeAverage(), and recursiveDepletion().

## toString()

QString pappso::PeptideNaturalIsotopeAverage::toString | ( |  | ) | const

virtual

Definition at line 264 of file peptidenaturalisotopeaverage.cpp.

{
return QString("%1 l%2 mz%3 z%4 N%5")
.arg(getPeptideInterfaceSp().get()->getSequence())
.arg(getPeptideInterfaceSp().get()->size())
.arg(getMz())
.arg(getCharge())
.arg(getIsotopeNumber());
}
pappso::PeptideNaturalIsotopeAverage::getPeptideInterfaceSp
const PeptideInterfaceSp & getPeptideInterfaceSp() const
Definition peptidenaturalisotopeaverage.cpp:237
pappso::PeptideNaturalIsotopeAverage::getCharge
unsigned int getCharge() const
Definition peptidenaturalisotopeaverage.cpp:213
pappso::PeptideNaturalIsotopeAverage::getIsotopeNumber
unsigned int getIsotopeNumber() const
Definition peptidenaturalisotopeaverage.cpp:219

References getCharge(), getIsotopeNumber(), getMz(), and getPeptideInterfaceSp().

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

## Member Data Documentation

## m_abundanceRatio

pappso_double pappso::PeptideNaturalIsotopeAverage::m_abundanceRatio

private

Definition at line 90 of file peptidenaturalisotopeaverage.h.

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

## m_averageMz

pappso_double pappso::PeptideNaturalIsotopeAverage::m_averageMz

private

Definition at line 89 of file peptidenaturalisotopeaverage.h.

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

## m_isotopeLevel

unsigned int pappso::PeptideNaturalIsotopeAverage::m_isotopeLevel

private

Definition at line 91 of file peptidenaturalisotopeaverage.h.

Referenced by PeptideNaturalIsotopeAverage(), and getIsotopeNumber().

## m_isotopeRank

unsigned int pappso::PeptideNaturalIsotopeAverage::m_isotopeRank = 1

private

Definition at line 92 of file peptidenaturalisotopeaverage.h.

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

## m_peptideNaturalIsotopeSpList

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

private

Definition at line 87 of file peptidenaturalisotopeaverage.h.

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

## m_z

unsigned int pappso::PeptideNaturalIsotopeAverage::m_z

private

Definition at line 93 of file peptidenaturalisotopeaverage.h.

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

## mcsp_peptideSp

const PeptideInterfaceSp pappso::PeptideNaturalIsotopeAverage::mcsp_peptideSp

private

Definition at line 86 of file peptidenaturalisotopeaverage.h.

Referenced by getPeptideInterfaceSp().

## mp_precision

PrecisionPtr pappso::PeptideNaturalIsotopeAverage::mp_precision = nullptr

private

Definition at line 94 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