libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
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
 
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.

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 }
54
55 if(msp_peptide.get()->getNterModification() != nullptr)
56 {
57 m_mass += msp_peptide.get()->getNterModification()->getMass();
58 }
59 }
60 else
61 {
62 std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
63 std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
64 unsigned int i = 0;
65 while(i < m_size)
66 {
67 m_mass += it->getMass();
68 it++;
69 i++;
70 }
71 if(msp_peptide.get()->getCterModification() != nullptr)
72 {
73 m_mass += msp_peptide.get()->getCterModification()->getMass();
74 }
75 }
76
77 m_mass += msp_peptide.get()->getCleavageNterModification()->getMass();
78 m_mass += msp_peptide.get()->getCleavageCterModification()->getMass();
79}
const unsigned int m_size
const PeptideSp msp_peptide
virtual unsigned int size() const override
const PeptideDirection m_direction

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.

83 : msp_peptide(other.msp_peptide), m_direction(other.m_direction), m_size(other.m_size)
84{
85 m_mass = other.m_mass;
86}

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.

90 : msp_peptide(std::move(toCopy.msp_peptide)),
91 m_direction(toCopy.m_direction),
92 m_size(toCopy.m_size),
93 m_mass(toCopy.m_mass)
94{
95}

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

◆ ~PeptideFragment()

pappso::PeptideFragment::~PeptideFragment ( )
virtual

Definition at line 98 of file peptidefragment.cpp.

99{
100}

Member Function Documentation

◆ getMass()

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

Implements pappso::Ion.

Definition at line 234 of file peptidefragment.cpp.

235{
236 return m_mass;
237}

References m_mass.

Referenced by PeptideFragment().

◆ getNumberOfAtom()

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

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

Implements pappso::AtomNumberInterface.

Definition at line 137 of file peptidefragment.cpp.

138{
139 int number = 0;
141 {
142 std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
143 std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
144 unsigned int i = 0;
145 while(i < m_size)
146 {
147 number += it->getNumberOfAtom(atom);
148 it++;
149 i++;
150 }
151 if(msp_peptide.get()->getNterModification() != nullptr)
152 {
153 number += msp_peptide.get()->getNterModification()->getNumberOfAtom(atom);
154 }
155 }
156 else
157 {
158 std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
159 std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
160 unsigned int i = 0;
161 while(i < m_size)
162 {
163 number += it->getNumberOfAtom(atom);
164 it++;
165 i++;
166 }
167 if(msp_peptide.get()->getCterModification() != nullptr)
168 {
169 number += msp_peptide.get()->getCterModification()->getNumberOfAtom(atom);
170 }
171 }
172 number += msp_peptide.get()->getCleavageNterModification()->getNumberOfAtom(atom);
173 number += msp_peptide.get()->getCleavageCterModification()->getNumberOfAtom(atom);
174 // qDebug() << "Aa::getMass() end " << mass;
175 return number;
176}

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

◆ getNumberOfIsotope()

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

180{
181 int number = 0;
183 {
184 std::vector<Aa>::const_iterator it(msp_peptide.get()->begin());
185 std::vector<Aa>::const_iterator end(msp_peptide.get()->end());
186 unsigned int i = 0;
187 while(i < m_size)
188 {
189 number += it->getNumberOfIsotope(isotope);
190 it++;
191 i++;
192 }
193 if(msp_peptide.get()->getNterModification() != nullptr)
194 {
195 number += msp_peptide.get()->getNterModification()->getNumberOfIsotope(isotope);
196 }
197 }
198 else
199 {
200 std::vector<Aa>::const_reverse_iterator it(msp_peptide.get()->rbegin());
201 std::vector<Aa>::const_reverse_iterator end(msp_peptide.get()->rend());
202 unsigned int i = 0;
203 while(i < m_size)
204 {
205 number += it->getNumberOfIsotope(isotope);
206 it++;
207 i++;
208 }
209 if(msp_peptide.get()->getCterModification() != nullptr)
210 {
211 number += msp_peptide.get()->getCterModification()->getNumberOfIsotope(isotope);
212 }
213 }
214 number += msp_peptide.get()->getCleavageNterModification()->getNumberOfIsotope(isotope);
215 number += msp_peptide.get()->getCleavageCterModification()->getNumberOfIsotope(isotope);
216 // number += m_nterCterCleavage->getNumberOfIsotope(atom);
217 // qDebug() << "Aa::getMass() end " << mass;
218 return number;
219}

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

◆ getPeptideIonDirection()

PeptideDirection pappso::PeptideFragment::getPeptideIonDirection ( ) const

Definition at line 240 of file peptidefragment.cpp.

241{
242 return m_direction;
243}

References m_direction.

◆ getPeptideIonDirectionName()

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

Definition at line 103 of file peptidefragment.cpp.

104{
105 switch(direction)
106 {
108 return "Cter";
109 break;
111 return "Nter";
112 break;
113 default:
114 throw PappsoException(QString("direction name not implemented"));
115 break;
116 }
117}

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.

224{
225 return msp_peptide;
226};

References msp_peptide.

◆ getSequence()

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

amino acid sequence without modification

Implements pappso::PeptideInterface.

Definition at line 120 of file peptidefragment.cpp.

121{
122 QString sequence = msp_peptide.get()->getSequence();
123 int diffSize = msp_peptide.get()->size() - m_size;
125 {
126 sequence = sequence.mid(0, m_size);
127 }
128 else
129 {
130 sequence = sequence.mid(diffSize, m_size);
131 }
132 return sequence;
133}

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

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

References msp_peptide.

◆ size()

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

Implements pappso::PeptideInterface.

Definition at line 228 of file peptidefragment.cpp.

229{
230 return m_size;
231}

References m_size.

Referenced by PeptideFragment().

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 76 of file peptidefragment.h.

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

◆ 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: