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, 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
pappso_double | getMass ()
pappso_double | getMass () const override
virtual int | getNumberOfAtom (AtomIsotopeSurvey atom) const override
| get the number of atom C, O, N, H in the molecule
virtual int | getNumberOfIsotope (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 | 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
AaModificationP | getInternalNterModification () const
AaModificationP | getInternalCterModification () const
void | removeInternalNterModification ()
void | removeInternalCterModification ()
void | setInternalNterModification (AaModificationP mod)
void | setInternalCterModification (AaModificationP mod)
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
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
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
pappso_double | m_proxyMass = -1

## Friends

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

## Detailed Description

Definition at line 99 of file peptide.h.

## Constructor & Destructor Documentation

## Peptide() [1/3]

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

Definition at line 79 of file peptide.cpp.

{
QString::const_iterator it(pepstr.begin());
if(it != pepstr.end())
{
// first amino acid is the Nter one
// by default, it is obtained by hydrolytic cleavage in normal water
// and it is loaded with one Hydrogen
Aa nter_aa(it->toLatin1());
nter_aa.addAaModification(
AaModification::getInstance("internal:Nter_hydrolytic_cleavage_H"));
m_aaVec.push_back(nter_aa);
it++;
while(it != pepstr.end())
{
m_aaVec.push_back(Aa(it->toLatin1()));
it++;
}
// by default, Nter aa is obtained by hydrolytic cleavage in normal water
// and it is loaded with Hydrogen + Oxygen
m_aaVec.back().addAaModification(
AaModification::getInstance("internal:Cter_hydrolytic_cleavage_HO"));
getMass();
qDebug() << "blabla " << m_aaVec.back().toString();
}
}
pappso::AaModification::getInstance
static AaModificationP getInstance(const QString &accession)
Definition aamodification.cpp:456
pappso::Peptide::getMass
pappso_double getMass()
Definition peptide.cpp:274
pappso::Peptide::m_aaVec
std::vector< Aa > m_aaVec
Definition peptide.h:244

References pappso::Aa::addAaModification(), pappso::AaModification::getInstance(), getMass(), and m_aaVec.

## ~Peptide()

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

virtual

Definition at line 108 of file peptide.cpp.

{
}

## Peptide() [2/3]

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

Definition at line 112 of file peptide.cpp.

: m_aaVec(peptide.m_aaVec), m_proxyMass(peptide.m_proxyMass)
{
}
pappso::Peptide::m_proxyMass
pappso_double m_proxyMass
Definition peptide.h:245

## Peptide() [3/3]

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

Definition at line 118 of file peptide.cpp.

: m_aaVec(std::move(toCopy.m_aaVec)), m_proxyMass(toCopy.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 187 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:182

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

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

## addAaModificationOnAllAminoAcid()

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

adds a modification to all amino acid of the sequence

Parameters

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

Definition at line 204 of file peptide.cpp.

{
for(auto &aa : *this)
{
if(aa.getAminoAcidChar() == amino_acid)
{
aa.addAaModification(aaModification);
}
}
m_proxyMass = -1;
getMass();
}

References getMass(), and m_proxyMass.

## begin() [1/2]

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

Definition at line 138 of file peptide.cpp.

{
return m_aaVec.begin();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

## begin() [2/2]

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

Definition at line 150 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 333 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.

## end() [1/2]

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

Definition at line 144 of file peptide.cpp.

{
return m_aaVec.end();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

## end() [2/2]

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

Definition at line 156 of file peptide.cpp.

{
return m_aaVec.end();
}

References m_aaVec.

## getAa()

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

Definition at line 602 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::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 427 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 pappso::PeptideBuilder::setPeptide().

## getAaPositionList() [2/2]

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

Definition at line 444 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;
}

References m_aaVec.

## getConstAa()

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

Definition at line 612 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().

## getInternalCterModification()

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

Definition at line 478 of file peptide.cpp.

{
std::vector<Aa>::const_iterator it(m_aaVec.end());
it--;
if(it != m_aaVec.end())
{
return it->getInternalCterModification();
}
return nullptr;
}

References m_aaVec.

Referenced by pappso::specglob::PeptideModel::PeptideModel(), pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), removeCterAminoAcid(), reverse(), and rotate().

## getInternalNterModification()

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

Definition at line 467 of file peptide.cpp.

{
std::vector<Aa>::const_iterator it(m_aaVec.begin());
if(it != m_aaVec.end())
{
return it->getInternalNterModification();
}
return nullptr;
}

References m_aaVec.

Referenced by pappso::specglob::PeptideModel::PeptideModel(), pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses(), removeNterAminoAcid(), reverse(), and rotate().

## getLiAbsoluteString()

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

get all sequence string with modifications and converting Leucine to Isoleucine

Definition at line 247 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.

## getMass() [1/2]

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

Definition at line 274 of file peptide.cpp.

{
qDebug() << "Aa::getMass() begin";
if(m_proxyMass < 0)
{
m_proxyMass = 0;
for(auto aa : m_aaVec)
{
m_proxyMass += aa.getMass();
}
}
qDebug() << "Aa::getMass() end " << m_proxyMass;
return m_proxyMass;
}

References m_aaVec, and m_proxyMass.

Referenced by Peptide(), addAaModification(), addAaModificationOnAllAminoAcid(), pappso::Protein::getMass(), pappso::PeptideProFormaParser::parseStringToPeptide(), removeAaModification(), removeCterAminoAcid(), removeNterAminoAcid(), and replaceAaModification().

## getMass() [2/2]

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

override virtual

Implements pappso::Ion.

Definition at line 175 of file peptide.cpp.

{
return m_proxyMass;
}

References m_proxyMass.

## 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 380 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.

## 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 401 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.

## getNumberOfAtom()

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

override virtual

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

Implements pappso::AtomNumberInterface.

Definition at line 290 of file peptide.cpp.

{
int number = 0;
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.

## getNumberOfIsotope()

int pappso::Peptide::getNumberOfIsotope | ( | 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 304 of file peptide.cpp.

{
int number = 0;
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.

## 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 319 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.

## getSequence()

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

override virtual

print amino acid sequence without modifications

Implements pappso::PeptideInterface.

Definition at line 222 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(), and pappso::PeptideModificatorBase::getModificationPositionList().

## isPalindrome()

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

override virtual

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 587 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().

## makeNoConstPeptideSp()

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

Definition at line 131 of file peptide.cpp.

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

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

## makePeptideSp()

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

Definition at line 125 of file peptide.cpp.

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

Referenced by pappso::PeptideProFormaParser::parseString(), pappso::PeptideStrParser::parseString(), 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 162 of file peptide.cpp.

{
return m_aaVec.rbegin();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

## removeAaModification()

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

removes all occurences of a modification

Parameters

  mod | modification to remove

Definition at line 366 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:234

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

## removeCterAminoAcid()

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

Definition at line 660 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.end());
it--;
if(it != m_aaVec.end())
{
AaModificationP cter_modification = getInternalCterModification();
m_aaVec.erase(it);
if(cter_modification != nullptr)
{
it = m_aaVec.end();
it--;
it->addAaModification(cter_modification);
}
m_proxyMass = -1;
getMass();
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}
pappso::Peptide::getInternalCterModification
AaModificationP getInternalCterModification() const
Definition peptide.cpp:478
pappso::AaModificationP
const AaModification * AaModificationP
Definition aamodification.h:52

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

## removeInternalCterModification()

void pappso::Peptide::removeInternalCterModification | ( |  | ) |

Definition at line 500 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.end());
it--;
if(it != m_aaVec.end())
{
m_proxyMass -= it->getMass();
it->removeInternalCterModification();
m_proxyMass += it->getMass();
}
}

References m_aaVec, and m_proxyMass.

Referenced by reverse(), rotate(), and setInternalCterModification().

## removeInternalNterModification()

void pappso::Peptide::removeInternalNterModification | ( |  | ) |

Definition at line 489 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.begin());
if(it != m_aaVec.end())
{
m_proxyMass -= it->getMass();
it->removeInternalNterModification();
m_proxyMass += it->getMass();
}
}

References m_aaVec, and m_proxyMass.

Referenced by setInternalNterModification().

## removeNterAminoAcid()

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

Definition at line 637 of file peptide.cpp.

{
std::vector<Aa>::iterator it(m_aaVec.begin());
if(it != m_aaVec.end())
{
AaModificationP nter_modification = getInternalNterModification();
m_aaVec.erase(it);
if(nter_modification != nullptr)
{
m_aaVec.begin()->addAaModification(nter_modification);
}
m_proxyMass = -1;
getMass();
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}
pappso::Peptide::getInternalNterModification
AaModificationP getInternalNterModification() const
Definition peptide.cpp:467

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

## rend()

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

Definition at line 168 of file peptide.cpp.

{
return m_aaVec.rend();
}

References m_aaVec.

Referenced by pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses().

## 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 352 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.

## replaceLeucineIsoleucine()

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

Definition at line 624 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.

## reverse()

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

Definition at line 574 of file peptide.cpp.

{
AaModificationP modNter = getInternalNterModification();
AaModificationP modCter = getInternalCterModification();
m_aaVec.begin()->removeInternalNterModification();
(m_aaVec.end() - 1)->removeInternalCterModification();
std::reverse(m_aaVec.begin(), m_aaVec.end());
m_aaVec.begin()->addAaModification(modNter);
(m_aaVec.end() - 1)->addAaModification(modCter);
}
pappso::Peptide::removeInternalCterModification
void removeInternalCterModification()
Definition peptide.cpp:500
pappso::Peptide::addAaModification
void addAaModification(AaModificationP aaModification, unsigned int position)
adds a modification to amino acid sequence
Definition peptide.cpp:187

References addAaModification(), getInternalCterModification(), getInternalNterModification(), m_aaVec, and removeInternalCterModification().

## rotate()

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

Definition at line 562 of file peptide.cpp.

{
AaModificationP modNter = getInternalNterModification();
AaModificationP modCter = getInternalCterModification();
m_aaVec.begin()->removeInternalNterModification();
(m_aaVec.end() - 1)->removeInternalCterModification();
std::rotate(m_aaVec.begin(), m_aaVec.begin() + 1, m_aaVec.end());
m_aaVec.begin()->addAaModification(modNter);
(m_aaVec.end() - 1)->addAaModification(modCter);
}

References addAaModification(), getInternalCterModification(), getInternalNterModification(), m_aaVec, and removeInternalCterModification().

## setInternalCterModification()

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

Definition at line 537 of file peptide.cpp.

{
if(mod->getAccession().startsWith("internal:Cter_"))
{
removeInternalCterModification();
std::vector<Aa>::iterator it(m_aaVec.end());
it--;
if(it != m_aaVec.end())
{
it->addAaModification(mod);
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not an internal Cter modification : %1")
.arg(mod->getAccession()));
}
}

References pappso::AaModification::getAccession(), m_aaVec, and removeInternalCterModification().

Referenced by pappso::PeptideStrParser::parseStringToPeptide().

## setInternalNterModification()

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

Definition at line 514 of file peptide.cpp.

{
if(mod->getAccession().startsWith("internal:Nter_"))
{
removeInternalNterModification();
std::vector<Aa>::iterator it(m_aaVec.begin());
if(it != m_aaVec.end())
{
it->addAaModification(mod);
}
else
{
throw ExceptionOutOfRange(QObject::tr("peptide is empty"));
}
}
else
{
throw ExceptionNotPossible(
QObject::tr("modification is not an internal Nter modification : %1")
.arg(mod->getAccession()));
}
}
pappso::Peptide::removeInternalNterModification
void removeInternalNterModification()
Definition peptide.cpp:489

References pappso::AaModification::getAccession(), m_aaVec, and removeInternalNterModification().

Referenced by pappso::PeptideStrParser::parseStringToPeptide().

## size()

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

override virtual

Implements pappso::PeptideInterface.

Definition at line 182 of file peptide.cpp.

{
return m_aaVec.size();
}

References m_aaVec.

Referenced by addAaModification(), isPalindrome(), pappso::PeptideProFormaParser::parseStringToPeptide(), and pappso::PeptideFixedModificationBuilder::setPeptideSp().

## toAbsoluteString()

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

print all modifications

Definition at line 234 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;
}

References m_aaVec.

Referenced by 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 684 of file peptide.cpp.

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

References m_aaVec.

## toString()

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

print modification except internal modifications

Definition at line 261 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.

## Friends And Related Symbol Documentation

## operator<

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

friend

Definition at line 107 of file peptide.h.

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

## operator==

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

friend

Definition at line 113 of file peptide.h.

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

## PeptideProFormaParser

friend class PeptideProFormaParser

friend

Definition at line 101 of file peptide.h.

## Member Data Documentation

## m_aaVec

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

protected

Definition at line 244 of file peptide.h.

Referenced by Peptide(), addAaModification(), begin(), begin(), countModificationOnAa(), end(), end(), getAa(), getAaPositionList(), getAaPositionList(), getConstAa(), getInternalCterModification(), getInternalNterModification(), getLiAbsoluteString(), getMass(), getModificationPositionList(), getModificationPositionList(), getNumberOfAtom(), getNumberOfIsotope(), getNumberOfModification(), getSequence(), isPalindrome(), pappso::PeptideProFormaParser::parseStringToPeptide(), rbegin(), removeAaModification(), removeCterAminoAcid(), removeInternalCterModification(), removeInternalNterModification(), removeNterAminoAcid(), rend(), replaceAaModification(), replaceLeucineIsoleucine(), reverse(), rotate(), setInternalCterModification(), setInternalNterModification(), size(), toAbsoluteString(), toProForma(), and toString().

## m_proxyMass

pappso_double pappso::Peptide::m_proxyMass = -1

protected

Definition at line 245 of file peptide.h.

Referenced by addAaModification(), addAaModificationOnAllAminoAcid(), getMass(), getMass(), pappso::PeptideProFormaParser::parseStringToPeptide(), removeAaModification(), removeCterAminoAcid(), removeInternalCterModification(), removeInternalNterModification(), removeNterAminoAcid(), and replaceAaModification().

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

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