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

`#include <peptidenaturalisotopelist.h>`

## Public Types

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

## Public Member Functions

| PeptideNaturalIsotopeList (const PeptideInterfaceSp &peptide, pappso_double minimum_ratio_to_compute=0.001)
| compute the list of possible isotopes for a peptide
| PeptideNaturalIsotopeList (const PeptideNaturalIsotopeList &other)
| ~PeptideNaturalIsotopeList ()
PeptideNaturalIsotopeListSp | makePeptideNaturalIsotopeListSp () const
const_iterator | begin () const
const_iterator | end () const
const std::map< unsigned int, pappso_double > | getIntensityRatioPerIsotopeNumber () const
std::vector< PeptideNaturalIsotopeSp > | getByIsotopeNumber (unsigned int isotopeLevel, unsigned int charge) const
std::vector< PeptideNaturalIsotopeAverageSp > | getByIntensityRatio (unsigned int charge, PrecisionPtr precision, pappso_double minimum_isotope_pattern_ratio) const
| get the list of natural isotopes representing at least a minimum ratio of the whole isotope pattern
unsigned int | size () const
const PeptideInterfaceSp & | getPeptideInterfaceSp () const

## Private Attributes

const PeptideInterfaceSp | msp_peptide
std::list< PeptideNaturalIsotopeSp > | msp_peptide_natural_isotope_list

## Detailed Description

Definition at line 48 of file peptidenaturalisotopelist.h.

## Member Typedef Documentation

## const_iterator

typedef std::list<PeptideNaturalIsotopeSp>::const_iterator pappso::PeptideNaturalIsotopeList::const_iterator

Definition at line 67 of file peptidenaturalisotopelist.h.

## Constructor & Destructor Documentation

## PeptideNaturalIsotopeList() [1/2]

pappso::PeptideNaturalIsotopeList::PeptideNaturalIsotopeList | ( | const PeptideInterfaceSp & | peptide,
|  | pappso_double | minimum_ratio_to_compute = `0.001`
| ) |  |

compute the list of possible isotopes for a peptide

Parameters

  peptide | the peptide
  minimu_ratio_to_compute | the limit under which we stop to compute because the ratio is too thin and not informative (default is 0.001). This limit is the same for each atom to survey : CHNOS

Definition at line 38 of file peptidenaturalisotopelist.cpp.

: msp_peptide(peptide)
{
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
// << minimum_ratio_to_compute;
int number_of_fixed_oxygen =
msp_peptide.get()->getNumberOfIsotope(Isotope::O18) +
msp_peptide.get()->getNumberOfIsotope(Isotope::O17);
int number_of_fixed_sulfur =
msp_peptide.get()->getNumberOfIsotope(Isotope::S33) +
msp_peptide.get()->getNumberOfIsotope(Isotope::S34) +
msp_peptide.get()->getNumberOfIsotope(Isotope::S36);
int number_of_fixed_nitrogen =
msp_peptide.get()->getNumberOfIsotope(Isotope::N15);
int number_of_fixed_hydrogen =
msp_peptide.get()->getNumberOfIsotope(Isotope::H2);
int total_carbon(msp_peptide.get()->getNumberOfAtom(AtomIsotopeSurvey::C) -
msp_peptide.get()->getNumberOfIsotope(Isotope::C13));
// qDebug() << "total_carbon " << total_carbon;
// qDebug() << "total_sulfur " << total_sulfur;
std::map<Isotope, int> map_isotope;
map_isotope.insert(std::pair<Isotope, int>(Isotope::C13, 0));
map_isotope.insert(std::pair<Isotope, int>(Isotope::H2, 0));
map_isotope.insert(std::pair<Isotope, int>(Isotope::N15, 0));
map_isotope.insert(std::pair<Isotope, int>(Isotope::O17, 0));
map_isotope.insert(std::pair<Isotope, int>(Isotope::O18, 0));
map_isotope.insert(std::pair<Isotope, int>(Isotope::S33, 0));
map_isotope.insert(std::pair<Isotope, int>(Isotope::S34, 0));
map_isotope.insert(std::pair<Isotope, int>(Isotope::S36, 0));
for(int nbc13 = 0; nbc13 <= total_carbon; nbc13++)
{
map_isotope[Isotope::C13] = nbc13;
PeptideNaturalIsotopeSp pepIsotope =
std::make_shared<PeptideNaturalIsotope>(msp_peptide, map_isotope);
this->msp_peptide_natural_isotope_list.push_back(pepIsotope);
if(pepIsotope.get()->getIntensityRatio(1) < minimum_ratio_to_compute)
{
break;
}
}
std::list<PeptideNaturalIsotopeSp> temp_list;
// ******************************************************************
// Sulfur isotope list
int total_sulfur(msp_peptide.get()->getNumberOfAtom(AtomIsotopeSurvey::S) -
number_of_fixed_sulfur);
std::list<PeptideNaturalIsotopeSp>::iterator it =
msp_peptide_natural_isotope_list.begin();
while(it != msp_peptide_natural_isotope_list.end())
{
map_isotope = it->get()->getIsotopeMap();
for(int nbS34 = 1; nbS34 <= total_sulfur; nbS34++)
{
map_isotope[Isotope::S34] = nbS34;
PeptideNaturalIsotopeSp pepIsotope =
std::make_shared<PeptideNaturalIsotope>(msp_peptide, map_isotope);
temp_list.push_back(pepIsotope);
if(pepIsotope.get()->getIntensityRatio(1) < minimum_ratio_to_compute)
{
// qDebug() << "peptide " << pepIsotope.get()->getFormula(1) << "
// " << pepIsotope.get()->getIntensityRatio(1); it++;
break;
}
}
it++;
}
msp_peptide_natural_isotope_list.insert(
it, temp_list.begin(), temp_list.end());
// compute S33 abundance
temp_list.resize(0);
it = msp_peptide_natural_isotope_list.begin();
while(it != msp_peptide_natural_isotope_list.end())
{
// qDebug() << "peptide S33 " << it->get()->getFormula(1) << " "
// <<it->get()->getIntensityRatio(1);
map_isotope = it->get()->getIsotopeMap();
for(int nbS33 = 1; nbS33 <= (total_sulfur - map_isotope[Isotope::S34]);
nbS33++)
{
map_isotope[Isotope::S33] = nbS33;
PeptideNaturalIsotopeSp pepIsotopeS33 =
std::make_shared<PeptideNaturalIsotope>(msp_peptide, map_isotope);
temp_list.push_back(pepIsotopeS33);
if(pepIsotopeS33.get()->getIntensityRatio(1) <
minimum_ratio_to_compute)
{
// it++;
break;
}
}
it++;
}
msp_peptide_natural_isotope_list.insert(
it, temp_list.begin(), temp_list.end());
// compute S36 abundance
temp_list.resize(0);
it = msp_peptide_natural_isotope_list.begin();
while(it != msp_peptide_natural_isotope_list.end())
{
map_isotope = it->get()->getIsotopeMap();
for(int nbS36 = 1; nbS36 <= (total_sulfur - map_isotope[Isotope::S34] -
map_isotope[Isotope::S33]);
nbS36++)
{
map_isotope[Isotope::S36] = nbS36;
PeptideNaturalIsotopeSp pepIsotopeS36 =
std::make_shared<PeptideNaturalIsotope>(msp_peptide, map_isotope);
temp_list.push_back(pepIsotopeS36);
if(pepIsotopeS36.get()->getIntensityRatio(1) <
minimum_ratio_to_compute)
{
// it++;
break;
}
}
it++;
}
msp_peptide_natural_isotope_list.insert(
it, temp_list.begin(), temp_list.end());
// ******************************************************************
// ******************************************************************
// Hydrogen isotope list
temp_list.resize(0);
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// total_hydrogen";
int total_hydrogen(msp_peptide.get()->getNumberOfAtom(AtomIsotopeSurvey::H) -
number_of_fixed_hydrogen);
it = msp_peptide_natural_isotope_list.begin();
while(it != msp_peptide_natural_isotope_list.end())
{
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// getIsotopeMap " << it->getFormula(1) << " " <<
// msp_peptide_natural_isotope_list.size();
map_isotope = it->get()->getIsotopeMap();
for(int nbH2 = 1; nbH2 <= total_hydrogen; nbH2++)
{
map_isotope[Isotope::H2] = nbH2;
PeptideNaturalIsotopeSp pepIsotope =
std::make_shared<PeptideNaturalIsotope>(msp_peptide, map_isotope);
temp_list.push_back(pepIsotope);
if(pepIsotope.get()->getIntensityRatio(1) < minimum_ratio_to_compute)
{
// it++;
break;
}
}
it++;
}
msp_peptide_natural_isotope_list.insert(
it, temp_list.begin(), temp_list.end());
// ******************************************************************
// ******************************************************************
// Oxygen isotope list
temp_list.resize(0);
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// total_oxygen";
unsigned int total_oxygen(
msp_peptide.get()->getNumberOfAtom(AtomIsotopeSurvey::O) -
number_of_fixed_oxygen);
it = msp_peptide_natural_isotope_list.begin();
while(it != msp_peptide_natural_isotope_list.end())
{
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// getIsotopeMap " << it->getFormula(1) << " " <<
// msp_peptide_natural_isotope_list.size();
map_isotope = it->get()->getIsotopeMap();
for(unsigned int nbO18 = 1; nbO18 <= total_oxygen; nbO18++)
{
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// nbO18 " << nbO18;
map_isotope[Isotope::O18] = nbO18;
PeptideNaturalIsotopeSp pepIsotope =
std::make_shared<PeptideNaturalIsotope>(msp_peptide, map_isotope);
temp_list.push_back(pepIsotope);
if(pepIsotope.get()->getIntensityRatio(1) < minimum_ratio_to_compute)
{
// it++;
break;
}
}
it++;
}
msp_peptide_natural_isotope_list.insert(
it, temp_list.begin(), temp_list.end());
// ******************************************************************
// ******************************************************************
// Nitrogen isotope list
temp_list.resize(0);
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// total_nitrogen";
unsigned int total_nitrogen(
msp_peptide.get()->getNumberOfAtom(AtomIsotopeSurvey::N) -
number_of_fixed_nitrogen);
it = msp_peptide_natural_isotope_list.begin();
while(it != msp_peptide_natural_isotope_list.end())
{
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// getIsotopeMap " << it->getFormula(1) << " " <<
// msp_peptide_natural_isotope_list.size();
map_isotope = it->get()->getIsotopeMap();
for(unsigned int nbN15 = 1; nbN15 <= total_nitrogen; nbN15++)
{
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList
// nbN15 " << nbN15;
map_isotope[Isotope::N15] = nbN15;
PeptideNaturalIsotopeSp pepIsotope =
std::make_shared<PeptideNaturalIsotope>(msp_peptide, map_isotope);
temp_list.push_back(pepIsotope);
if(pepIsotope.get()->getIntensityRatio(1) < minimum_ratio_to_compute)
{
// it++;
break;
}
}
it++;
}
msp_peptide_natural_isotope_list.insert(
it, temp_list.begin(), temp_list.end());
// ******************************************************************
// qDebug() << "PeptideNaturalIsotopeList::PeptideNaturalIsotopeList end
// size="<<msp_peptide_natural_isotope_list.size();
}
pappso::PeptideNaturalIsotopeList::msp_peptide
const PeptideInterfaceSp msp_peptide
Definition peptidenaturalisotopelist.h:51
pappso::PeptideNaturalIsotopeList::msp_peptide_natural_isotope_list
std::list< PeptideNaturalIsotopeSp > msp_peptide_natural_isotope_list
Definition peptidenaturalisotopelist.h:52
pappso::PeptideNaturalIsotopeSp
std::shared_ptr< const PeptideNaturalIsotope > PeptideNaturalIsotopeSp
Definition peptidenaturalisotope.h:43
pappso::AtomIsotopeSurvey::C
@ C
pappso::AtomIsotopeSurvey::S
@ S
pappso::AtomIsotopeSurvey::N
@ N
pappso::AtomIsotopeSurvey::H
@ H
pappso::AtomIsotopeSurvey::O
@ O
pappso::Isotope::S36
@ S36
pappso::Isotope::C13
@ C13
pappso::Isotope::N15
@ N15
pappso::Isotope::S33
@ S33
pappso::Isotope::O18
@ O18
pappso::Isotope::O17
@ O17
pappso::Isotope::S34
@ S34
pappso::Isotope::H2
@ H2

References pappso::C, pappso::C13, pappso::H, pappso::H2, msp_peptide, msp_peptide_natural_isotope_list, pappso::N, pappso::N15, pappso::O, pappso::O17, pappso::O18, pappso::S, pappso::S33, pappso::S34, and pappso::S36.

## PeptideNaturalIsotopeList() [2/2]

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

Definition at line 281 of file peptidenaturalisotopelist.cpp.

: msp_peptide(other.msp_peptide),
msp_peptide_natural_isotope_list(other.msp_peptide_natural_isotope_list)
{
}

## ~PeptideNaturalIsotopeList()

pappso::PeptideNaturalIsotopeList::~PeptideNaturalIsotopeList | ( |  | ) |

Definition at line 288 of file peptidenaturalisotopelist.cpp.

{
}

## Member Function Documentation

## begin()

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

Definition at line 513 of file peptidenaturalisotopelist.cpp.

{
return msp_peptide_natural_isotope_list.begin();
}

References msp_peptide_natural_isotope_list.

## end()

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

Definition at line 519 of file peptidenaturalisotopelist.cpp.

{
return msp_peptide_natural_isotope_list.end();
}

References msp_peptide_natural_isotope_list.

## getByIntensityRatio()

std::vector< PeptideNaturalIsotopeAverageSp > pappso::PeptideNaturalIsotopeList::getByIntensityRatio | ( | unsigned int | charge,
|  | PrecisionPtr | precision,
|  | pappso_double | minimumIntensityRatio
| ) |  | const

get the list of natural isotopes representing at least a minimum ratio of the whole isotope pattern

Parameters

  charge | gives the number of H+, important to take into account for isotope ratio
  precision | the mass accuracy to take into acount each isotope (C13 != H2)
  minimum_isotope_pattern_ratio | the minimum ratio of the isotope pattern to represent

/brief get a sorted (by expected intensity) vector of natural isotope average

Definition at line 425 of file peptidenaturalisotopelist.cpp.

{
// qDebug() << "PeptideNaturalIsotopeList::getByIntensityRatio begin";
std::vector<PeptideNaturalIsotopeAverageSp>
peptide_natural_isotope_average_list;
std::map<unsigned int, pappso::pappso_double> map_isotope_number =
getIntensityRatioPerIsotopeNumber();
std::vector<std::pair<unsigned int, pappso::pappso_double>>
sorted_number_ratio;
for(unsigned int i = 0; i < map_isotope_number.size(); i++)
{
sorted_number_ratio.push_back(
std::pair<unsigned int, pappso::pappso_double>(i,
map_isotope_number[i]));
unsigned int asked_rank = 0;
unsigned int given_rank = 0;
bool more_rank = true;
while(more_rank)
{
asked_rank++;
pappso::PeptideNaturalIsotopeAverage isotopeAverageMono(
*this, asked_rank, i, charge, precision);
given_rank = isotopeAverageMono.getIsotopeRank();
if(given_rank < asked_rank)
{
more_rank = false;
}
else if(isotopeAverageMono.getIntensityRatio() == 0)
{
more_rank = false;
}
else
{
// isotopeAverageMono.makePeptideNaturalIsotopeAverageSp();
peptide_natural_isotope_average_list.push_back(
isotopeAverageMono.makePeptideNaturalIsotopeAverageSp());
}
}
}
// sort by intensity ratio
std::sort(sorted_number_ratio.begin(),
sorted_number_ratio.end(),
[](const std::pair<unsigned int, pappso::pappso_double> &m,
const std::pair<unsigned int, pappso::pappso_double> &n) {
return (m.second > n.second);
});
double cumulativeRatio = 0;
std::vector<unsigned int> selected_isotope_number_list;
for(auto &pair_isotope_number : sorted_number_ratio)
{
if(cumulativeRatio <= minimumIntensityRatio)
{
selected_isotope_number_list.push_back(pair_isotope_number.first);
}
else
{
break;
}
cumulativeRatio += pair_isotope_number.second;
}
auto it_remove =
std::remove_if(peptide_natural_isotope_average_list.begin(),
peptide_natural_isotope_average_list.end(),
[selected_isotope_number_list](
const PeptideNaturalIsotopeAverageSp &average) {
auto it = std::find(selected_isotope_number_list.begin(),
selected_isotope_number_list.end(),
average.get()->getIsotopeNumber());
return (it == selected_isotope_number_list.end());
});
peptide_natural_isotope_average_list.erase(
it_remove, peptide_natural_isotope_average_list.end());
return peptide_natural_isotope_average_list;
}
pappso::PeptideNaturalIsotopeAverage
Definition peptidenaturalisotopeaverage.h:43
pappso::PeptideNaturalIsotopeList::getIntensityRatioPerIsotopeNumber
const std::map< unsigned int, pappso_double > getIntensityRatioPerIsotopeNumber() const
Definition peptidenaturalisotopelist.cpp:293
pappso::PeptideNaturalIsotopeAverageSp
std::shared_ptr< const PeptideNaturalIsotopeAverage > PeptideNaturalIsotopeAverageSp
Definition peptidenaturalisotopeaverage.h:40

References pappso::PeptideNaturalIsotopeAverage::getIntensityRatio(), getIntensityRatioPerIsotopeNumber(), pappso::PeptideNaturalIsotopeAverage::getIsotopeRank(), and pappso::PeptideNaturalIsotopeAverage::makePeptideNaturalIsotopeAverageSp().

## getByIsotopeNumber()

std::vector< PeptideNaturalIsotopeSp > pappso::PeptideNaturalIsotopeList::getByIsotopeNumber | ( | unsigned int | isotope_number,
|  | unsigned int | charge
| ) |  | const

/brief get a sorted (by expected intensity) vector of isotopes of the same level

Definition at line 323 of file peptidenaturalisotopelist.cpp.

{
std::vector<PeptideNaturalIsotopeSp> v_isotope_list;
for(auto &&isotopeSp : msp_peptide_natural_isotope_list)
{
if(isotopeSp.get()->getIsotopeNumber() == isotope_number)
{
v_isotope_list.push_back(isotopeSp);
}
}
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));
});
return v_isotope_list;
}

References msp_peptide_natural_isotope_list.

Referenced by pappso::PeptideNaturalIsotopeAverage::PeptideNaturalIsotopeAverage().

## getIntensityRatioPerIsotopeNumber()

const std::map< unsigned int, pappso_double > pappso::PeptideNaturalIsotopeList::getIntensityRatioPerIsotopeNumber | ( |  | ) | const

Definition at line 293 of file peptidenaturalisotopelist.cpp.

{
std::list<PeptideNaturalIsotopeSp>::const_iterator it =
msp_peptide_natural_isotope_list.begin();
std::map<unsigned int, pappso_double> map_isotope_number;
while(it != msp_peptide_natural_isotope_list.end())
{
unsigned int number = it->get()->getIsotopeNumber();
std::pair<std::map<unsigned int, pappso_double>::iterator, bool> mapnew =
map_isotope_number.insert(
std::pair<unsigned int, pappso_double>(number, 0));
if(mapnew.second == false)
{
// mapit = map_isotope_number.insert(std::pair<unsigned
// int,pappso_double>(number, 0));
}
mapnew.first->second += it->get()->getIntensityRatio(1);
it++;
}
return map_isotope_number;
}

References msp_peptide_natural_isotope_list.

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

## getPeptideInterfaceSp()

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

Definition at line 531 of file peptidenaturalisotopelist.cpp.

{
return msp_peptide;
}

References msp_peptide.

## makePeptideNaturalIsotopeListSp()

PeptideNaturalIsotopeListSp pappso::PeptideNaturalIsotopeList::makePeptideNaturalIsotopeListSp | ( |  | ) | const

Definition at line 276 of file peptidenaturalisotopelist.cpp.

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

## size()

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

Definition at line 525 of file peptidenaturalisotopelist.cpp.

{
return msp_peptide_natural_isotope_list.size();
}

References msp_peptide_natural_isotope_list.

## Member Data Documentation

## msp_peptide

const PeptideInterfaceSp pappso::PeptideNaturalIsotopeList::msp_peptide

private

Definition at line 51 of file peptidenaturalisotopelist.h.

Referenced by PeptideNaturalIsotopeList(), and getPeptideInterfaceSp().

## msp_peptide_natural_isotope_list

std::list<PeptideNaturalIsotopeSp> pappso::PeptideNaturalIsotopeList::msp_peptide_natural_isotope_list

private

Definition at line 52 of file peptidenaturalisotopelist.h.

Referenced by PeptideNaturalIsotopeList(), begin(), end(), getByIsotopeNumber(), getIntensityRatioPerIsotopeNumber(), and size().

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

- pappsomspp/peptide/peptidenaturalisotopelist.h
- pappsomspp/peptide/peptidenaturalisotopelist.cpp