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

`#include <aa.h>`

Inheritance diagram for pappso::Aa:

## Public Member Functions

| Aa (char aa_letter)
| Aa (Enums::AminoAcidChar aa_char)
| Aa (const Aa &aa)
| Aa (Aa &&toCopy)
Aa & | operator= (const Aa &toCopy)
virtual | ~Aa ()
pappso_double | getMass () const override
int | getNumberOfAtom (Enums::AtomIsotopeSurvey atom) const override final
| get the number of atom C, O, N, H in the molecule
int | getNumberOfIsotope (Enums::Isotope isotope) const override final
| get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
unsigned int | getNumberOfModification (AaModificationP mod) const
const QString | toString () const
const QString | toAbsoluteString () const
const QString | toProForma () const
| get the amino acid in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README.md
void | addAaModification (AaModificationP aaModification)
void | removeAaModification (AaModificationP aaModification)
void | replaceAaModification (AaModificationP oldmod, AaModificationP newmod)
| replaces all occurences of a modification by a new one
void | removeAllButInternalModification ()
| remove all non internal modifications
const std::vector< AaModificationP > & | getModificationList () const
double | getTotalModificationMass () const
| get the sum of mass modifications
bool | isLesser (Aa const &r) const
bool | isAaEqual (Aa const &r) const
Public Member Functions inherited from pappso::AaBase
virtual const char & | getLetter () const
const Enums::AminoAcidChar & | getAminoAcidChar () const
virtual void | replaceLeucineIsoleucine ()
Public Member Functions inherited from pappso::AtomNumberInterface
virtual const ChemicalFormula | getChemicalFormula () const

## Private Attributes

std::vector< AaModificationP > | m_listMod

## Additional Inherited Members

Static Public Member Functions inherited from pappso::AaBase
static const std::vector< Enums::AminoAcidChar > & | getAminoAcidCharList ()
Protected Member Functions inherited from pappso::AaBase
| AaBase (char aa_letter)
| AaBase (Enums::AminoAcidChar aa_char)
| AaBase (const AaBase &aabase)
virtual | ~AaBase ()
int | getNumberOfIsotope (Enums::Isotope isotope) const override
| get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
Static Protected Member Functions inherited from pappso::AaBase
static pappso_double | getAaMass (char aa_letter)
Protected Attributes inherited from pappso::AaBase
char | m_aaLetter

## Detailed Description

Definition at line 44 of file aa.h.

## Constructor & Destructor Documentation

## Aa() [1/4]

pappso::Aa::Aa | ( | char | aa_letter | ) |

Definition at line 41 of file aa.cpp.

: AaBase(aa_letter)
{
}
pappso::AaBase::AaBase
AaBase(char aa_letter)
Definition aabase.cpp:43

References pappso::AaBase::AaBase().

Referenced by Aa(), Aa(), isAaEqual(), isLesser(), and operator=().

## Aa() [2/4]

pappso::Aa::Aa | ( | Enums::AminoAcidChar | aa_char | ) |

Definition at line 46 of file aa.cpp.

: AaBase(aa_char)
{
}

References pappso::AaBase::AaBase().

## Aa() [3/4]

pappso::Aa::Aa | ( | const Aa & | aa | ) |

Definition at line 50 of file aa.cpp.

: AaBase(other), m_listMod(other.m_listMod)
{
}
pappso::Aa::m_listMod
std::vector< AaModificationP > m_listMod
Definition aa.h:98

References Aa(), pappso::AaBase::AaBase(), and m_listMod.

## Aa() [4/4]

pappso::Aa::Aa | ( | Aa && | toCopy | ) |

Definition at line 55 of file aa.cpp.

: AaBase(toCopy), m_listMod(std::move(toCopy.m_listMod))
{
}

References Aa(), pappso::AaBase::AaBase(), and m_listMod.

## ~Aa()

pappso::Aa::~Aa | ( |  | ) |

virtual

Definition at line 60 of file aa.cpp.

{
}

## Member Function Documentation

## addAaModification()

void pappso::Aa::addAaModification | ( | AaModificationP | aaModification | ) |

Definition at line 189 of file aa.cpp.

{
qDebug();
qDebug() << aaModification->getAccession();
m_listMod.push_back(aaModification);
sort(m_listMod.begin(), m_listMod.end());
qDebug();
}

References pappso::AaModification::getAccession(), and m_listMod.

## getMass()

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

override virtual

Reimplemented from pappso::AaBase.

Definition at line 90 of file aa.cpp.

{
// qDebug() << "Aa::getMass() begin";
pappso_double mass = AaBase::getMass();
for(auto &&mod : m_listMod)
{
mass += mod->getMass();
}
// qDebug() << "Aa::getMass() end " << mass;
return mass;
}
pappso::AaBase::getMass
virtual pappso_double getMass() const
Definition aabase.cpp:356
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:60

References pappso::AaBase::getMass(), and m_listMod.

Referenced by pappso::specglob::PeptideModel::checkForMutation(), pappso::AaModification::createInstanceMutation(), pappso::specglob::PeptideModel::ltrimOnRemoval(), and pappso::specpeptidoms::SemiGlobalAlignment::saveBestAlignment().

## getModificationList()

const std::vector< AaModificationP > & pappso::Aa::getModificationList | ( |  | ) | const

Definition at line 73 of file aa.cpp.

{
return m_listMod;
}

References m_listMod.

Referenced by pappso::specglob::PeptideModel::checkForAaModification(), and pappso::specglob::PeptideModel::checkForMutation().

## getNumberOfAtom()

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

final override virtual

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

Reimplemented from pappso::AaBase.

Definition at line 206 of file aa.cpp.

{
int number_of_carbon = AaBase::getNumberOfAtom(atom);
for(auto &&mod : m_listMod)
{
number_of_carbon += mod->getNumberOfAtom(atom);
}
// qDebug() << "Aa::getMass() end " << mass;
return number_of_carbon;
}
pappso::AaBase::getNumberOfAtom
virtual int getNumberOfAtom(Enums::AtomIsotopeSurvey atom) const override
get the number of atom C, O, N, H in the molecule
Definition aabase.cpp:363

References pappso::AaBase::getNumberOfAtom(), and m_listMod.

Referenced by pappso::AaModification::createInstanceMutation().

## getNumberOfIsotope()

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

final override virtual

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

Implements pappso::AtomNumberInterface.

Definition at line 220 of file aa.cpp.

{
int number = 0;
for(auto &&mod : m_listMod)
{
number += mod->getNumberOfIsotope(isotope);
}
// qDebug() << "Aa::getMass() end " << mass;
return number;
}

References m_listMod.

## getNumberOfModification()

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

Definition at line 233 of file aa.cpp.

{
unsigned int number_of_mod = 0;
for(auto &&modb : m_listMod)
{
if(modb == mod)
number_of_mod += 1;
}
// qDebug() << "Aa::getMass() end " << mass;
return number_of_mod;
}

References m_listMod.

Referenced by pappso::PeptideModificatorBase::getModificationPositionList().

## getTotalModificationMass()

double pappso::Aa::getTotalModificationMass | ( |  | ) | const

get the sum of mass modifications

Definition at line 79 of file aa.cpp.

{
double mass = 0;
for(auto &&mod : m_listMod)
{
mass += mod->getMass();
}
return mass;
}

References m_listMod.

Referenced by pappso::specglob::PeptideModel::checkForAaModification().

## isAaEqual()

bool pappso::Aa::isAaEqual | ( | Aa const & | r | ) | const

Definition at line 279 of file aa.cpp.

{
return (std::tie(m_aaLetter, m_listMod) == std::tie(r.m_aaLetter, r.m_listMod));
}
pappso::AaBase::m_aaLetter
char m_aaLetter
Definition aabase.h:68

References Aa(), pappso::AaBase::m_aaLetter, and m_listMod.

Referenced by pappso::operator==().

## isLesser()

bool pappso::Aa::isLesser | ( | Aa const & | r | ) | const

Definition at line 254 of file aa.cpp.

{
qDebug() << m_listMod << "//" << r.m_listMod;
// qDebug() << "operator<(const Aa& l, const Aa& r)";
if(m_aaLetter == r.m_aaLetter)
{
std::size_t a = m_listMod.size();
std::size_t b = r.m_listMod.size();
if(a == b)
{
return (m_listMod < r.m_listMod);
}
else
{
return (a < b);
}
}
else
{
return (m_aaLetter < r.m_aaLetter);
}
}
pappso::PeptideIonNter::a
@ a
Definition peptide.h:77
pappso::PeptideIonNter::b
@ b
Definition peptide.h:74

References Aa(), pappso::a, pappso::b, pappso::AaBase::m_aaLetter, and m_listMod.

Referenced by pappso::operator<().

## operator=()

Aa & pappso::Aa::operator= | ( | const Aa & | toCopy | ) |

Definition at line 65 of file aa.cpp.

{
m_aaLetter = toCopy.m_aaLetter;
m_listMod = toCopy.m_listMod;
return *this;
}

References Aa(), pappso::AaBase::m_aaLetter, and m_listMod.

## removeAaModification()

void pappso::Aa::removeAaModification | ( | AaModificationP | aaModification | ) |

Definition at line 177 of file aa.cpp.

{
std::vector<AaModificationP>::iterator it = std::find(m_listMod.begin(), m_listMod.end(), mod);
if(it != m_listMod.end())
{
m_listMod.erase(it);
}
qDebug() << m_listMod << Qt::endl;
}

References m_listMod.

## removeAllButInternalModification()

void pappso::Aa::removeAllButInternalModification | ( |  | ) |

remove all non internal modifications

Definition at line 247 of file aa.cpp.

{
m_listMod.clear();
}

References m_listMod.

## replaceAaModification()

void pappso::Aa::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 199 of file aa.cpp.

{
std::replace(m_listMod.begin(), m_listMod.end(), oldmod, newmod);
sort(m_listMod.begin(), m_listMod.end());
}

References m_listMod.

## toAbsoluteString()

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

Definition at line 104 of file aa.cpp.

{
QString seq = "";
seq += this->getLetter();
auto it(m_listMod.begin());
if(it != m_listMod.end())
{
QStringList modification_str_list;
while(it != m_listMod.end())
{
modification_str_list << (*it)->getAccession();
it++;
}
if(modification_str_list.size() > 0)
seq += QString("(%1)").arg(modification_str_list.join(","));
}
return seq;
}
pappso::AaBase::getLetter
virtual const char & getLetter() const
Definition aabase.cpp:403

References pappso::AaBase::getLetter(), and m_listMod.

## toProForma()

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

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

Returns
  QString as described in ProForma

Definition at line 147 of file aa.cpp.

{
QString seq = "";
seq += this->getLetter();
std::vector<AaModificationP> copy_mod_list = m_listMod;
std::sort(copy_mod_list.begin(),
copy_mod_list.end(),
[](const AaModificationP &a, const AaModificationP &b) {
return a->getAccession() < b->getAccession();
});
auto it(copy_mod_list.begin());
if(it != copy_mod_list.end())
{
QStringList modification_str_list;
while(it != copy_mod_list.end())
{
if(!(*it)->isInternal())
{
modification_str_list << (*it)->toProForma();
}
it++;
}
if(modification_str_list.size() > 0)
seq += QString("[%1]").arg(modification_str_list.join("]["));
}
return seq;
}
pappso::AaModificationP
const AaModification * AaModificationP
Definition aamodification.h:52

References pappso::a, pappso::b, pappso::AaBase::getLetter(), and m_listMod.

## toString()

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

Definition at line 124 of file aa.cpp.

{
QString seq = "";
seq += this->getLetter();
auto it(m_listMod.begin());
if(it != m_listMod.end())
{
QStringList modification_str_list;
while(it != m_listMod.end())
{
if(!(*it)->isInternal())
{
modification_str_list << (*it)->getAccession();
}
it++;
}
if(modification_str_list.size() > 0)
seq += QString("(%1)").arg(modification_str_list.join(","));
}
return seq;
}

References pappso::AaBase::getLetter(), and m_listMod.

## Member Data Documentation

## m_listMod

std::vector<AaModificationP> pappso::Aa::m_listMod

private

Definition at line 98 of file aa.h.

Referenced by Aa(), Aa(), addAaModification(), getMass(), getModificationList(), getNumberOfAtom(), getNumberOfIsotope(), getNumberOfModification(), getTotalModificationMass(), isAaEqual(), isLesser(), operator=(), removeAaModification(), removeAllButInternalModification(), replaceAaModification(), toAbsoluteString(), toProForma(), and toString().

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

- pappsomspp/core/amino_acid/aa.h
- pappsomspp/core/amino_acid/aa.cpp