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
 
const QString getCompletePeptideIonName (unsigned int charge) const
 get a complete ion name string More...
 
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 getSequence () const =0
 amino acid sequence without modification More...
 
virtual bool isPalindrome () const =0
 tells if the peptide sequence is a palindrome More...
 
virtual const QString getSequenceLi () const
 amino acid sequence without modification where L are replaced by I More...
 
virtual unsigned int size () const =0
 
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 getMass () const =0
 
virtual pappso_double getMz (unsigned int charge) const final
 
virtual int getNumberOfAtom (AtomIsotopeSurvey atom) const =0
 get the number of atom C, O, N, H in the molecule More...
 
virtual int getNumberOfIsotope (Isotope isotope) const =0
 get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule More...
 

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}
const QString getPeptideIonName() const
const PeptideFragmentSp msp_fragment
static const QString getPeptideIonDirectionName(PeptideDirection direction)
static pappso_double getDeltaMass(PeptideIon ion_type)
@ y
Cter amino ions.
@ b
Nter acylium ions.
PeptideDirection getPeptideIonDirection(PeptideIon ion_type)
get the direction of a peptide ion
Definition: peptide.cpp:70
PeptideDirection
Definition: peptide.h:46
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
const pappso_double MASSPHOSPHORYLATEDR(MPROTIUM+(MASSOXYGEN *3)+MASSPHOSPHORUS)

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

◆ 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(const PeptideFragmentSp &sp_fragment, PeptideIon ion_type, unsigned int number_of_neutral_phospho_loss)

◆ 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

◆ getCompletePeptideIonName()

const QString pappso::PeptideFragmentIon::getCompletePeptideIonName ( unsigned int  charge) const

get a complete ion name string

Parameters
charge

Definition at line 110 of file peptidefragmention.cpp.

111{
112
113 std::size_t size = msp_fragment.get()->size();
114 QString plusstr = "+";
115 plusstr = plusstr.repeated(charge);
117 {
118 return QString("y%1(-P%2)%3")
119 .arg(size)
121 .arg(plusstr);
122 }
123 else if(m_ionType == PeptideIon::bp)
124 {
125 return QString("b%1(-P%2)%3")
126 .arg(size)
128 .arg(plusstr);
129 }
130
131 return QString("%1%2%3")
133 .arg(size)
134 .arg(plusstr);
135}
virtual unsigned int size() const override

References pappso::bp, getPeptideIonName(), m_ionType, m_neutralPhosphoLossNumber, msp_fragment, size(), and pappso::yp.

◆ getMass()

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

Implements pappso::Ion.

Definition at line 581 of file peptidefragmention.cpp.

582{
583 return m_mass;
584}

References m_mass.

◆ getName()

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

Reimplemented from pappso::PeptideInterface.

Definition at line 575 of file peptidefragmention.cpp.

576{
577 return QString("%1-%2").arg(getPeptideIonName(m_ionType)).arg(size());
578}

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 259 of file peptidefragmention.cpp.

260{
261 int number = msp_fragment.get()->getNumberOfAtom(atom);
262 int diff = 0;
263 switch(atom)
264 {
266 switch(m_ionType)
267 {
268 case PeptideIon::y:
269 break;
270 case PeptideIon::yp:
271 // H 1 O 3 P 1 + H 2 0
272 break;
274 // m_mass -= MASSNH3;
275 break;
276 case PeptideIon::yo:
277 // m_mass -= MASSH2O;
278 break;
280 // m_mass -= MASSH2O;
281 // m_mass -= MASSNH3;
282 break;
283 case PeptideIon::bo:
284 // m_mass -= MASSH2O;
285 // m_mass -= MASSH2O;
286 break;
287 case PeptideIon::a:
288 // m_mass -= MASSH2O;
289 // m_mass -= MASSCO;
290 diff = -1;
291 break;
292 case PeptideIon::c:
293 // m_mass += MASSNH3;
294 break;
295 // SvgIon.moxygen - mN
296 case PeptideIon::z:
297 // m_mass -= MASSH2O;
298 // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
299 break;
300 case PeptideIon::b:
301 // m_mass -= MASSH2O;
302 break;
303 case PeptideIon::bp:
304 // H 1 O 3 P 1 + H 2 0
305 break;
306
308 // m_mass -= MASSH2O;
309 // m_mass = - MASSCO - MASSNH3;
310 diff = -1;
311 break;
312 case PeptideIon::ao:
313 // m_mass -= MASSH2O;
314 // m_mass = - MASSCO - MASSH2O;
315 diff = -1;
316 break;
317 case PeptideIon::x:
318 // +MASSCO + MASSOXYGEN
319 diff = +1;
320 break;
321 default:
322 throw PappsoException(QString("PeptideIon name not implemented"));
323 break;
324 }
325 break;
327 switch(m_ionType)
328 {
329 case PeptideIon::y:
330 break;
331 case PeptideIon::yp:
332 // H 1 O 3 P 1 + H 2 0
333 diff = -3 * m_neutralPhosphoLossNumber;
334 break;
336 // m_mass -= MASSNH3;
337 diff = -3;
338 break;
339 case PeptideIon::yo:
340 // m_mass -= MASSH2O;
341 diff = -2;
342 break;
344 // m_mass -= MASSH2O;
345 // m_mass -= MASSNH3;
346 diff = -5;
347 break;
348 case PeptideIon::bo:
349 // m_mass -= MASSH2O;
350 // m_mass -= MASSH2O;
351 diff = -4;
352 break;
353 case PeptideIon::a:
354 // m_mass -= MASSH2O;
355 // m_mass -= MASSCO;
356 diff = -2;
357 break;
358 case PeptideIon::c:
359 // m_mass += MASSNH3;
360 diff = -3;
361 break;
362 // SvgIon.moxygen - mN
363 case PeptideIon::z:
364 // m_mass -= MASSH2O;
365 // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
366 diff = -3;
367 break;
368 case PeptideIon::b:
369 // m_mass -= MASSH2O;
370 diff = -2;
371 break;
372 case PeptideIon::bp:
373 // H 1 O 3 P 1 + H 2 0
374 diff = -3 * m_neutralPhosphoLossNumber;
375 break;
376
377
379 // m_mass -= MASSH2O;
380 // m_mass = - MASSCO - MASSNH3;
381 diff = -5;
382 break;
383 case PeptideIon::ao:
384 // m_mass -= MASSH2O;
385 // m_mass = - MASSCO - MASSH2O;
386 diff = -4;
387 break;
388 case PeptideIon::x:
389 // +MASSCO + MASSOXYGEN
390 diff = -2;
391 break;
392 default:
393 throw PappsoException(QString("PeptideIon name not implemented"));
394 break;
395 }
396 break;
398 switch(m_ionType)
399 {
400 case PeptideIon::y:
401 break;
402 case PeptideIon::yp:
403 // H 1 O 3 P 1 + H 2 0
404 break;
405
407 // m_mass -= MASSNH3;
408 diff = -1;
409 break;
410 case PeptideIon::yo:
411 // m_mass -= MASSH2O;
412 break;
414 // m_mass -= MASSH2O;
415 // m_mass -= MASSNH3;
416 diff = -1;
417 break;
418 case PeptideIon::bo:
419 // m_mass -= MASSH2O;
420 // m_mass -= MASSH2O;
421 break;
422 case PeptideIon::a:
423 // m_mass -= MASSH2O;
424 // m_mass -= MASSCO;
425 break;
426 case PeptideIon::c:
427 // m_mass += MASSNH3;
428 diff = -1;
429 break;
430 // SvgIon.moxygen - mN
431 case PeptideIon::z:
432 // m_mass -= MASSH2O;
433 // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
434 diff = -1;
435 break;
436 case PeptideIon::b:
437 // m_mass -= MASSH2O;
438 break;
439 case PeptideIon::bp:
440 // H 1 O 3 P 1 + H 2 0
441 break;
442
443
445 // m_mass -= MASSH2O;
446 // m_mass = - MASSCO - MASSNH3;
447 diff = -1;
448 break;
449 case PeptideIon::ao:
450 // m_mass -= MASSH2O;
451 // m_mass = - MASSCO - MASSH2O;
452 break;
453 case PeptideIon::x:
454 // +MASSCO + MASSOXYGEN
455 break;
456 default:
457 throw PappsoException(QString("PeptideIon name not implemented"));
458 break;
459 }
460 break;
462 switch(m_ionType)
463 {
464 case PeptideIon::y:
465 break;
466 case PeptideIon::yp:
467 // H 1 O 3 P 1 + H 2 0
468 diff = -4 * m_neutralPhosphoLossNumber;
469 break;
470
472 // m_mass -= MASSNH3;
473 break;
474 case PeptideIon::yo:
475 // m_mass -= MASSH2O;
476 diff = -1;
477 break;
479 // m_mass -= MASSH2O;
480 // m_mass -= MASSNH3;
481 diff = -1;
482 break;
483 case PeptideIon::bo:
484 // m_mass -= MASSH2O;
485 // m_mass -= MASSH2O;
486 diff = -2;
487 break;
488 case PeptideIon::a:
489 // m_mass -= MASSH2O;
490 // m_mass -= MASSCO;
491 diff = -2;
492 break;
493 case PeptideIon::c:
494 // m_mass += MASSNH3;
495 break;
496 // SvgIon.moxygen - mN
497 case PeptideIon::z:
498 // m_mass -= MASSH2O;
499 // m_mass += MASSOXYGEN - MASSNITROGEN - MPROTIUM;
500 diff = -2;
501 break;
502 case PeptideIon::b:
503 // m_mass -= MASSH2O;
504 diff = -1;
505 break;
506 case PeptideIon::bp:
507 // H 1 O 3 P 1 + H 2 0
508 diff = -4 * m_neutralPhosphoLossNumber;
509 break;
510
511
513 // m_mass -= MASSH2O;
514 // m_mass = - MASSCO - MASSNH3;
515 diff = -2;
516 break;
517 case PeptideIon::ao:
518 // m_mass -= MASSH2O;
519 // m_mass = - MASSCO - MASSH2O;
520 diff = -3;
521 break;
522 case PeptideIon::x:
523 // +MASSCO + MASSOXYGEN
524 diff = +1;
525 break;
526 default:
527 throw PappsoException(
528 QObject::tr("PeptideIon name not implemented"));
529 break;
530 }
531 break;
533 break;
534 default:
535 qDebug() << "PeptideFragmentIon::getNumberOfAtom(AtomIsotopeSurvey "
536 "atom) NOT IMPLEMENTED";
537 }
538 return number + diff;
539}
@ a
Nter aldimine ions.
@ c
Nter amino ions.
@ astar
Nter aldimine ions + NH3 loss.
@ ystar
Cter amino ions + NH3 loss.
@ yo
Cter amino ions + H2O loss.
@ bstar
Nter acylium ions + NH3 loss.
@ x
Cter acylium ions.
@ bo
Nter acylium ions + H2O loss.
@ ao
Nter aldimine ions + H2O loss.
@ z
Cter carbocations.

References pappso::a, pappso::ao, pappso::astar, pappso::b, pappso::bo, pappso::bp, pappso::bstar, pappso::C, pappso::c, pappso::H, m_ionType, m_neutralPhosphoLossNumber, msp_fragment, pappso::N, pappso::O, pappso::S, pappso::x, pappso::y, pappso::yo, pappso::yp, pappso::ystar, and pappso::z.

◆ 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 543 of file peptidefragmention.cpp.

544{
545 int number = msp_fragment.get()->getNumberOfIsotope(isotope);
546 return number;
547}

References msp_fragment.

◆ getNumberOfNeutralPhosphoLoss()

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

Definition at line 597 of file peptidefragmention.cpp.

598{
600}

References m_neutralPhosphoLossNumber.

◆ getPeptideFragmentSp()

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

Definition at line 569 of file peptidefragmention.cpp.

570{
571 return msp_fragment;
572}

References msp_fragment.

◆ getPeptideIonColor()

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

Definition at line 204 of file peptidefragmention.cpp.

205{
206 switch(m_ionType)
207 {
208 case PeptideIon::y:
209 return QColor("red");
210 break;
211 case PeptideIon::yp:
212 return QColor("red");
213 break;
215 return QColor("red");
216 break;
217 case PeptideIon::yo:
218 return QColor("orange");
219 break;
220 case PeptideIon::x:
221 return QColor("orange");
222 break;
224 return QColor("blue");
225 break;
226 case PeptideIon::bo:
227 return QColor("#ff00ff");
228 break;
229 case PeptideIon::a:
230 return QColor("green");
231 break;
233 return QColor("green");
234 break;
235 case PeptideIon::ao:
236 return QColor("green");
237 break;
238 case PeptideIon::c:
239 return QColor("blue");
240 break;
241 // SvgIon.moxygen - mN
242 case PeptideIon::z:
243 return QColor("red");
244 break;
245 case PeptideIon::b:
246 return QColor("blue");
247 break;
248 case PeptideIon::bp:
249 return QColor("blue");
250 break;
251 default:
252 throw PappsoException(QString("PeptideIon color not implemented %1")
254 break;
255 }
256}

References pappso::a, pappso::ao, pappso::astar, pappso::b, pappso::bo, pappso::bp, pappso::bstar, pappso::c, getPeptideIonName(), m_ionType, pappso::x, pappso::y, pappso::yo, pappso::yp, pappso::ystar, and pappso::z.

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

◆ getPeptideIonDirection() [1/2]

PeptideDirection pappso::PeptideFragmentIon::getPeptideIonDirection ( ) const

Definition at line 592 of file peptidefragmention.cpp.

593{
594 return msp_fragment.get()->getPeptideIonDirection();
595}

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

◆ getPeptideIonName() [2/2]

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

Definition at line 150 of file peptidefragmention.cpp.

151{
152 switch(m_ionType)
153 {
154 case PeptideIon::y:
155 return "y";
156 break;
157 case PeptideIon::yp:
158 return "yP";
159 break;
161 return "y*";
162 break;
163 case PeptideIon::yo:
164 return "yO";
165 break;
167 return "b*";
168 break;
169 case PeptideIon::bo:
170 return "bO";
171 break;
172 case PeptideIon::a:
173 return "a";
174 break;
176 return "a*";
177 break;
178 case PeptideIon::ao:
179 return "aO";
180 break;
181 case PeptideIon::c:
182 return "c";
183 break;
184 // SvgIon.moxygen - mN
185 case PeptideIon::z:
186 return "z";
187 break;
188 case PeptideIon::b:
189 return "b";
190 break;
191 case PeptideIon::bp:
192 return "bP";
193 break;
194 case PeptideIon::x:
195 return "x";
196 break;
197 default:
198 throw PappsoException(QString("PeptideIon name not implemented"));
199 break;
200 }
201}

References pappso::a, pappso::ao, pappso::astar, pappso::b, pappso::bo, pappso::bp, pappso::bstar, pappso::c, m_ionType, pappso::x, pappso::y, pappso::yo, pappso::yp, pappso::ystar, and pappso::z.

◆ getPeptideIonType()

PeptideIon pappso::PeptideFragmentIon::getPeptideIonType ( ) const

Definition at line 587 of file peptidefragmention.cpp.

588{
589 return m_ionType;
590}

References m_ionType.

◆ getSequence()

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

amino acid sequence without modification

Implements pappso::PeptideInterface.

Definition at line 563 of file peptidefragmention.cpp.

564{
565 return msp_fragment.get()->getSequence();
566}

References msp_fragment.

◆ isPalindrome()

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

tells if the peptide sequence is a palindrome

Implements pappso::PeptideInterface.

Definition at line 603 of file peptidefragmention.cpp.

604{
605 return msp_fragment.get()->isPalindrome();
606}

References msp_fragment.

◆ makePeptideFragmentIonSp()

PeptideFragmentIonSp pappso::PeptideFragmentIon::makePeptideFragmentIonSp ( ) const

Definition at line 550 of file peptidefragmention.cpp.

551{
552 return std::make_shared<PeptideFragmentIon>(*this);
553}

◆ size()

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

Implements pappso::PeptideInterface.

Definition at line 557 of file peptidefragmention.cpp.

558{
559 return msp_fragment.get()->size();
560}

References msp_fragment.

Referenced by getCompletePeptideIonName(), and 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 98 of file peptidefragmention.h.

Referenced by PeptideFragmentIon(), and getMass().

◆ m_neutralPhosphoLossNumber

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

◆ msp_fragment


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