libpappsomspp
Library for mass spectrometry
pappso::PeptideFragment Class Reference

#include <peptidefragment.h>

Inheritance diagram for pappso::PeptideFragment:
pappso::PeptideInterface pappso::Ion pappso::AtomNumberInterface

Public Member Functions

 PeptideFragment (const PeptideSp &sp_peptide, PeptideDirection direction, unsigned int size)
 
 PeptideFragment (const PeptideFragment &other)
 
 PeptideFragment (PeptideFragment &&toCopy)
 
virtual ~PeptideFragment ()
 
virtual const PeptideSpgetPeptideSp () const
 
virtual unsigned int size () const override
 
virtual const QString getSequence () const override
 amino acid sequence without modification More...
 
virtual pappso_double getMass () const override
 
PeptideDirection getPeptideIonDirection () const
 
virtual int getNumberOfAtom (AtomIsotopeSurvey atom) const override
 get the number of atom C, O, N, H in the molecule More...
 
virtual int getNumberOfIsotope (Isotope isotope) const override
 get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule More...
 
virtual bool isPalindrome () const override
 tells if the peptide sequence is a palindrome More...
 
- Public Member Functions inherited from pappso::PeptideInterface
virtual const QString getSequenceLi () const
 amino acid sequence without modification where L are replaced by I More...
 
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
 

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
 
AaModificationP m_nterCterCleavage
 
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.

41  : msp_peptide(sp_peptide), m_direction(direction), m_size(size)
42 {
44  {
45  std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
46  std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
47  unsigned int i = 0;
48  while(i < m_size)
49  {
50  m_mass += it->getMass();
51  it++;
52  i++;
53  }
55  AaModification::getInstance("internal:Cter_hydrolytic_cleavage_HO");
56  }
57  else
58  {
59  std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
60  std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
61  unsigned int i = 0;
62  while(i < m_size)
63  {
64  m_mass += it->getMass();
65  it++;
66  i++;
67  }
69  AaModification::getInstance("internal:Nter_hydrolytic_cleavage_H");
70  }
72 }
pappso_double getMass() const
static AaModificationP getInstance(const QString &accession)
const unsigned int m_size
const PeptideSp msp_peptide
AaModificationP m_nterCterCleavage
virtual unsigned int size() const override
const PeptideDirection m_direction

References pappso::AaModification::getInstance(), pappso::AaModification::getMass(), m_direction, m_mass, m_nterCterCleavage, m_size, msp_peptide, and pappso::Nter.

◆ PeptideFragment() [2/3]

pappso::PeptideFragment::PeptideFragment ( const PeptideFragment other)

Definition at line 75 of file peptidefragment.cpp.

76  : msp_peptide(other.msp_peptide),
77  m_direction(other.m_direction),
78  m_size(other.m_size)
79 {
80  m_mass = other.m_mass;
81 }

References m_mass.

◆ PeptideFragment() [3/3]

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

Definition at line 84 of file peptidefragment.cpp.

85  : msp_peptide(std::move(toCopy.msp_peptide)),
86  m_direction(toCopy.m_direction),
87  m_size(toCopy.m_size),
88  m_mass(toCopy.m_mass)
89 {
90 }

◆ ~PeptideFragment()

pappso::PeptideFragment::~PeptideFragment ( )
virtual

Definition at line 93 of file peptidefragment.cpp.

94 {
95 }

Member Function Documentation

◆ getMass()

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

Implements pappso::Ion.

Definition at line 210 of file peptidefragment.cpp.

211 {
212  return m_mass;
213 }

References m_mass.

◆ getNumberOfAtom()

int pappso::PeptideFragment::getNumberOfAtom ( AtomIsotopeSurvey  atom) const
overridevirtual

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

Implements pappso::AtomNumberInterface.

Definition at line 132 of file peptidefragment.cpp.

133 {
134  int number = 0;
136  {
137  std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
138  std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
139  unsigned int i = 0;
140  while(i < m_size)
141  {
142  number += it->getNumberOfAtom(atom);
143  it++;
144  i++;
145  }
146  }
147  else
148  {
149  std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
150  std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
151  unsigned int i = 0;
152  while(i < m_size)
153  {
154  number += it->getNumberOfAtom(atom);
155  it++;
156  i++;
157  }
158  }
159  number += m_nterCterCleavage->getNumberOfAtom(atom);
160  // qDebug() << "Aa::getMass() end " << mass;
161  return number;
162 }
int getNumberOfAtom(AtomIsotopeSurvey atom) const override final
get the number of atom C, O, N, H in the molecule

References pappso::AaModification::getNumberOfAtom(), m_direction, m_nterCterCleavage, m_size, msp_peptide, and pappso::Nter.

◆ getNumberOfIsotope()

int pappso::PeptideFragment::getNumberOfIsotope ( Isotope  isotope) const
overridevirtual

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

Implements pappso::AtomNumberInterface.

Definition at line 165 of file peptidefragment.cpp.

166 {
167  int number = 0;
169  {
170  std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
171  std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
172  unsigned int i = 0;
173  while(i < m_size)
174  {
175  number += it->getNumberOfIsotope(isotope);
176  it++;
177  i++;
178  }
179  }
180  else
181  {
182  std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
183  std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
184  unsigned int i = 0;
185  while(i < m_size)
186  {
187  number += it->getNumberOfIsotope(isotope);
188  it++;
189  i++;
190  }
191  }
192  // number += m_nterCterCleavage->getNumberOfIsotope(atom);
193  // qDebug() << "Aa::getMass() end " << mass;
194  return number;
195 }

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

◆ getPeptideIonDirection()

PeptideDirection pappso::PeptideFragment::getPeptideIonDirection ( ) const

Definition at line 216 of file peptidefragment.cpp.

217 {
218  return m_direction;
219 }

References m_direction.

◆ getPeptideIonDirectionName()

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

Definition at line 98 of file peptidefragment.cpp.

99 {
100  switch(direction)
101  {
103  return "Cter";
104  break;
106  return "Nter";
107  break;
108  default:
109  throw PappsoException(QString("direction name not implemented"));
110  break;
111  }
112 }

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 199 of file peptidefragment.cpp.

200 {
201  return msp_peptide;
202 };

References msp_peptide.

◆ getSequence()

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

amino acid sequence without modification

Implements pappso::PeptideInterface.

Definition at line 115 of file peptidefragment.cpp.

116 {
117  QString sequence = msp_peptide.get()->getSequence();
118  int diffSize = msp_peptide.get()->size() - m_size;
120  {
121  sequence = sequence.mid(0, m_size);
122  }
123  else
124  {
125  sequence = sequence.mid(diffSize, m_size);
126  }
127  return sequence;
128 }

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

◆ isPalindrome()

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

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 222 of file peptidefragment.cpp.

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

References msp_peptide.

◆ size()

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

Implements pappso::PeptideInterface.

Definition at line 204 of file peptidefragment.cpp.

205 {
206  return m_size;
207 }

References m_size.

Member Data Documentation

◆ m_direction

const PeptideDirection pappso::PeptideFragment::m_direction
private

◆ m_mass

pappso_double pappso::PeptideFragment::m_mass = 0
private

Definition at line 81 of file peptidefragment.h.

Referenced by PeptideFragment(), and getMass().

◆ m_nterCterCleavage

AaModificationP pappso::PeptideFragment::m_nterCterCleavage
private

Definition at line 79 of file peptidefragment.h.

Referenced by PeptideFragment(), and getNumberOfAtom().

◆ m_size

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

◆ msp_peptide

const PeptideSp pappso::PeptideFragment::msp_peptide
private

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