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

`#include <peptide.h>`

Inheritance diagram for pappso::Peptide:

## Public Member Functions

| Peptide (const QString &pepstr)
virtual | ~Peptide ()
| Peptide (const Peptide &peptide)
| Peptide (Peptide &&toCopy)
PeptideSp | makePeptideSp () const
NoConstPeptideSp | makeNoConstPeptideSp () const
void | addAaModification (AaModificationP aaModification, unsigned int position)
| adds a modification to amino acid sequence
void | addAaModificationOnAllAminoAcid (AaModificationP aaModification, Enums::AminoAcidChar amino_acid)
| adds a modification to all amino acid of the sequence
std::vector< Aa >::iterator | begin ()
std::vector< Aa >::iterator | end ()
std::vector< Aa >::const_iterator | begin () const
std::vector< Aa >::const_iterator | end () const
std::vector< Aa >::const_reverse_iterator | rbegin () const
std::vector< Aa >::const_reverse_iterator | rend () const
Aa & | getAa (unsigned int position)
const Aa & | getConstAa (unsigned int position) const
std::vector< double > | getRawMassArray () const
| get raw mass array of the amino acid sequence
std::vector< double > | getMassIonSerie (unsigned int charge, pappso::Enums::PeptideIon ion_type) const
| get complete serie of product masses for a given charge and ion type
pappso_double | getMass ()
pappso_double | getMass () const override
virtual int | getNumberOfAtom (Enums::AtomIsotopeSurvey atom) const override
| get the number of atom C, O, N, H in the molecule
virtual int | getNumberOfIsotope (Enums::Isotope isotope) const override
| get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
const QString | getSequence () const override
| print amino acid sequence without modifications
unsigned int | size () const override
unsigned int | getNumberOfModification (AaModificationP mod) const
| count modification occurence
unsigned int | countModificationOnAa (AaModificationP mod, const std::vector< char > &aa_list) const
| count modification occurence
void | replaceAaModification (AaModificationP oldmod, AaModificationP newmod)
| replaces all occurences of a modification by a new one
void | replaceAaModificationOnAminoAcid (Enums::AminoAcidChar aa, pappso::AaModificationP oldmod, pappso::AaModificationP newmod)
| replaces all occurences of a modification by a new one on a specific amino acid
void | removeAaModification (AaModificationP mod)
| removes all occurences of a modification
std::vector< unsigned int > | getModificationPositionList (AaModificationP mod) const
| get modification positions
std::vector< unsigned int > | getModificationPositionList (AaModificationP mod, const std::vector< char > &aa_list) const
| get modification positions
std::vector< unsigned int > | getAaPositionList (char aa) const
| get positions of one amino acid in peptide
std::vector< unsigned int > | getAaPositionList (std::list< char > list_aa) const
const QString | toString () const
| print modification except internal modifications
const QString | toAbsoluteString () const
| print all modifications
const QString | getLiAbsoluteString () const
| get all sequence string with modifications and converting Leucine to Isoleucine
void | setCleavageNterModification (AaModificationP mod)
void | setCleavageCterModification (AaModificationP mod)
AaModificationP | getCleavageNterModification () const
AaModificationP | getCleavageCterModification () const
void | setNterModification (AaModificationP mod)
void | setCterModification (AaModificationP mod)
AaModificationP | getNterModification () const
AaModificationP | getCterModification () const
void | setGlobalModification (Enums::Isotope isotope_kind)
| apply 100% isotope replacement
void | rotate ()
void | reverse ()
virtual bool | isPalindrome () const override
| tells if the peptide sequence is a palindrome
void | replaceLeucineIsoleucine ()
void | removeNterAminoAcid ()
void | removeCterAminoAcid ()
QString | toProForma () const
| get the peptide model in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README.md
virtual const ChemicalFormula | getChemicalFormula () const override
virtual const ChemicalFormula | getChemicalFormulaCharge (unsigned int charge) const override
Public Member Functions inherited from pappso::PeptideInterface
virtual const QString | getSequenceLi () const
| amino acid sequence without modification where L are replaced by I
virtual const QString | getName () const
virtual const QString | getFormula (unsigned int charge) const final
virtual bool | matchPeak (PrecisionPtr precision, pappso_double peak_mz, unsigned int charge) const final
| tells if the peptide m/z matches a given experimental mass
Public Member Functions inherited from pappso::Ion
| Ion ()
| ~Ion ()
virtual pappso_double | getMz (unsigned int charge) const final

## Protected Attributes

std::vector< Aa > | m_aaVec
bool | m_fullC13 = false
bool | m_fullN15 = false
bool | m_fullH2 = false
double | m_proxyMass = -1
AaModificationP | m_cleavageNterMod = nullptr
AaModificationP | m_cleavageCterMod = nullptr
AaModificationP | m_NterMod = nullptr
AaModificationP | m_CterMod = nullptr

## Friends

class | PeptideProFormaParser
bool | operator< (const Peptide &l, const Peptide &r)
bool | operator== (const Peptide &l, const Peptide &r)

## Detailed Description

Definition at line 101 of file peptide.h.

## Constructor & Destructor Documentation

## Peptide() [1/3]

pappso::Peptide::Peptide | ( | const QString & | pepstr | ) |

Definition at line 106 of file peptide.cpp.

{
qDebug();
m_cleavageNterMod = AaModification::getInstance("internal:Nter_hydrolytic_cleavage_H");
m_cleavageCterMod = AaModification::getInstance("internal:Cter_hydrolytic_cleavage_HO");
m_NterMod = nullptr;
m_CterMod = nullptr;
QString::const_iterator it(pepstr.begin());
while(it != pepstr.end())
{
qDebug() << it->toLatin1();
m_aaVec.push_back(Aa(it->toLatin1()));
it++;
}
qDebug();
getMass();
}
pappso::AaModification::getInstance
static AaModificationP getInstance(const QString &accession)
Definition aamodification.cpp:368
pappso::Peptide::m_cleavageCterMod
AaModificationP m_cleavageCterMod
Definition peptide.h:274
pappso::Peptide::m_NterMod
AaModificationP m_NterMod
Definition peptide.h:275
pappso::Peptide::m_cleavageNterMod
AaModificationP m_cleavageNterMod
Definition peptide.h:272
pappso::Peptide::getMass
pappso_double getMass()
Definition peptide.cpp:375
pappso::Peptide::m_CterMod
AaModificationP m_CterMod
Definition peptide.h:276
pappso::Peptide::m_aaVec
std::vector< Aa > m_aaVec
Definition peptide.h:266

References pappso::AaModification::getInstance(), getMass(), m_aaVec, m_cleavageCterMod, m_cleavageNterMod, m_CterMod, and m_NterMod.

Referenced by Peptide(), Peptide(), and PeptideProFormaParser.

## ~Peptide()

pappso::Peptide::~Peptide | ( |  | ) |

virtual

Definition at line 126 of file peptide.cpp.

{
}

## Peptide() [2/3]

pappso::Peptide::Peptide | ( | const Peptide & | peptide | ) |

Definition at line 130 of file peptide.cpp.

: m_aaVec(peptide.m_aaVec),
m_fullC13(peptide.m_fullC13),
m_fullN15(peptide.m_fullN15),
m_fullH2(peptide.m_fullH2),
m_proxyMass(peptide.m_proxyMass),
m_cleavageNterMod(peptide.m_cleavageNterMod),
m_cleavageCterMod(peptide.m_cleavageCterMod),
m_NterMod(peptide.m_NterMod),
m_CterMod(peptide.m_CterMod)
{
qDebug();
}
pappso::Peptide::m_fullN15
bool m_fullN15
Definition peptide.h:268
pappso::Peptide::m_fullH2
bool m_fullH2
Definition peptide.h:269
pappso::Peptide::m_fullC13
bool m_fullC13
Definition peptide.h:267
pappso::Peptide::m_proxyMass
double m_proxyMass
Definition peptide.h:270

References Peptide(), m_aaVec, m_cleavageCterMod, m_cleavageNterMod, m_CterMod, m_fullC13, m_fullH2, m_fullN15, m_NterMod, and m_proxyMass.

## Peptide() [3/3]

pappso::Peptide::Peptide | ( | Peptide && | toCopy | ) |

Definition at line 145 of file peptide.cpp.

: m_aaVec(std::move(toCopy.m_aaVec)),
m_fullC13(toCopy.m_fullC13),
m_fullN15(toCopy.m_fullN15),
m_fullH2(toCopy.m_fullH2),
m_proxyMass(toCopy.m_proxyMass),
m_cleavageNterMod(toCopy.m_cleavageNterMod),
m_cleavageCterMod(toCopy.m_cleavageCterMod),
m_NterMod(toCopy.m_NterMod),
m_CterMod(toCopy.m_CterMod)
{
}

References Peptide(), m_aaVec, m_cleavageCterMod, m_cleavageNterMod, m_CterMod, m_fullC13, m_fullH2, m_fullN15, m_NterMod, and m_proxyMass.

## Member Function Documentation

## addAaModification()

void pappso::Peptide::addAaModification | ( | AaModificationP | aaModification,
|  | unsigned int | position )

adds a modification to amino acid sequence

Parameters

  aaModification | pointer on modification to add
  position | position in the amino acid sequence (starts at 0)

Definition at line 222 of file peptide.cpp.

{
if(position >= size())
{
throw ExceptionOutOfRange(QObject::tr("position (%1) > size (%2)").arg(position).arg(size()));
}
m_proxyMass = -1;
qDebug() << "Peptide::addAaModification begin " << position;
std::vector<Aa>::iterator it = m_aaVec.begin() + position;
it->addAaModification(aaModification);
getMass();
qDebug() << "Peptide::addAaModification end";
}
pappso::Peptide::size
unsigned int size() const override
Definition peptide.cpp:217

References getMass(), m_aaVec, m_proxyMass, and size().

Referenced by pappso::PeptideStrParser::parseStringToPeptide(), PeptideProFormaParser, pappso::PeptideBuilder::setPeptide(), pappso::PeptideFixedModificationBuilder::setPeptideSp(), and pappso::PeptideVariableModificationBuilder::setPeptideSp().

## addAaModificationOnAllAminoAcid()

void pappso::Peptide::addAaModificationOnAllAminoAcid | ( | AaModificationP | aaModification,
|  | Enums::AminoAcidChar | amino_acid )

adds a modification to all amino acid of the sequence

Parameters

  aaModification | pointer on modification to add
  Enums::AminoAcidChar | amino_acid to apply the modification

Definition at line 237 of file peptide.cpp.

{
for(auto &aa : *this)
{
if(aa.getAminoAcidChar() == amino_acid)
{
aa.addAaModification(aaModification);
}
}
m_proxyMass = -1;
getMass();
}
pappso::masschroq::PeakQualityCategory::aa
@ aa
best possible : more than one direct MS2 fragmentation in same MSRUN
Definition types.h:45

References getMass(), and m_proxyMass.

Referenced by pappso::PeptideProFormaParser::parseStringToPeptide(), and PeptideProFormaParser.

## begin() [1/2]

std::vector< Aa >::iterator pappso::Peptide::begin | ( |  | ) |

Definition at line 173 of file peptide.cpp.

{
return m_aaVec.begin();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), and PeptideProFormaParser.

## begin() [2/2]

std::vector< Aa >::const_iterator pappso::Peptide::begin | ( |  | ) | const

Definition at line 185 of file peptide.cpp.

{
return m_aaVec.begin();
}

References m_aaVec.

## countModificationOnAa()

unsigned int pappso::Peptide::countModificationOnAa | ( | AaModificationP | mod,
|  | const std::vector< char > & | aa_list ) const

count modification occurence

Parameters

  mod | modification to look for
  aa_list | amino acid list targets (one letter code)

Returns
  number of occurences

Definition at line 457 of file peptide.cpp.

{
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(std::find(aa_list.begin(), aa_list.end(), it->getLetter()) != aa_list.end())
{
number += it->getNumberOfModification(mod);
}
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## end() [1/2]

std::vector< Aa >::iterator pappso::Peptide::end | ( |  | ) |

Definition at line 179 of file peptide.cpp.

{
return m_aaVec.end();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), and PeptideProFormaParser.

## end() [2/2]

std::vector< Aa >::const_iterator pappso::Peptide::end | ( |  | ) | const

Definition at line 191 of file peptide.cpp.

{
return m_aaVec.end();
}

References m_aaVec.

## getAa()

Aa & pappso::Peptide::getAa | ( | unsigned int | position | ) |

Definition at line 720 of file peptide.cpp.

{
if(position >= m_aaVec.size())
{
throw ExceptionOutOfRange(QObject::tr("no AA at position %1").arg(position));
}
return m_aaVec.at(position);
}

References m_aaVec.

Referenced by PeptideProFormaParser, and pappso::PeptideVariableModificationReplacement::replaceModificationsAtPosition().

## getAaPositionList() [1/2]

std::vector< unsigned int > pappso::Peptide::getAaPositionList | ( | char | aa | ) | const

get positions of one amino acid in peptide

Parameters

  aa | the one letter code of the amino acid

Returns
  vector containing positions (from 0 to size-1)

Definition at line 567 of file peptide.cpp.

{
std::vector<unsigned int> position_list;
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(it->getLetter() == aa)
position_list.push_back(number);
number++;
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}

References m_aaVec.

Referenced by PeptideProFormaParser, and pappso::PeptideBuilder::setPeptide().

## getAaPositionList() [2/2]

std::vector< unsigned int > pappso::Peptide::getAaPositionList | ( | std::list< char > | list_aa | ) | const

Definition at line 584 of file peptide.cpp.

{
std::vector<unsigned int> position_list;
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
bool found = (std::find(list_aa.begin(), list_aa.end(), it->getLetter()) != list_aa.end());
if(found)
{
position_list.push_back(number);
}
number++;
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}
pappso::specpeptidoms::ScoreType::found
@ found
Definition types.h:43

References m_aaVec.

## getChemicalFormula()

const pappso::ChemicalFormula pappso::Peptide::getChemicalFormula | ( |  | ) | const

override virtual

Reimplemented from pappso::AtomNumberInterface.

Definition at line 838 of file peptide.cpp.

{
return getChemicalFormulaCharge(0);
}
pappso::Peptide::getChemicalFormulaCharge
virtual const ChemicalFormula getChemicalFormulaCharge(unsigned int charge) const override
Definition peptide.cpp:845

References getChemicalFormulaCharge().

Referenced by getMass(), and PeptideProFormaParser.

## getChemicalFormulaCharge()

const pappso::ChemicalFormula pappso::Peptide::getChemicalFormulaCharge | ( | unsigned int | charge | ) | const

override virtual

Reimplemented from pappso::PeptideInterface.

Definition at line 845 of file peptide.cpp.

{
ChemicalFormula formula = PeptideInterface::getChemicalFormulaCharge(charge);
qDebug() << formula.toString();
if(m_fullC13)
{
formula.setFullIsotope(Enums::Isotope::C13);
qDebug() << formula.toString();
}
if(m_fullN15)
{
formula.setFullIsotope(Enums::Isotope::N15);
qDebug() << formula.toString();
}
if(m_fullH2)
{
formula.setFullIsotope(Enums::Isotope::H2);
qDebug() << formula.toString();
}
return formula;
}
pappso::PeptideInterface::getChemicalFormulaCharge
virtual const ChemicalFormula getChemicalFormulaCharge(unsigned int charge) const
Definition peptideinterface.cpp:90
pappso::Enums::Isotope::C13
@ C13
Definition types.h:128
pappso::Enums::Isotope::N15
@ N15
Definition types.h:135
pappso::Enums::Isotope::H2
@ H2
Definition types.h:130

References pappso::Enums::C13, pappso::PeptideInterface::getChemicalFormulaCharge(), pappso::Enums::H2, m_fullC13, m_fullH2, m_fullN15, pappso::Enums::N15, pappso::ChemicalFormula::setFullIsotope(), and pappso::ChemicalFormula::toString().

Referenced by getChemicalFormula(), and PeptideProFormaParser.

## getCleavageCterModification()

AaModificationP pappso::Peptide::getCleavageCterModification | ( |  | ) | const

Definition at line 643 of file peptide.cpp.

{
return m_cleavageCterMod;
}

References m_cleavageCterMod.

Referenced by pappso::specglob::PeptideModel::PeptideModel(), operator==, and PeptideProFormaParser.

## getCleavageNterModification()

AaModificationP pappso::Peptide::getCleavageNterModification | ( |  | ) | const

Definition at line 638 of file peptide.cpp.

{
return m_cleavageNterMod;
}

References m_cleavageNterMod.

Referenced by pappso::specglob::PeptideModel::PeptideModel(), operator==, and PeptideProFormaParser.

## getConstAa()

const Aa & pappso::Peptide::getConstAa | ( | unsigned int | position | ) | const

Definition at line 729 of file peptide.cpp.

{
if(position >= m_aaVec.size())
{
throw ExceptionOutOfRange(QObject::tr("no AA at position %1").arg(position));
}
return m_aaVec.at(position);
}

References m_aaVec.

Referenced by pappso::PeptideModificatorBase::getModificationPositionList(), and PeptideProFormaParser.

## getCterModification()

AaModificationP pappso::Peptide::getCterModification | ( |  | ) | const

Definition at line 680 of file peptide.cpp.

{
return m_CterMod;
}

References m_CterMod.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), operator==, and PeptideProFormaParser.

## getLiAbsoluteString()

const QString pappso::Peptide::getLiAbsoluteString | ( |  | ) | const

get all sequence string with modifications and converting Leucine to Isoleucine

Definition at line 298 of file peptide.cpp.

{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->toAbsoluteString();
it++;
}
return seq.replace("L", "I");
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## getMass() [1/2]

pappso_double pappso::Peptide::getMass | ( |  | ) |

Definition at line 375 of file peptide.cpp.

{
qDebug() << "begin";
if(m_proxyMass < 0)
{
if(m_fullC13 || m_fullH2 || m_fullN15)
{
ChemicalFormula formula = getChemicalFormula();
m_proxyMass = formula.getMass();
}
else
{
m_proxyMass = m_cleavageNterMod->getMass() + m_cleavageCterMod->getMass();
if(m_NterMod != nullptr)
m_proxyMass += m_NterMod->getMass();
if(m_CterMod != nullptr)
m_proxyMass += m_CterMod->getMass();
for(auto aa : m_aaVec)
{
m_proxyMass += aa.getMass();
}
}
}
qDebug() << "end " << m_proxyMass;
return m_proxyMass;
}
pappso::Peptide::getChemicalFormula
virtual const ChemicalFormula getChemicalFormula() const override
Definition peptide.cpp:838

References getChemicalFormula(), pappso::ChemicalFormula::getMass(), m_aaVec, m_cleavageCterMod, m_cleavageNterMod, m_CterMod, m_fullC13, m_fullH2, m_fullN15, m_NterMod, and m_proxyMass.

Referenced by Peptide(), addAaModification(), addAaModificationOnAllAminoAcid(), pappso::Protein::getMass(), pappso::PeptideProFormaParser::parseStringToPeptide(), PeptideProFormaParser, removeAaModification(), removeCterAminoAcid(), removeNterAminoAcid(), replaceAaModification(), replaceAaModificationOnAminoAcid(), setCleavageCterModification(), setCleavageNterModification(), setCterModification(), setNterModification(), and pappso::PsmFeatures::setPeptideSpectrumCharge().

## getMass() [2/2]

pappso_double pappso::Peptide::getMass | ( |  | ) | const

override virtual

Implements pappso::Ion.

Definition at line 210 of file peptide.cpp.

{
return m_proxyMass;
}

References m_proxyMass.

## getMassIonSerie()

std::vector< double > pappso::Peptide::getMassIonSerie | ( | unsigned int | charge,
|  | pappso::Enums::PeptideIon | ion_type ) const

get complete serie of product masses for a given charge and ion type

Definition at line 336 of file peptide.cpp.

{
std::vector<double> mz_arr;
double mass_accumulator = 0;
double mass_shift = 0;
if(ion_type == pappso::Enums::PeptideIon::b)
{
for(const Aa &aa : m_aaVec)
{
mass_accumulator += aa.getMass();
mz_arr.push_back(mass_accumulator);
}
}
else if(ion_type == pappso::Enums::PeptideIon::y)
{
std::vector<Aa>::const_reverse_iterator it(m_aaVec.rbegin());
while(it != m_aaVec.rend())
{
mass_accumulator += it->getMass();
mz_arr.push_back(mass_accumulator);
it++;
}
mass_shift = MASSH2O;
}
else
{
throw pappso::ExceptionNotImplemented(
QObject::tr("Peptide::getMassIonSerie not implemented for ion type %1")
.arg(Utils::toString(ion_type)));
}
for(double &mass : mz_arr)
{
mass = (mass + mass_shift + (MHPLUS * (double)charge)) / (double)charge;
}
return mz_arr;
}
pappso::Utils::toString
static QString toString(specglob::SpectralAlignmentType type)
Convenience function to return a string describing the specglob alingment type.
Definition utils.cpp:544
pappso::Enums::PeptideIon::y
@ y
Cter amino ions.
Definition types.h:295
pappso::Enums::PeptideIon::b
@ b
Nter acylium ions.
Definition types.h:287
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
pappso::MASSH2O
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)

References pappso::Enums::b, m_aaVec, pappso::MASSH2O(), pappso::MHPLUS(), pappso::Utils::toString(), and pappso::Enums::y.

Referenced by PeptideProFormaParser.

## getModificationPositionList() [1/2]

std::vector< unsigned int > pappso::Peptide::getModificationPositionList | ( | AaModificationP | mod | ) | const

get modification positions

Parameters

  mod | modification to look for

Returns
  vector containing positions (from 0 to size-1)

Definition at line 522 of file peptide.cpp.

{
std::vector<unsigned int> position_list;
unsigned int position = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
unsigned int number = 0;
number += it->getNumberOfModification(mod);
for(unsigned int j = 0; j < number; j++)
{
position_list.push_back(position);
}
it++;
position++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## getModificationPositionList() [2/2]

std::vector< unsigned int > pappso::Peptide::getModificationPositionList | ( | AaModificationP | mod,
|  | const std::vector< char > & | aa_list ) const

get modification positions

Parameters

  mod | modification to look for
  aa_list | amino acid list targets (one letter code)

Returns
  vector containing positions (from 0 to size-1)

Definition at line 543 of file peptide.cpp.

{
std::vector<unsigned int> position_list;
unsigned int position = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(std::find(aa_list.begin(), aa_list.end(), it->getLetter()) != aa_list.end())
{
unsigned int number = 0;
number += it->getNumberOfModification(mod);
for(unsigned int j = 0; j < number; j++)
{
position_list.push_back(position);
}
}
it++;
position++;
}
// qDebug() << "Aa::getMass() end " << mass;
return position_list;
}

References m_aaVec.

## getNterModification()

AaModificationP pappso::Peptide::getNterModification | ( |  | ) | const

Definition at line 686 of file peptide.cpp.

{
return m_NterMod;
}

References m_NterMod.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), operator==, and PeptideProFormaParser.

## getNumberOfAtom()

int pappso::Peptide::getNumberOfAtom | ( | Enums::AtomIsotopeSurvey | atom | ) | const

override virtual

get the number of atom C, O, N, H in the molecule

Implements pappso::AtomNumberInterface.

Definition at line 403 of file peptide.cpp.

{
int number = m_cleavageNterMod->getNumberOfAtom(atom);
number += m_cleavageCterMod->getNumberOfAtom(atom);
if(m_NterMod != nullptr)
number += m_NterMod->getNumberOfAtom(atom);
if(m_CterMod != nullptr)
number += m_CterMod->getNumberOfAtom(atom);
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
number += it->getNumberOfAtom(atom);
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}

References m_aaVec, m_cleavageCterMod, m_cleavageNterMod, m_CterMod, and m_NterMod.

Referenced by PeptideProFormaParser.

## getNumberOfIsotope()

int pappso::Peptide::getNumberOfIsotope | ( | Enums::Isotope | isotope | ) | const

override virtual

get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule

Implements pappso::AtomNumberInterface.

Definition at line 423 of file peptide.cpp.

{
int number = m_cleavageNterMod->getNumberOfIsotope(isotope);
number += m_cleavageCterMod->getNumberOfIsotope(isotope);
if(m_NterMod != nullptr)
number += m_NterMod->getNumberOfIsotope(isotope);
if(m_CterMod != nullptr)
number += m_CterMod->getNumberOfIsotope(isotope);
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
number += it->getNumberOfIsotope(isotope);
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}

References m_aaVec, m_cleavageCterMod, m_cleavageNterMod, m_CterMod, and m_NterMod.

Referenced by PeptideProFormaParser.

## getNumberOfModification()

unsigned int pappso::Peptide::getNumberOfModification | ( | AaModificationP | mod | ) | const

count modification occurence

Parameters

  mod | modification to look for

Returns
  number of occurences

Definition at line 443 of file peptide.cpp.

{
unsigned int number = 0;
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
number += it->getNumberOfModification(mod);
it++;
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## getRawMassArray()

std::vector< double > pappso::Peptide::getRawMassArray | ( |  | ) | const

get raw mass array of the amino acid sequence

Definition at line 325 of file peptide.cpp.

{
std::vector<double> raw_mass_arr;
for(const Aa &aa : m_aaVec)
{
raw_mass_arr.push_back(aa.getMass());
}
return raw_mass_arr;
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## getSequence()

const QString pappso::Peptide::getSequence | ( |  | ) | const

override virtual

print amino acid sequence without modifications

Implements pappso::PeptideInterface.

Definition at line 255 of file peptide.cpp.

{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->getLetter();
it++;
}
return seq;
}

References m_aaVec.

Referenced by pappso::XtandemHyperscoreBis::computeXtandemHyperscore(), pappso::PeptideModificatorBase::getModificationPositionList(), PeptideProFormaParser, and pappso::PeptideFixedModificationBuilder::setPeptideSp().

## isPalindrome()

bool pappso::Peptide::isPalindrome | ( |  | ) | const

override virtual

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 705 of file peptide.cpp.

{
std::size_t size = m_aaVec.size();
std::size_t k = (size - 1);
for(std::size_t i = 0; i < (size / 2); i++, k--)
{
if(m_aaVec[i].getLetter() != m_aaVec[k].getLetter())
{
return false;
}
}
return true;
}

References m_aaVec, and size().

Referenced by PeptideProFormaParser.

## makeNoConstPeptideSp()

NoConstPeptideSp pappso::Peptide::makeNoConstPeptideSp | ( |  | ) | const

Definition at line 166 of file peptide.cpp.

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

Referenced by pappso::PeptideProFormaParser::parseNoConstString(), pappso::PeptideStrParser::parseNoConstString(), and PeptideProFormaParser.

## makePeptideSp()

PeptideSp pappso::Peptide::makePeptideSp | ( |  | ) | const

Definition at line 160 of file peptide.cpp.

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

Referenced by pappso::PeptideProFormaParser::parseString(), pappso::PeptideStrParser::parseString(), PeptideProFormaParser, pappso::PeptideBuilder::setPeptide(), pappso::PeptideModificatorPipeline::setPeptide(), pappso::PeptideFixedModificationBuilder::setPeptideSp(), pappso::PeptideVariableModificationBuilder::setPeptideSp(), and pappso::PeptideVariableModificationReplacement::setPeptideSp().

## rbegin()

std::vector< Aa >::const_reverse_iterator pappso::Peptide::rbegin | ( |  | ) | const

Definition at line 197 of file peptide.cpp.

{
return m_aaVec.rbegin();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), and PeptideProFormaParser.

## removeAaModification()

void pappso::Peptide::removeAaModification | ( | AaModificationP | mod | ) |

removes all occurences of a modification

Parameters

  mod | modification to remove

Definition at line 508 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
it->removeAaModification(mod);
qDebug() << it->toString() << " " << toAbsoluteString();
it++;
}
m_proxyMass = -1;
getMass();
// qDebug() << "Aa::getMass() end " << mass;
}
pappso::Peptide::toAbsoluteString
const QString toAbsoluteString() const
print all modifications
Definition peptide.cpp:267

References getMass(), m_aaVec, m_proxyMass, and toAbsoluteString().

Referenced by PeptideProFormaParser.

## removeCterAminoAcid()

void pappso::Peptide::removeCterAminoAcid | ( |  | ) |

Definition at line 770 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.end());
it--;
if(it != m_aaVec.end())
{
m_aaVec.erase(it);
m_proxyMass = -1;
getMass();
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}

References getMass(), m_aaVec, and m_proxyMass.

Referenced by PeptideProFormaParser.

## removeNterAminoAcid()

void pappso::Peptide::removeNterAminoAcid | ( |  | ) |

Definition at line 753 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.begin());
if(it != m_aaVec.end())
{
m_aaVec.erase(it);
m_proxyMass = -1;
getMass();
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}

References getMass(), m_aaVec, and m_proxyMass.

Referenced by PeptideProFormaParser.

## rend()

std::vector< Aa >::const_reverse_iterator pappso::Peptide::rend | ( |  | ) | const

Definition at line 203 of file peptide.cpp.

{
return m_aaVec.rend();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), and PeptideProFormaParser.

## replaceAaModification()

void pappso::Peptide::replaceAaModification | ( | AaModificationP | oldmod,
|  | AaModificationP | newmod )

replaces all occurences of a modification by a new one

Parameters

  oldmod | modification to change
  newmod | new modification

Definition at line 474 of file peptide.cpp.

{
if(oldmod == newmod)
return;
std::vector<Aa>::iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
it->replaceAaModification(oldmod, newmod);
it++;
}
m_proxyMass = -1;
getMass();
}

References getMass(), m_aaVec, and m_proxyMass.

Referenced by PeptideProFormaParser.

## replaceAaModificationOnAminoAcid()

void pappso::Peptide::replaceAaModificationOnAminoAcid | ( | Enums::AminoAcidChar | aa,
|  | pappso::AaModificationP | oldmod,
|  | pappso::AaModificationP | newmod )

replaces all occurences of a modification by a new one on a specific amino acid

Parameters

  aa | the amino acid to modify
  oldmod | modification to change
  newmod | new modification

Definition at line 489 of file peptide.cpp.

{
if(oldmod == newmod)
return;
std::vector<Aa>::iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
if(it->getAminoAcidChar() == aa)
{
it->replaceAaModification(oldmod, newmod);
}
it++;
}
m_proxyMass = -1;
getMass();
}

References getMass(), m_aaVec, and m_proxyMass.

Referenced by PeptideProFormaParser.

## replaceLeucineIsoleucine()

void pappso::Peptide::replaceLeucineIsoleucine | ( |  | ) |

Definition at line 740 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.begin());
std::vector<Aa>::iterator itend(m_aaVec.end());
for(; it != itend; it++)
{
it->replaceLeucineIsoleucine();
}
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## reverse()

void pappso::Peptide::reverse | ( |  | ) |

Definition at line 698 of file peptide.cpp.

{
std::reverse(m_aaVec.begin(), m_aaVec.end());
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## rotate()

void pappso::Peptide::rotate | ( |  | ) |

Definition at line 692 of file peptide.cpp.

{
std::rotate(m_aaVec.begin(), m_aaVec.begin() + 1, m_aaVec.end());
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## setCleavageCterModification()

void pappso::Peptide::setCleavageCterModification | ( | AaModificationP | mod | ) |

Definition at line 621 of file peptide.cpp.

{
if(mod->getAccession().startsWith("internal:Cter_"))
{
m_proxyMass = -1;
m_cleavageNterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a cleavage Cter modification : %1")
.arg(mod->getAccession()));
}
}

References pappso::AaModification::getAccession(), getMass(), m_cleavageNterMod, and m_proxyMass.

Referenced by pappso::PeptideStrParser::parseStringToPeptide(), and PeptideProFormaParser.

## setCleavageNterModification()

void pappso::Peptide::setCleavageNterModification | ( | AaModificationP | mod | ) |

Definition at line 605 of file peptide.cpp.

{
if(mod->getAccession().startsWith("internal:Nter_"))
{
m_proxyMass = -1;
m_cleavageNterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a cleavage Nter modification : %1")
.arg(mod->getAccession()));
}
}

References pappso::AaModification::getAccession(), getMass(), m_cleavageNterMod, and m_proxyMass.

Referenced by pappso::PeptideStrParser::parseStringToPeptide(), and PeptideProFormaParser.

## setCterModification()

void pappso::Peptide::setCterModification | ( | AaModificationP | mod | ) |

Definition at line 664 of file peptide.cpp.

{
if(mod != nullptr)
{
m_proxyMass = -1;
m_CterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a peptide Cter modification : mod == nulptr"));
}
}

References getMass(), m_CterMod, and m_proxyMass.

Referenced by pappso::PeptideProFormaParser::parseStringToPeptide(), and PeptideProFormaParser.

## setGlobalModification()

void pappso::Peptide::setGlobalModification | ( | Enums::Isotope | isotope_kind | ) |

apply 100% isotope replacement

Todo

Definition at line 826 of file peptide.cpp.

{
if(isotope_kind == Enums::Isotope::C13)
m_fullC13 = true;
else if(isotope_kind == Enums::Isotope::N15)
m_fullN15 = true;
else if(isotope_kind == Enums::Isotope::H2)
m_fullH2 = true;
}

References pappso::Enums::C13, pappso::Enums::H2, m_fullC13, m_fullH2, m_fullN15, and pappso::Enums::N15.

Referenced by pappso::PeptideProFormaParser::parseStringToPeptide(), and PeptideProFormaParser.

## setNterModification()

void pappso::Peptide::setNterModification | ( | AaModificationP | mod | ) |

Definition at line 649 of file peptide.cpp.

{
if(mod != nullptr)
{
m_proxyMass = -1;
m_NterMod = mod;
getMass();
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not a peptide Nter modification : mod == nulptr"));
}
}

References getMass(), m_NterMod, and m_proxyMass.

Referenced by pappso::PeptideProFormaParser::parseStringToPeptide(), and PeptideProFormaParser.

## size()

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

override virtual

Implements pappso::PeptideInterface.

Definition at line 217 of file peptide.cpp.

{
return m_aaVec.size();
}

References m_aaVec.

Referenced by pappso::IonIsotopeRatioScore::IonIsotopeRatioScore(), addAaModification(), pappso::PsmFeatures::findComplementIonPairs(), isPalindrome(), PeptideProFormaParser, and pappso::PeptideFixedModificationBuilder::setPeptideSp().

## toAbsoluteString()

const QString pappso::Peptide::toAbsoluteString | ( |  | ) | const

print all modifications

Definition at line 267 of file peptide.cpp.

{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
QStringList modification_str_list;
modification_str_list << m_cleavageNterMod->getAccession();
if(m_NterMod != nullptr)
modification_str_list << m_NterMod->getAccession();
while(it != m_aaVec.end())
{
seq += it->getLetter();
if(it == m_aaVec.end() - 1)
{
modification_str_list << m_cleavageCterMod->getAccession();
if(m_CterMod != nullptr)
modification_str_list << m_CterMod->getAccession();
}
for(auto &pmod : it->getModificationList())
{
modification_str_list << pmod->getAccession();
}
if(modification_str_list.size() > 0)
seq += QString("(%1)").arg(modification_str_list.join(","));
modification_str_list.clear();
it++;
}
return seq;
}

References m_aaVec, m_cleavageCterMod, m_cleavageNterMod, m_CterMod, and m_NterMod.

Referenced by PeptideProFormaParser, and removeAaModification().

## toProForma()

QString pappso::Peptide::toProForma | ( |  | ) | const

get the peptide model in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README.md

Returns
  QString as described in ProForma

Definition at line 787 of file peptide.cpp.

{
QString seq = "";
if(m_fullC13)
{
seq += "<13C>";
}
if(m_fullN15)
{
seq += "<15N>";
}
if(m_fullH2)
{
seq += "<D>";
}
if(m_NterMod != nullptr)
{
QString nter_accession = m_NterMod->getAccession();
seq = QString("[%1]-").arg(nter_accession);
}
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->toProForma();
it++;
}
if(m_CterMod != nullptr)
{
QString cter_accession = m_CterMod->getAccession();
seq += QString("-[%1]").arg(cter_accession);
}
return seq;
}

References m_aaVec, m_CterMod, m_fullC13, m_fullH2, m_fullN15, and m_NterMod.

Referenced by PeptideProFormaParser.

## toString()

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

print modification except internal modifications

Definition at line 312 of file peptide.cpp.

{
QString seq = "";
std::vector<Aa>::const_iterator it(m_aaVec.begin());
while(it != m_aaVec.end())
{
seq += it->toString();
it++;
}
return seq;
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## Friends And Related Symbol Documentation

## operator<

bool operator< | ( | const Peptide & | l,
|  | const Peptide & | r )

friend

Definition at line 46 of file peptide.cpp.

{
return (l.m_aaVec < r.m_aaVec);
}

References m_aaVec.

Referenced by PeptideProFormaParser.

## operator==

bool operator== | ( | const Peptide & | l,
|  | const Peptide & | r )

friend

Definition at line 53 of file peptide.cpp.

{
if(l.getCleavageNterModification() != r.getCleavageNterModification())
return false;
if(l.getCleavageCterModification() != r.getCleavageCterModification())
return false;
if(l.getNterModification() && r.getNterModification() &&
(l.getNterModification() != r.getNterModification()))
return false;
if(l.getCterModification() && r.getCterModification() &&
(l.getCterModification() != r.getCterModification()))
return false;
return (l.m_aaVec == r.m_aaVec);
}

References getCleavageCterModification(), getCleavageNterModification(), getCterModification(), getNterModification(), and m_aaVec.

Referenced by PeptideProFormaParser.

## PeptideProFormaParser

friend class PeptideProFormaParser

friend

Definition at line 103 of file peptide.h.

References Peptide(), addAaModification(), addAaModificationOnAllAminoAcid(), begin(), countModificationOnAa(), end(), getAa(), getAaPositionList(), getChemicalFormula(), getChemicalFormulaCharge(), getCleavageCterModification(), getCleavageNterModification(), getConstAa(), getCterModification(), getLiAbsoluteString(), getMass(), getMassIonSerie(), getModificationPositionList(), getNterModification(), getNumberOfAtom(), getNumberOfIsotope(), getNumberOfModification(), getRawMassArray(), getSequence(), isPalindrome(), makeNoConstPeptideSp(), makePeptideSp(), operator<, operator==, PeptideProFormaParser, rbegin(), removeAaModification(), removeCterAminoAcid(), removeNterAminoAcid(), rend(), replaceAaModification(), replaceAaModificationOnAminoAcid(), replaceLeucineIsoleucine(), reverse(), rotate(), setCleavageCterModification(), setCleavageNterModification(), setCterModification(), setGlobalModification(), setNterModification(), size(), toAbsoluteString(), toProForma(), and toString().

Referenced by PeptideProFormaParser.

## Member Data Documentation

## m_aaVec

std::vector<Aa> pappso::Peptide::m_aaVec

protected

Definition at line 266 of file peptide.h.

Referenced by Peptide(), Peptide(), Peptide(), addAaModification(), begin(), begin(), countModificationOnAa(), end(), end(), getAa(), getAaPositionList(), getAaPositionList(), getConstAa(), getLiAbsoluteString(), getMass(), getMassIonSerie(), getModificationPositionList(), getModificationPositionList(), getNumberOfAtom(), getNumberOfIsotope(), getNumberOfModification(), getRawMassArray(), getSequence(), isPalindrome(), operator<, operator==, pappso::PeptideProFormaParser::parseStringToPeptide(), rbegin(), removeAaModification(), removeCterAminoAcid(), removeNterAminoAcid(), rend(), replaceAaModification(), replaceAaModificationOnAminoAcid(), replaceLeucineIsoleucine(), reverse(), rotate(), size(), toAbsoluteString(), toProForma(), and toString().

## m_cleavageCterMod

AaModificationP pappso::Peptide::m_cleavageCterMod = nullptr

protected

Definition at line 274 of file peptide.h.

Referenced by Peptide(), Peptide(), Peptide(), getCleavageCterModification(), getMass(), getNumberOfAtom(), getNumberOfIsotope(), and toAbsoluteString().

## m_cleavageNterMod

AaModificationP pappso::Peptide::m_cleavageNterMod = nullptr

protected

Definition at line 272 of file peptide.h.

Referenced by Peptide(), Peptide(), Peptide(), getCleavageNterModification(), getMass(), getNumberOfAtom(), getNumberOfIsotope(), setCleavageCterModification(), setCleavageNterModification(), and toAbsoluteString().

## m_CterMod

AaModificationP pappso::Peptide::m_CterMod = nullptr

protected

Definition at line 276 of file peptide.h.

Referenced by Peptide(), Peptide(), Peptide(), getCterModification(), getMass(), getNumberOfAtom(), getNumberOfIsotope(), setCterModification(), toAbsoluteString(), and toProForma().

## m_fullC13

bool pappso::Peptide::m_fullC13 = false

protected

Definition at line 267 of file peptide.h.

Referenced by Peptide(), Peptide(), getChemicalFormulaCharge(), getMass(), setGlobalModification(), and toProForma().

## m_fullH2

bool pappso::Peptide::m_fullH2 = false

protected

Definition at line 269 of file peptide.h.

Referenced by Peptide(), Peptide(), getChemicalFormulaCharge(), getMass(), setGlobalModification(), and toProForma().

## m_fullN15

bool pappso::Peptide::m_fullN15 = false

protected

Definition at line 268 of file peptide.h.

Referenced by Peptide(), Peptide(), getChemicalFormulaCharge(), getMass(), setGlobalModification(), and toProForma().

## m_NterMod

AaModificationP pappso::Peptide::m_NterMod = nullptr

protected

Definition at line 275 of file peptide.h.

Referenced by Peptide(), Peptide(), Peptide(), getMass(), getNterModification(), getNumberOfAtom(), getNumberOfIsotope(), setNterModification(), toAbsoluteString(), and toProForma().

## m_proxyMass

double pappso::Peptide::m_proxyMass = -1

protected

Definition at line 270 of file peptide.h.

Referenced by Peptide(), Peptide(), addAaModification(), addAaModificationOnAllAminoAcid(), getMass(), getMass(), pappso::PeptideProFormaParser::parseStringToPeptide(), removeAaModification(), removeCterAminoAcid(), removeNterAminoAcid(), replaceAaModification(), replaceAaModificationOnAminoAcid(), setCleavageCterModification(), setCleavageNterModification(), setCterModification(), and setNterModification().

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

- pappsomspp/core/peptide/peptide.h
- pappsomspp/core/peptide/peptide.cpp