pappsomspp
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 66 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 57 of file peptidefragment.cpp.

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  }
71  m_mass += m_nterCterCleavage->getMass();
72 }
73 
74 
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 }
82 
83 
84 PeptideFragment::PeptideFragment(PeptideFragment &&toCopy) // move constructor
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 }
91 

References pappso::Peptide::end(), and pappso::AaModification::getInstance().

◆ PeptideFragment() [2/3]

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

Definition at line 94 of file peptidefragment.cpp.

94 {
95 }
96 
97 const QString
99 {
100  switch(direction)

◆ PeptideFragment() [3/3]

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

Definition at line 103 of file peptidefragment.cpp.

105  :
106  return "Nter";
107  break;
108  default:
109  throw PappsoException(QString("direction name not implemented"));

◆ ~PeptideFragment()

pappso::PeptideFragment::~PeptideFragment ( )
virtual

Definition at line 112 of file peptidefragment.cpp.

Member Function Documentation

◆ getMass()

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

Implements pappso::Ion.

Definition at line 229 of file peptidefragment.cpp.

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

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 }
163 
164 int
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  {

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

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 }
196 
197 
198 const PeptideSp &
200 {
201  return msp_peptide;
202 };
203 unsigned int
204 PeptideFragment::size() const
205 {
206  return m_size;
207 }
208 
211 {
212  return m_mass;
213 }
214 

◆ getPeptideIonDirection()

PeptideDirection pappso::PeptideFragment::getPeptideIonDirection ( ) const

Definition at line 235 of file peptidefragment.cpp.

◆ getPeptideIonDirectionName()

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

Definition at line 117 of file peptidefragment.cpp.

120  {
121  sequence = sequence.mid(0, m_size);
122  }
123  else
124  {
125  sequence = sequence.mid(diffSize, m_size);
126  }
127  return sequence;
128 }
129 
130 
131 int

References m_size.

◆ getPeptideSp()

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

Definition at line 218 of file peptidefragment.cpp.

◆ getSequence()

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

amino acid sequence without modification

Implements pappso::PeptideInterface.

Definition at line 134 of file peptidefragment.cpp.

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

References m_size, and msp_peptide.

◆ isPalindrome()

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

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 241 of file peptidefragment.cpp.

◆ size()

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

Implements pappso::PeptideInterface.

Definition at line 223 of file peptidefragment.cpp.

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

References msp_peptide.

Member Data Documentation

◆ m_direction

const PeptideDirection pappso::PeptideFragment::m_direction
private

Definition at line 94 of file peptidefragment.h.

◆ m_mass

pappso_double pappso::PeptideFragment::m_mass = 0
private

Definition at line 100 of file peptidefragment.h.

◆ m_nterCterCleavage

AaModificationP pappso::PeptideFragment::m_nterCterCleavage
private

Definition at line 98 of file peptidefragment.h.

◆ m_size

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

Definition at line 95 of file peptidefragment.h.

Referenced by getPeptideIonDirectionName(), and getSequence().

◆ msp_peptide

const PeptideSp pappso::PeptideFragment::msp_peptide
private

Definition at line 93 of file peptidefragment.h.

Referenced by getSequence(), and size().


The documentation for this class was generated from the following files:
pappso::PeptideFragment::msp_peptide
const PeptideSp msp_peptide
Definition: peptidefragment.h:93
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:67
pappso::PeptideFragment::m_size
const unsigned int m_size
Definition: peptidefragment.h:95
pappso::PeptideFragment::getNumberOfIsotope
virtual int getNumberOfIsotope(Isotope isotope) const override
get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
Definition: peptidefragment.cpp:184
pappso::Isotope
Isotope
Definition: types.h:109
pappso::PeptideFragment::size
virtual unsigned int size() const override
Definition: peptidefragment.cpp:223
pappso::PeptideFragment::getMass
virtual pappso_double getMass() const override
Definition: peptidefragment.cpp:229
pappso::PeptideFragment::getPeptideSp
virtual const PeptideSp & getPeptideSp() const
Definition: peptidefragment.cpp:218
pappso::PeptideFragment::m_mass
pappso_double m_mass
Definition: peptidefragment.h:100
pappso::PeptideFragment::getPeptideIonDirectionName
static const QString getPeptideIonDirectionName(PeptideDirection direction)
Definition: peptidefragment.cpp:117
pappso::AaModification::getInstance
static AaModificationP getInstance(const QString &accession)
Definition: aamodification.cpp:387
pappso::PeptideFragment::m_direction
const PeptideDirection m_direction
Definition: peptidefragment.h:94
pappso::PeptideDirection
PeptideDirection
Definition: peptide.h:64
pappso::PeptideDirection::Nter
pappso::PeptideFragment::m_nterCterCleavage
AaModificationP m_nterCterCleavage
Definition: peptidefragment.h:98
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition: aamodification.h:66
pappso::PeptideFragment::PeptideFragment
PeptideFragment(const PeptideSp &sp_peptide, PeptideDirection direction, unsigned int size)
Definition: peptidefragment.cpp:57