libpappsomspp
Library for mass spectrometry
pappso::PeptideFragmentIon Class Reference

#include <peptidefragmention.h>

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

Public Member Functions

 PeptideFragmentIon (const PeptideFragmentSp &sp_fragment, PeptideIon ion_type, unsigned int number_of_neutral_phospho_loss)
 
 PeptideFragmentIon (const PeptideFragmentSp &sp_fragment, PeptideIon ion_type)
 
 PeptideFragmentIon (const PeptideFragmentIon &other)
 
 PeptideFragmentIon (PeptideFragmentIon &&toCopy)
 
virtual ~PeptideFragmentIon ()
 
PeptideFragmentIonSp makePeptideFragmentIonSp () const
 
virtual unsigned int size () const override
 
virtual const QString getSequence () const override
 amino acid sequence without modification More...
 
virtual const PeptideFragmentSpgetPeptideFragmentSp () 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 const QString getName () const override
 
pappso_double getMass () const override
 
const QString getPeptideIonName () const
 
PeptideIon getPeptideIonType () const
 
PeptideDirection getPeptideIonDirection () const
 
unsigned int getNumberOfNeutralPhosphoLoss () const
 
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 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 PeptideDirection getPeptideIonDirection (PeptideIon ion_type)
 
static const QString getPeptideIonName (PeptideIon ion_type)
 
static const QColor getPeptideIonColor (PeptideIon ion_type)
 

Private Attributes

const PeptideFragmentSp msp_fragment
 
const PeptideIon m_ionType
 
pappso_double m_mass = 0
 
unsigned int m_neutralPhosphoLossNumber = 0
 

Detailed Description

Definition at line 49 of file peptidefragmention.h.

Constructor & Destructor Documentation

◆ PeptideFragmentIon() [1/4]

pappso::PeptideFragmentIon::PeptideFragmentIon ( const PeptideFragmentSp sp_fragment,
PeptideIon  ion_type,
unsigned int  number_of_neutral_phospho_loss 
)

Definition at line 45 of file peptidefragmention.cpp.

49  : msp_fragment(sp_fragment), m_ionType(ion_type)
50 {
51  m_mass = msp_fragment.get()->getMass();
52  PeptideDirection direction = msp_fragment.get()->getPeptideIonDirection();
54  {
55  throw PappsoException(
56  QString("PeptideIon %1 is not an %2 fragment")
59  }
60  m_mass -= MASSH2O;
61  switch(m_ionType)
62  {
63  // -MASSH2O
64  case PeptideIon::yp:
65  m_neutralPhosphoLossNumber = number_of_neutral_phospho_loss;
66  m_mass -=
68  ion_type = PeptideIon::y;
69  break;
70  case PeptideIon::bp:
71  m_neutralPhosphoLossNumber = number_of_neutral_phospho_loss;
72  m_mass -=
74  ion_type = PeptideIon::b;
75  break;
76  default:
77  break;
78  }
80 }

References pappso::PeptideRawFragmentMasses::getDeltaMass(), pappso::getPeptideIonDirection(), pappso::PeptideFragment::getPeptideIonDirectionName(), getPeptideIonName(), m_ionType, m_mass, m_neutralPhosphoLossNumber, pappso::MASSH2O(), pappso::MASSPHOSPHORYLATEDR(), msp_fragment, and pappso::y.

◆ PeptideFragmentIon() [2/4]

pappso::PeptideFragmentIon::PeptideFragmentIon ( const PeptideFragmentSp sp_fragment,
PeptideIon  ion_type 
)

Definition at line 39 of file peptidefragmention.cpp.

41  : PeptideFragmentIon(sp_fragment, ion_type, 0)
42 {
43 }

◆ PeptideFragmentIon() [3/4]

pappso::PeptideFragmentIon::PeptideFragmentIon ( const PeptideFragmentIon other)

Definition at line 82 of file peptidefragmention.cpp.

83  : msp_fragment(other.msp_fragment), m_ionType(other.m_ionType)
84 {
85  m_mass = other.m_mass;
86 }

References m_mass.

◆ PeptideFragmentIon() [4/4]

pappso::PeptideFragmentIon::PeptideFragmentIon ( PeptideFragmentIon &&  toCopy)

Definition at line 89 of file peptidefragmention.cpp.

91  : msp_fragment(std::move(toCopy.msp_fragment)),
92  m_ionType(toCopy.m_ionType),
93  m_mass(toCopy.m_mass)
94 {
95 }

◆ ~PeptideFragmentIon()

pappso::PeptideFragmentIon::~PeptideFragmentIon ( )
virtual

Definition at line 97 of file peptidefragmention.cpp.

98 {
99 }

Member Function Documentation

◆ getMass()

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

Implements pappso::Ion.

Definition at line 550 of file peptidefragmention.cpp.

551 {
552  return m_mass;
553 }

References m_mass.

◆ getName()

const QString pappso::PeptideFragmentIon::getName ( ) const
overridevirtual

Reimplemented from pappso::PeptideInterface.

Definition at line 544 of file peptidefragmention.cpp.

545 {
546  return QString("%1-%2").arg(getPeptideIonName(m_ionType)).arg(size());
547 }

References getPeptideIonName(), m_ionType, and size().

◆ getNumberOfAtom()

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

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

Implements pappso::AtomNumberInterface.

Definition at line 228 of file peptidefragmention.cpp.

229 {
230  int number = msp_fragment.get()->getNumberOfAtom(atom);
231  int diff = 0;
232  switch(atom)
233  {
234  case AtomIsotopeSurvey::C:
235  switch(m_ionType)
236  {
237  case PeptideIon::y:
238  break;
239  case PeptideIon::yp:
240  // H 1 O 3 P 1 + H 2 0
241  break;
242  case PeptideIon::ystar:
243  // m_mass -= MASSNH3;
244  break;
245  case PeptideIon::yo:
246  // m_mass -= MASSH2O;
247  break;
248  case PeptideIon::bstar:
249  // m_mass -= MASSH2O;
250  // m_mass -= MASSNH3;
251  break;
252  case PeptideIon::bo:
253  // m_mass -= MASSH2O;
254  // m_mass -= MASSH2O;
255  break;
256  case PeptideIon::a:
257  // m_mass -= MASSH2O;
258  // m_mass -= MASSCO;
259  diff = -1;
260  break;
261  case PeptideIon::c:
262  // m_mass += MASSNH3;
263  break;
264  // SvgIon.moxygen - mN
265  case PeptideIon::z:
266  // m_mass -= MASSH2O;
267  // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
268  break;
269  case PeptideIon::b:
270  // m_mass -= MASSH2O;
271  break;
272  case PeptideIon::bp:
273  // H 1 O 3 P 1 + H 2 0
274  break;
275 
276  case PeptideIon::astar:
277  // m_mass -= MASSH2O;
278  // m_mass = - MASSCO - MASSNH3;
279  diff = -1;
280  break;
281  case PeptideIon::ao:
282  // m_mass -= MASSH2O;
283  // m_mass = - MASSCO - MASSH2O;
284  diff = -1;
285  break;
286  case PeptideIon::x:
287  // +MASSCO + MASSOXYGEN
288  diff = +1;
289  break;
290  default:
291  throw PappsoException(QString("PeptideIon name not implemented"));
292  break;
293  }
294  break;
295  case AtomIsotopeSurvey::H:
296  switch(m_ionType)
297  {
298  case PeptideIon::y:
299  break;
300  case PeptideIon::yp:
301  // H 1 O 3 P 1 + H 2 0
302  diff = -3 * m_neutralPhosphoLossNumber;
303  break;
304  case PeptideIon::ystar:
305  // m_mass -= MASSNH3;
306  diff = -3;
307  break;
308  case PeptideIon::yo:
309  // m_mass -= MASSH2O;
310  diff = -2;
311  break;
312  case PeptideIon::bstar:
313  // m_mass -= MASSH2O;
314  // m_mass -= MASSNH3;
315  diff = -5;
316  break;
317  case PeptideIon::bo:
318  // m_mass -= MASSH2O;
319  // m_mass -= MASSH2O;
320  diff = -4;
321  break;
322  case PeptideIon::a:
323  // m_mass -= MASSH2O;
324  // m_mass -= MASSCO;
325  diff = -2;
326  break;
327  case PeptideIon::c:
328  // m_mass += MASSNH3;
329  diff = -3;
330  break;
331  // SvgIon.moxygen - mN
332  case PeptideIon::z:
333  // m_mass -= MASSH2O;
334  // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
335  diff = -3;
336  break;
337  case PeptideIon::b:
338  // m_mass -= MASSH2O;
339  diff = -2;
340  break;
341  case PeptideIon::bp:
342  // H 1 O 3 P 1 + H 2 0
343  diff = -3 * m_neutralPhosphoLossNumber;
344  break;
345 
346 
347  case PeptideIon::astar:
348  // m_mass -= MASSH2O;
349  // m_mass = - MASSCO - MASSNH3;
350  diff = -5;
351  break;
352  case PeptideIon::ao:
353  // m_mass -= MASSH2O;
354  // m_mass = - MASSCO - MASSH2O;
355  diff = -4;
356  break;
357  case PeptideIon::x:
358  // +MASSCO + MASSOXYGEN
359  diff = -2;
360  break;
361  default:
362  throw PappsoException(QString("PeptideIon name not implemented"));
363  break;
364  }
365  break;
366  case AtomIsotopeSurvey::N:
367  switch(m_ionType)
368  {
369  case PeptideIon::y:
370  break;
371  case PeptideIon::yp:
372  // H 1 O 3 P 1 + H 2 0
373  break;
374 
375  case PeptideIon::ystar:
376  // m_mass -= MASSNH3;
377  diff = -1;
378  break;
379  case PeptideIon::yo:
380  // m_mass -= MASSH2O;
381  break;
382  case PeptideIon::bstar:
383  // m_mass -= MASSH2O;
384  // m_mass -= MASSNH3;
385  diff = -1;
386  break;
387  case PeptideIon::bo:
388  // m_mass -= MASSH2O;
389  // m_mass -= MASSH2O;
390  break;
391  case PeptideIon::a:
392  // m_mass -= MASSH2O;
393  // m_mass -= MASSCO;
394  break;
395  case PeptideIon::c:
396  // m_mass += MASSNH3;
397  diff = -1;
398  break;
399  // SvgIon.moxygen - mN
400  case PeptideIon::z:
401  // m_mass -= MASSH2O;
402  // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
403  diff = -1;
404  break;
405  case PeptideIon::b:
406  // m_mass -= MASSH2O;
407  break;
408  case PeptideIon::bp:
409  // H 1 O 3 P 1 + H 2 0
410  break;
411 
412 
413  case PeptideIon::astar:
414  // m_mass -= MASSH2O;
415  // m_mass = - MASSCO - MASSNH3;
416  diff = -1;
417  break;
418  case PeptideIon::ao:
419  // m_mass -= MASSH2O;
420  // m_mass = - MASSCO - MASSH2O;
421  break;
422  case PeptideIon::x:
423  // +MASSCO + MASSOXYGEN
424  break;
425  default:
426  throw PappsoException(QString("PeptideIon name not implemented"));
427  break;
428  }
429  break;
430  case AtomIsotopeSurvey::O:
431  switch(m_ionType)
432  {
433  case PeptideIon::y:
434  break;
435  case PeptideIon::yp:
436  // H 1 O 3 P 1 + H 2 0
437  diff = -4 * m_neutralPhosphoLossNumber;
438  break;
439 
440  case PeptideIon::ystar:
441  // m_mass -= MASSNH3;
442  break;
443  case PeptideIon::yo:
444  // m_mass -= MASSH2O;
445  diff = -1;
446  break;
447  case PeptideIon::bstar:
448  // m_mass -= MASSH2O;
449  // m_mass -= MASSNH3;
450  diff = -1;
451  break;
452  case PeptideIon::bo:
453  // m_mass -= MASSH2O;
454  // m_mass -= MASSH2O;
455  diff = -2;
456  break;
457  case PeptideIon::a:
458  // m_mass -= MASSH2O;
459  // m_mass -= MASSCO;
460  diff = -2;
461  break;
462  case PeptideIon::c:
463  // m_mass += MASSNH3;
464  break;
465  // SvgIon.moxygen - mN
466  case PeptideIon::z:
467  // m_mass -= MASSH2O;
468  // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
469  diff = -2;
470  break;
471  case PeptideIon::b:
472  // m_mass -= MASSH2O;
473  diff = -1;
474  break;
475  case PeptideIon::bp:
476  // H 1 O 3 P 1 + H 2 0
477  diff = -4 * m_neutralPhosphoLossNumber;
478  break;
479 
480 
481  case PeptideIon::astar:
482  // m_mass -= MASSH2O;
483  // m_mass = - MASSCO - MASSNH3;
484  diff = -2;
485  break;
486  case PeptideIon::ao:
487  // m_mass -= MASSH2O;
488  // m_mass = - MASSCO - MASSH2O;
489  diff = -3;
490  break;
491  case PeptideIon::x:
492  // +MASSCO + MASSOXYGEN
493  diff = +1;
494  break;
495  default:
496  throw PappsoException(
497  QObject::tr("PeptideIon name not implemented"));
498  break;
499  }
500  break;
501  case AtomIsotopeSurvey::S:
502  break;
503  default:
504  qDebug() << "PeptideFragmentIon::getNumberOfAtom(AtomIsotopeSurvey "
505  "atom) NOT IMPLEMENTED";
506  }
507  return number + diff;
508 }

References m_ionType, m_neutralPhosphoLossNumber, msp_fragment, pappso::x, and pappso::y.

◆ getNumberOfIsotope()

int pappso::PeptideFragmentIon::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 512 of file peptidefragmention.cpp.

513 {
514  int number = msp_fragment.get()->getNumberOfIsotope(isotope);
515  return number;
516 }

References msp_fragment.

◆ getNumberOfNeutralPhosphoLoss()

unsigned int pappso::PeptideFragmentIon::getNumberOfNeutralPhosphoLoss ( ) const

Definition at line 566 of file peptidefragmention.cpp.

567 {
569 }

References m_neutralPhosphoLossNumber.

◆ getPeptideFragmentSp()

const PeptideFragmentSp & pappso::PeptideFragmentIon::getPeptideFragmentSp ( ) const
virtual

Definition at line 538 of file peptidefragmention.cpp.

539 {
540  return msp_fragment;
541 }

References msp_fragment.

◆ getPeptideIonColor()

const QColor pappso::PeptideFragmentIon::getPeptideIonColor ( PeptideIon  ion_type)
static

Definition at line 173 of file peptidefragmention.cpp.

174 {
175  switch(m_ionType)
176  {
177  case PeptideIon::y:
178  return QColor("red");
179  break;
180  case PeptideIon::yp:
181  return QColor("red");
182  break;
183  case PeptideIon::ystar:
184  return QColor("red");
185  break;
186  case PeptideIon::yo:
187  return QColor("orange");
188  break;
189  case PeptideIon::x:
190  return QColor("orange");
191  break;
192  case PeptideIon::bstar:
193  return QColor("blue");
194  break;
195  case PeptideIon::bo:
196  return QColor("#ff00ff");
197  break;
198  case PeptideIon::a:
199  return QColor("green");
200  break;
201  case PeptideIon::astar:
202  return QColor("green");
203  break;
204  case PeptideIon::ao:
205  return QColor("green");
206  break;
207  case PeptideIon::c:
208  return QColor("blue");
209  break;
210  // SvgIon.moxygen - mN
211  case PeptideIon::z:
212  return QColor("red");
213  break;
214  case PeptideIon::b:
215  return QColor("blue");
216  break;
217  case PeptideIon::bp:
218  return QColor("blue");
219  break;
220  default:
221  throw PappsoException(QString("PeptideIon color not implemented %1")
223  break;
224  }
225 }

References getPeptideIonName(), m_ionType, pappso::x, and pappso::y.

Referenced by pappso::QCPSpectrum::QCPSpectrum(), and pappso::MassSpectrumWidget::plot().

◆ getPeptideIonDirection() [1/2]

PeptideDirection pappso::PeptideFragmentIon::getPeptideIonDirection ( ) const

Definition at line 561 of file peptidefragmention.cpp.

562 {
563  return msp_fragment.get()->getPeptideIonDirection();
564 }

References msp_fragment.

◆ getPeptideIonDirection() [2/2]

PeptideDirection pappso::PeptideFragmentIon::getPeptideIonDirection ( PeptideIon  ion_type)
static

Definition at line 103 of file peptidefragmention.cpp.

104 {
105  return pappso::getPeptideIonDirection(ion_type);
106 }

References pappso::getPeptideIonDirection().

◆ getPeptideIonName() [1/2]

const QString pappso::PeptideFragmentIon::getPeptideIonName ( ) const

Definition at line 109 of file peptidefragmention.cpp.

110 {
111  if((m_ionType == PeptideIon::yp) || (m_ionType == PeptideIon::bp))
112  {
114  }
116 }

References m_ionType, and m_neutralPhosphoLossNumber.

Referenced by PeptideFragmentIon(), getName(), pappso::PeptideFragmentIonListBase::getPeptideFragmentIonSp(), and getPeptideIonColor().

◆ getPeptideIonName() [2/2]

const QString pappso::PeptideFragmentIon::getPeptideIonName ( PeptideIon  ion_type)
static

Definition at line 119 of file peptidefragmention.cpp.

120 {
121  switch(m_ionType)
122  {
123  case PeptideIon::y:
124  return "y";
125  break;
126  case PeptideIon::yp:
127  return "yP";
128  break;
129  case PeptideIon::ystar:
130  return "y*";
131  break;
132  case PeptideIon::yo:
133  return "yO";
134  break;
135  case PeptideIon::bstar:
136  return "b*";
137  break;
138  case PeptideIon::bo:
139  return "bO";
140  break;
141  case PeptideIon::a:
142  return "a";
143  break;
144  case PeptideIon::astar:
145  return "a*";
146  break;
147  case PeptideIon::ao:
148  return "aO";
149  break;
150  case PeptideIon::c:
151  return "c";
152  break;
153  // SvgIon.moxygen - mN
154  case PeptideIon::z:
155  return "z";
156  break;
157  case PeptideIon::b:
158  return "b";
159  break;
160  case PeptideIon::bp:
161  return "bP";
162  break;
163  case PeptideIon::x:
164  return "x";
165  break;
166  default:
167  throw PappsoException(QString("PeptideIon name not implemented"));
168  break;
169  }
170 }

References m_ionType, pappso::x, and pappso::y.

◆ getPeptideIonType()

PeptideIon pappso::PeptideFragmentIon::getPeptideIonType ( ) const

Definition at line 556 of file peptidefragmention.cpp.

557 {
558  return m_ionType;
559 }

References m_ionType.

◆ getSequence()

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

amino acid sequence without modification

Implements pappso::PeptideInterface.

Definition at line 532 of file peptidefragmention.cpp.

533 {
534  return msp_fragment.get()->getSequence();
535 }

References msp_fragment.

◆ isPalindrome()

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

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 572 of file peptidefragmention.cpp.

573 {
574  return msp_fragment.get()->isPalindrome();
575 }

References msp_fragment.

◆ makePeptideFragmentIonSp()

PeptideFragmentIonSp pappso::PeptideFragmentIon::makePeptideFragmentIonSp ( ) const

Definition at line 519 of file peptidefragmention.cpp.

520 {
521  return std::make_shared<PeptideFragmentIon>(*this);
522 }

◆ size()

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

Implements pappso::PeptideInterface.

Definition at line 526 of file peptidefragmention.cpp.

527 {
528  return msp_fragment.get()->size();
529 }

References msp_fragment.

Referenced by getName().

Member Data Documentation

◆ m_ionType

const PeptideIon pappso::PeptideFragmentIon::m_ionType
private

◆ m_mass

pappso_double pappso::PeptideFragmentIon::m_mass = 0
private

Definition at line 92 of file peptidefragmention.h.

Referenced by PeptideFragmentIon(), and getMass().

◆ m_neutralPhosphoLossNumber

unsigned int pappso::PeptideFragmentIon::m_neutralPhosphoLossNumber = 0
private

◆ msp_fragment

const PeptideFragmentSp pappso::PeptideFragmentIon::msp_fragment
private

The documentation for this class was generated from the following files:
pappso::PeptideFragmentIon::size
virtual unsigned int size() const override
Definition: peptidefragmention.cpp:526
pappso::PeptideRawFragmentMasses::getDeltaMass
static pappso_double getDeltaMass(PeptideIon ion_type)
Definition: peptiderawfragmentmasses.cpp:56
pappso::PeptideIon::x
@ x
Cter acylium ions.
pappso::PeptideFragmentIon::getPeptideIonName
const QString getPeptideIonName() const
Definition: peptidefragmention.cpp:109
pappso::PeptideFragmentIon::msp_fragment
const PeptideFragmentSp msp_fragment
Definition: peptidefragmention.h:89
pappso::PeptideFragmentIon::m_mass
pappso_double m_mass
Definition: peptidefragmention.h:92
pappso::PeptideFragment::getPeptideIonDirectionName
static const QString getPeptideIonDirectionName(PeptideDirection direction)
Definition: peptidefragment.cpp:98
pappso::MASSPHOSPHORYLATEDR
const pappso_double MASSPHOSPHORYLATEDR(MPROTIUM+(MASSOXYGEN *3)+MASSPHOSPHORUS)
pappso::PeptideFragmentIon::m_ionType
const PeptideIon m_ionType
Definition: peptidefragmention.h:90
pappso::getPeptideIonDirection
PeptideDirection getPeptideIonDirection(PeptideIon ion_type)
get the direction of a peptide ion
Definition: peptide.cpp:54
pappso::PeptideDirection
PeptideDirection
Definition: peptide.h:46
pappso::PeptideFragmentIon::PeptideFragmentIon
PeptideFragmentIon(const PeptideFragmentSp &sp_fragment, PeptideIon ion_type, unsigned int number_of_neutral_phospho_loss)
Definition: peptidefragmention.cpp:45
pappso::MASSH2O
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
pappso::PeptideIon::y
@ y
Cter amino ions.
pappso::PeptideFragmentIon::m_neutralPhosphoLossNumber
unsigned int m_neutralPhosphoLossNumber
Definition: peptidefragmention.h:96