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

63  {
64  m_mass += it->getMass();
65  it++;
66  i++;
67  }
69  AaModification::getInstance("internal:Nter_hydrolytic_cleavage_H");
70  }
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 
92 

◆ PeptideFragment() [2/3]

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

Definition at line 96 of file peptidefragment.cpp.

99 {
100  switch(direction)
101  {

References pappso::Cter.

◆ PeptideFragment() [3/3]

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

Definition at line 105 of file peptidefragment.cpp.

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

◆ ~PeptideFragment()

pappso::PeptideFragment::~PeptideFragment ( )
virtual

Definition at line 114 of file peptidefragment.cpp.

116 {

References m_size, and msp_peptide.

Member Function Documentation

◆ getMass()

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

Implements pappso::Ion.

Definition at line 231 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 153 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  {
182  std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
183  std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());

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

◆ getPeptideIonDirectionName()

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

Definition at line 119 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
133 {

References m_size.

◆ getPeptideSp()

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

Definition at line 220 of file peptidefragment.cpp.

223 {

References msp_peptide.

◆ getSequence()

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

amino acid sequence without modification

Implements pappso::PeptideInterface.

Definition at line 136 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
148  {
149  std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());

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

◆ size()

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

Implements pappso::PeptideInterface.

Definition at line 225 of file peptidefragment.cpp.

Member Data Documentation

◆ m_direction

const PeptideDirection pappso::PeptideFragment::m_direction
private

Definition at line 96 of file peptidefragment.h.

◆ m_mass

pappso_double pappso::PeptideFragment::m_mass = 0
private

Definition at line 102 of file peptidefragment.h.

◆ m_nterCterCleavage

AaModificationP pappso::PeptideFragment::m_nterCterCleavage
private

Definition at line 100 of file peptidefragment.h.

◆ m_size

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

Definition at line 97 of file peptidefragment.h.

Referenced by getPeptideIonDirectionName(), getSequence(), and ~PeptideFragment().

◆ msp_peptide

const PeptideSp pappso::PeptideFragment::msp_peptide
private

Definition at line 95 of file peptidefragment.h.

Referenced by getPeptideSp(), getSequence(), and ~PeptideFragment().


The documentation for this class was generated from the following files:
pappso::PeptideFragment::msp_peptide
const PeptideSp msp_peptide
Definition: peptidefragment.h:95
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
pappso::PeptideFragment::m_size
const unsigned int m_size
Definition: peptidefragment.h:97
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:186
pappso::Isotope
Isotope
Definition: types.h:112
pappso::AaModification::getNumberOfAtom
int getNumberOfAtom(AtomIsotopeSurvey atom) const override final
get the number of atom C, O, N, H in the molecule
Definition: aamodification.cpp:566
pappso::PeptideFragment::size
virtual unsigned int size() const override
Definition: peptidefragment.cpp:225
pappso::AaModification::getMass
pappso_double getMass() const
Definition: aamodification.cpp:559
pappso::PeptideFragment::getMass
virtual pappso_double getMass() const override
Definition: peptidefragment.cpp:231
pappso::PeptideFragment::getPeptideSp
virtual const PeptideSp & getPeptideSp() const
Definition: peptidefragment.cpp:220
pappso::PeptideFragment::m_mass
pappso_double m_mass
Definition: peptidefragment.h:102
pappso::AaModification::getInstance
static AaModificationP getInstance(const QString &accession)
Definition: aamodification.cpp:388
pappso::PeptideFragment::m_direction
const PeptideDirection m_direction
Definition: peptidefragment.h:96
pappso::PeptideDirection
PeptideDirection
Definition: peptide.h:67
pappso::PeptideDirection::Nter
@ Nter
pappso::PeptideFragment::m_nterCterCleavage
AaModificationP m_nterCterCleavage
Definition: peptidefragment.h:100
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition: aamodification.h:68
pappso::PeptideFragment::getPeptideIonDirection
PeptideDirection getPeptideIonDirection() const
Definition: peptidefragment.cpp:237
pappso::PeptideFragment::getNumberOfAtom
virtual int getNumberOfAtom(AtomIsotopeSurvey atom) const override
get the number of atom C, O, N, H in the molecule
Definition: peptidefragment.cpp:153
pappso::PeptideFragment::PeptideFragment
PeptideFragment(const PeptideSp &sp_peptide, PeptideDirection direction, unsigned int size)
Definition: peptidefragment.cpp:59
pappso::AtomIsotopeSurvey
AtomIsotopeSurvey
Definition: types.h:97
pappso::PeptideDirection::Cter
@ Cter
pappso::PeptideFragment::~PeptideFragment
virtual ~PeptideFragment()
Definition: peptidefragment.cpp:114