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

`#include <peptidefragment.h>`

Inheritance diagram for pappso::PeptideFragment:

## Public Member Functions

| PeptideFragment (const PeptideSp &sp_peptide, PeptideDirection direction, unsigned int size)
| PeptideFragment (const PeptideFragment &other)
| PeptideFragment (PeptideFragment &&toCopy)
virtual | ~PeptideFragment ()
virtual const PeptideSp & | getPeptideSp () const
virtual unsigned int | size () const override
virtual const QString | getSequence () const override
| amino acid sequence without modification
virtual pappso_double | getMass () const override
PeptideDirection | getPeptideIonDirection () const
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
virtual bool | isPalindrome () const override
| tells if the peptide sequence is a palindrome
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 ChemicalFormula | getChemicalFormulaCharge (unsigned int charge) 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
Public Member Functions inherited from pappso::AtomNumberInterface
virtual const ChemicalFormula | getChemicalFormula () const

## Static Public Member Functions

static const QString | getPeptideIonDirectionName (PeptideDirection direction)

## Private Attributes

const PeptideSp | msp_peptide
const PeptideDirection | m_direction
const unsigned int | m_size = 0
pappso_double | m_mass = 0

## Detailed Description

Definition at line 47 of file peptidefragment.h.

## Constructor & Destructor Documentation

## PeptideFragment() [1/3]

pappso::PeptideFragment::PeptideFragment | ( | const PeptideSp & | sp_peptide,
|  | PeptideDirection | direction,
|  | unsigned int | size )

Definition at line 38 of file peptidefragment.cpp.

: msp_peptide(sp_peptide), m_direction(direction), m_size(size)
{
if(m_direction == PeptideDirection::Nter)
{
std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
unsigned int i = 0;
while(i < m_size)
{
m_mass += it->getMass();
it++;
i++;
}
if(msp_peptide.get()->getNterModification() != nullptr)
{
m_mass += msp_peptide.get()->getNterModification()->getMass();
}
}
else
{
std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
unsigned int i = 0;
while(i < m_size)
{
m_mass += it->getMass();
it++;
i++;
}
if(msp_peptide.get()->getCterModification() != nullptr)
{
m_mass += msp_peptide.get()->getCterModification()->getMass();
}
}
m_mass += msp_peptide.get()->getCleavageNterModification()->getMass();
m_mass += msp_peptide.get()->getCleavageCterModification()->getMass();
}
pappso::PeptideFragment::m_size
const unsigned int m_size
Definition peptidefragment.h:74
pappso::PeptideFragment::msp_peptide
const PeptideSp msp_peptide
Definition peptidefragment.h:72
pappso::PeptideFragment::size
virtual unsigned int size() const override
Definition peptidefragment.cpp:228
pappso::PeptideFragment::m_mass
pappso_double m_mass
Definition peptidefragment.h:76
pappso::PeptideFragment::m_direction
const PeptideDirection m_direction
Definition peptidefragment.h:73
pappso::PeptideDirection::Nter
@ Nter
Definition peptide.h:48

References getMass(), m_direction, m_mass, m_size, msp_peptide, pappso::Nter, and size().

Referenced by PeptideFragment(), and PeptideFragment().

## PeptideFragment() [2/3]

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

Definition at line 82 of file peptidefragment.cpp.

: msp_peptide(other.msp_peptide), m_direction(other.m_direction), m_size(other.m_size)
{
m_mass = other.m_mass;
}

References PeptideFragment(), m_direction, m_mass, m_size, and msp_peptide.

## PeptideFragment() [3/3]

pappso::PeptideFragment::PeptideFragment | ( | PeptideFragment && | toCopy | ) |

Definition at line 89 of file peptidefragment.cpp.

: msp_peptide(std::move(toCopy.msp_peptide)),
m_direction(toCopy.m_direction),
m_size(toCopy.m_size),
m_mass(toCopy.m_mass)
{
}

References PeptideFragment(), m_direction, m_mass, m_size, and msp_peptide.

## ~PeptideFragment()

pappso::PeptideFragment::~PeptideFragment | ( |  | ) |

virtual

Definition at line 98 of file peptidefragment.cpp.

{
}

## Member Function Documentation

## getMass()

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

override virtual

Implements pappso::Ion.

Definition at line 234 of file peptidefragment.cpp.

{
return m_mass;
}

References m_mass.

Referenced by PeptideFragment().

## getNumberOfAtom()

int pappso::PeptideFragment::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 137 of file peptidefragment.cpp.

{
int number = 0;
if(m_direction == PeptideDirection::Nter)
{
std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
unsigned int i = 0;
while(i < m_size)
{
number += it->getNumberOfAtom(atom);
it++;
i++;
}
if(msp_peptide.get()->getNterModification() != nullptr)
{
number += msp_peptide.get()->getNterModification()->getNumberOfAtom(atom);
}
}
else
{
std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
unsigned int i = 0;
while(i < m_size)
{
number += it->getNumberOfAtom(atom);
it++;
i++;
}
if(msp_peptide.get()->getCterModification() != nullptr)
{
number += msp_peptide.get()->getCterModification()->getNumberOfAtom(atom);
}
}
number += msp_peptide.get()->getCleavageNterModification()->getNumberOfAtom(atom);
number += msp_peptide.get()->getCleavageCterModification()->getNumberOfAtom(atom);
// qDebug() << "Aa::getMass() end " << mass;
return number;
}

References m_direction, m_size, msp_peptide, and pappso::Nter.

## getNumberOfIsotope()

int pappso::PeptideFragment::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 179 of file peptidefragment.cpp.

{
int number = 0;
if(m_direction == PeptideDirection::Nter)
{
std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
unsigned int i = 0;
while(i < m_size)
{
number += it->getNumberOfIsotope(isotope);
it++;
i++;
}
if(msp_peptide.get()->getNterModification() != nullptr)
{
number += msp_peptide.get()->getNterModification()->getNumberOfIsotope(isotope);
}
}
else
{
std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
unsigned int i = 0;
while(i < m_size)
{
number += it->getNumberOfIsotope(isotope);
it++;
i++;
}
if(msp_peptide.get()->getCterModification() != nullptr)
{
number += msp_peptide.get()->getCterModification()->getNumberOfIsotope(isotope);
}
}
number += msp_peptide.get()->getCleavageNterModification()->getNumberOfIsotope(isotope);
number += msp_peptide.get()->getCleavageCterModification()->getNumberOfIsotope(isotope);
// number += m_nterCterCleavage->getNumberOfIsotope(atom);
// qDebug() << "Aa::getMass() end " << mass;
return number;
}

References m_direction, m_size, msp_peptide, and pappso::Nter.

## getPeptideIonDirection()

PeptideDirection pappso::PeptideFragment::getPeptideIonDirection | ( |  | ) | const

Definition at line 240 of file peptidefragment.cpp.

{
return m_direction;
}

References m_direction.

## getPeptideIonDirectionName()

const QString pappso::PeptideFragment::getPeptideIonDirectionName | ( | PeptideDirection | direction | ) |

static

Definition at line 103 of file peptidefragment.cpp.

{
switch(direction)
{
case PeptideDirection::Cter:
return "Cter";
break;
case PeptideDirection::Nter:
return "Nter";
break;
default:
throw PappsoException(QString("direction name not implemented"));
break;
}
}
pappso::PeptideDirection::Cter
@ Cter
Definition peptide.h:49

References pappso::Cter, and pappso::Nter.

Referenced by pappso::PeptideFragmentIon::PeptideFragmentIon(), and pappso::XtandemHyperscore::getXtandemPredictedIonIntensityFactor().

## getPeptideSp()

const PeptideSp & pappso::PeptideFragment::getPeptideSp | ( |  | ) | const

virtual

Definition at line 223 of file peptidefragment.cpp.

{
return msp_peptide;
};

References msp_peptide.

## getSequence()

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

override virtual

amino acid sequence without modification

Implements pappso::PeptideInterface.

Definition at line 120 of file peptidefragment.cpp.

{
QString sequence = msp_peptide.get()->getSequence();
int diffSize = msp_peptide.get()->size() - m_size;
if(m_direction == PeptideDirection::Nter)
{
sequence = sequence.mid(0, m_size);
}
else
{
sequence = sequence.mid(diffSize, m_size);
}
return sequence;
}

References m_direction, m_size, msp_peptide, and pappso::Nter.

## isPalindrome()

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

override virtual

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 246 of file peptidefragment.cpp.

{
return msp_peptide.get()->isPalindrome();
}

References msp_peptide.

## size()

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

override virtual

Implements pappso::PeptideInterface.

Definition at line 228 of file peptidefragment.cpp.

{
return m_size;
}

References m_size.

Referenced by PeptideFragment().

## Member Data Documentation

## m_direction

const PeptideDirection pappso::PeptideFragment::m_direction

private

Definition at line 73 of file peptidefragment.h.

Referenced by PeptideFragment(), PeptideFragment(), PeptideFragment(), getNumberOfAtom(), getNumberOfIsotope(), getPeptideIonDirection(), and getSequence().

## m_mass

pappso_double pappso::PeptideFragment::m_mass = 0

private

Definition at line 76 of file peptidefragment.h.

Referenced by PeptideFragment(), PeptideFragment(), PeptideFragment(), and getMass().

## m_size

const unsigned int pappso::PeptideFragment::m_size = 0

private

Definition at line 74 of file peptidefragment.h.

Referenced by PeptideFragment(), PeptideFragment(), PeptideFragment(), getNumberOfAtom(), getNumberOfIsotope(), getSequence(), and size().

## msp_peptide

const PeptideSp pappso::PeptideFragment::msp_peptide

private

Definition at line 72 of file peptidefragment.h.

Referenced by PeptideFragment(), PeptideFragment(), PeptideFragment(), getNumberOfAtom(), getNumberOfIsotope(), getPeptideSp(), getSequence(), and isPalindrome().

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

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