libpappsomspp
Library for mass spectrometry
pappso::AaModification Class Reference

#include <aamodification.h>

Inheritance diagram for pappso::AaModification:
pappso::AtomNumberInterface

Public Member Functions

 AaModification (AaModification &&toCopy)
 
const QString & getAccession () const
 
const QString & getName () const
 
 ~AaModification ()
 
pappso_double getMass () const
 
int getNumberOfAtom (AtomIsotopeSurvey atom) const override final
 get the number of atom C, O, N, H in the molecule More...
 
int getNumberOfIsotope (Isotope isotope) const override final
 get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule More...
 
bool isInternal () const
 
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 AaModificationP getInstance (const QString &accession)
 
static AaModificationP getInstance (const OboPsiModTerm &oboterm)
 
static AaModificationP getInstanceMutation (const QChar &mut_from, const QChar &mut_to)
 get a fake modification coding a mutation from an amino acid to an other More...
 
static AaModificationP getInstanceXtandemMod (const QString &type, pappso_double mass, const PeptideSp &peptide_sp, unsigned int position)
 
static AaModificationP getInstanceCustomizedMod (pappso_double modificationMass)
 

Protected Member Functions

void setDiffFormula (const QString &diff_formula)
 
void setXrefOrigin (const QString &origin)
 set list of amino acid on which this modification takes place More...
 

Protected Attributes

const QString m_accession
 
QString m_name
 

Private Types

using MapAccessionModifications = std::map< QString, AaModificationP >
 

Private Member Functions

 AaModification (const QString &accession, pappso_double mass)
 
void calculateMassFromChemicalComponents ()
 

Static Private Member Functions

static AaModificationP createInstance (const QString &saccession)
 
static AaModificationP createInstance (const OboPsiModTerm &term)
 
static AaModificationP createInstanceMutation (const Aa &aa_from, const Aa &aa_to)
 

Private Attributes

pappso_double m_mass
 
QString m_origin
 
std::map< AtomIsotopeSurvey, int > m_atomCount
 
std::map< Isotope, int > m_mapIsotope
 

Static Private Attributes

static MapAccessionModifications m_mapAccessionModifications
 
static QMutex m_mutex
 

Detailed Description

Definition at line 56 of file aamodification.h.

Member Typedef Documentation

◆ MapAccessionModifications

Definition at line 112 of file aamodification.h.

Constructor & Destructor Documentation

◆ AaModification() [1/2]

pappso::AaModification::AaModification ( AaModification &&  toCopy)

Definition at line 76 of file aamodification.cpp.

77 : m_accession(toCopy.m_accession),
78 m_name(toCopy.m_name),
79 m_mass(toCopy.m_mass),
80 m_atomCount(std::move(toCopy.m_atomCount)),
81 m_mapIsotope(toCopy.m_mapIsotope)
82{
83 m_origin = toCopy.m_origin;
84}
std::map< Isotope, int > m_mapIsotope
std::map< AtomIsotopeSurvey, int > m_atomCount
const QString m_accession

References m_origin.

Referenced by createInstance(), createInstanceMutation(), and getInstanceCustomizedMod().

◆ ~AaModification()

pappso::AaModification::~AaModification ( )

Definition at line 86 of file aamodification.cpp.

87{
88}

◆ AaModification() [2/2]

Member Function Documentation

◆ calculateMassFromChemicalComponents()

void pappso::AaModification::calculateMassFromChemicalComponents ( )
private

Definition at line 295 of file aamodification.cpp.

296{
297 pappso_double theoreticalm_mass = 0;
298 std::map<AtomIsotopeSurvey, int>::const_iterator it_atom =
300 if(it_atom != m_atomCount.end())
301 {
302 theoreticalm_mass += MASSCARBON * (it_atom->second);
303 }
304 it_atom = m_atomCount.find(AtomIsotopeSurvey::H);
305 if(it_atom != m_atomCount.end())
306 {
307 theoreticalm_mass += MPROTIUM * (it_atom->second);
308 }
309
310 it_atom = m_atomCount.find(AtomIsotopeSurvey::O);
311 if(it_atom != m_atomCount.end())
312 {
313 theoreticalm_mass += MASSOXYGEN * (it_atom->second);
314 }
315
316 it_atom = m_atomCount.find(AtomIsotopeSurvey::N);
317 if(it_atom != m_atomCount.end())
318 {
319 theoreticalm_mass += MASSNITROGEN * (it_atom->second);
320 }
321 it_atom = m_atomCount.find(AtomIsotopeSurvey::S);
322 if(it_atom != m_atomCount.end())
323 {
324 theoreticalm_mass += MASSSULFUR * (it_atom->second);
325 }
326
327 qDebug() << theoreticalm_mass;
328
329 theoreticalm_mass += DIFFC12C13 * m_mapIsotope.at(Isotope::C13);
330 theoreticalm_mass += DIFFH1H2 * m_mapIsotope.at(Isotope::H2);
331 theoreticalm_mass += DIFFN14N15 * m_mapIsotope.at(Isotope::N15);
332 theoreticalm_mass += DIFFO16O17 * m_mapIsotope.at(Isotope::O17);
333 theoreticalm_mass += DIFFO16O18 * m_mapIsotope.at(Isotope::O18);
334 theoreticalm_mass += DIFFS32S33 * m_mapIsotope.at(Isotope::S33);
335 theoreticalm_mass += DIFFS32S34 * m_mapIsotope.at(Isotope::S34);
336 theoreticalm_mass += DIFFS32S36 * m_mapIsotope.at(Isotope::S36);
337
338
339 pappso_double diff = std::fabs((pappso_double)m_mass - theoreticalm_mass);
340 if(diff < 0.001)
341 {
342 m_mass = theoreticalm_mass;
343 qDebug() << diff;
344 }
345 else
346 {
347 qDebug()
348 << "ERROR in AaModification::calculateMassFromChemicalComponents theo="
349 << theoreticalm_mass << " m=" << m_mass << " diff=" << diff
350 << " accession=" << m_accession;
351 }
352}
const pappso_double DIFFS32S33(32.9714589101 - MASSSULFUR)
const pappso_double DIFFS32S34(33.9678670300 - MASSSULFUR)
const pappso_double DIFFO16O17(16.99913150 - MASSOXYGEN)
const pappso_double MASSCARBON(12)
const pappso_double MASSSULFUR(31.9720711741)
const pappso_double DIFFS32S36(35.9670812000 - MASSSULFUR)
double pappso_double
A type definition for doubles.
Definition: types.h:49
const pappso_double MPROTIUM(1.007825032241)
const pappso_double MASSNITROGEN(14.0030740048)
const pappso_double MASSOXYGEN(15.99491461956)
const pappso_double DIFFO16O18(17.9991610 - MASSOXYGEN)
const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN)
const pappso_double DIFFC12C13(1.0033548378)
const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM)

References pappso::C, pappso::C13, pappso::DIFFC12C13(), pappso::DIFFH1H2(), pappso::DIFFN14N15(), pappso::DIFFO16O17(), pappso::DIFFO16O18(), pappso::DIFFS32S33(), pappso::DIFFS32S34(), pappso::DIFFS32S36(), pappso::H, pappso::H2, m_accession, m_atomCount, m_mapIsotope, m_mass, pappso::MASSCARBON(), pappso::MASSNITROGEN(), pappso::MASSOXYGEN(), pappso::MASSSULFUR(), pappso::MPROTIUM(), pappso::N, pappso::N15, pappso::O, pappso::O17, pappso::O18, pappso::S, pappso::S33, pappso::S34, and pappso::S36.

Referenced by setDiffFormula().

◆ createInstance() [1/2]

AaModificationP pappso::AaModification::createInstance ( const OboPsiModTerm term)
staticprivate

Definition at line 112 of file aamodification.cpp.

113{
114 AaModification *new_mod;
115 // qDebug() << " AaModification::createInstance begin";
116 new_mod = new AaModification(term.m_accession, term.m_diffMono);
117 // xref: DiffFormula: "C 0 H 0 N 0 O 1 S 0"
118 new_mod->setDiffFormula(term.m_diffFormula);
119 new_mod->setXrefOrigin(term.m_origin);
120 new_mod->m_name = term.m_name;
121 return new_mod;
122}
AaModification(AaModification &&toCopy)

References AaModification(), pappso::OboPsiModTerm::m_accession, pappso::OboPsiModTerm::m_diffFormula, pappso::OboPsiModTerm::m_diffMono, m_name, pappso::OboPsiModTerm::m_name, pappso::OboPsiModTerm::m_origin, setDiffFormula(), and setXrefOrigin().

◆ createInstance() [2/2]

AaModificationP pappso::AaModification::createInstance ( const QString &  saccession)
staticprivate

Definition at line 125 of file aamodification.cpp.

126{
127 if(accession == "internal:Nter_hydrolytic_cleavage_H")
128 {
129 OboPsiModTerm term;
130 term.m_accession = accession;
131 term.m_diffFormula = "H 1";
132 term.m_diffMono = MPROTIUM;
133 term.m_name = "Nter hydrolytic cleavage H+";
134 return (AaModification::createInstance(term));
135 }
136 if(accession == "internal:Cter_hydrolytic_cleavage_HO")
137 {
138 OboPsiModTerm term;
139 term.m_accession = accession;
140 term.m_diffFormula = "H 1 O 1";
141 term.m_diffMono = MPROTIUM + MASSOXYGEN;
142 term.m_name = "Cter hydrolytic cleavage HO";
143 return (AaModification::createInstance(term));
144 }
145 if(accession.startsWith("MUTATION:"))
146 {
147 QRegularExpression regexp_mutation("^MUTATION:([A-Z])=>([A-Z])$");
148 QRegularExpressionMatch match = regexp_mutation.match(accession);
149 if(match.hasMatch())
150 {
151 qDebug() << match.capturedTexts()[1].at(0) << " "
152 << match.capturedTexts()[2].at(0);
153
154 Aa aa_from(match.capturedTexts()[1].toStdString().c_str()[0]);
155 Aa aa_to(match.capturedTexts()[2].toStdString().c_str()[0]);
156 AaModificationP instance_mutation =
157 createInstanceMutation(aa_from, aa_to);
158 return instance_mutation;
159 // m_psiModLabel<<"|";
160 }
161 }
162 // initMyResource();
163 FilterOboPsiModSink term_list;
164 FilterOboPsiModTermAccession filterm_accession(term_list, accession);
165
166 OboPsiMod psimod(filterm_accession);
167
168 try
169 {
170 return (AaModification::createInstance(term_list.getOne()));
171 }
172 catch(ExceptionNotFound &e)
173 {
174 throw ExceptionNotFound(QObject::tr("modification not found : [%1]\n%2")
175 .arg(accession)
176 .arg(e.qwhat()));
177 }
178}
static AaModificationP createInstance(const QString &saccession)
static AaModificationP createInstanceMutation(const Aa &aa_from, const Aa &aa_to)
const AaModification * AaModificationP

References createInstance(), createInstanceMutation(), pappso::FilterOboPsiModSink::getOne(), pappso::OboPsiModTerm::m_accession, pappso::OboPsiModTerm::m_diffFormula, pappso::OboPsiModTerm::m_diffMono, pappso::OboPsiModTerm::m_name, pappso::MASSOXYGEN(), pappso::MPROTIUM(), and pappso::PappsoException::qwhat().

Referenced by createInstance(), and getInstance().

◆ createInstanceMutation()

AaModificationP pappso::AaModification::createInstanceMutation ( const Aa aa_from,
const Aa aa_to 
)
staticprivate

Definition at line 588 of file aamodification.cpp.

589{
590 QString accession(
591 QString("MUTATION:%1=>%2").arg(aa_from.getLetter()).arg(aa_to.getLetter()));
592 double diffMono = aa_to.getMass() - aa_from.getMass();
593 // not found
594 AaModification *instance_mutation;
595 // qDebug() << " AaModification::createInstance begin";
596 instance_mutation = new AaModification(accession, diffMono);
597 // xref: DiffFormula: "C 0 H 0 N 0 O 1 S 0"
598
599 for(std::int8_t atomInt = (std::int8_t)AtomIsotopeSurvey::C;
600 atomInt != (std::int8_t)AtomIsotopeSurvey::last;
601 atomInt++)
602 {
603 AtomIsotopeSurvey atom = static_cast<AtomIsotopeSurvey>(atomInt);
604 instance_mutation->m_atomCount[atom] =
605 aa_to.getNumberOfAtom(atom) - aa_from.getNumberOfAtom(atom);
606 }
607 instance_mutation->m_name = QString("mutation from %1 to %2")
608 .arg(aa_from.getLetter())
609 .arg(aa_to.getLetter());
610 return instance_mutation;
611}
AtomIsotopeSurvey
Definition: types.h:77

References AaModification(), pappso::C, pappso::AaBase::getLetter(), pappso::Aa::getMass(), pappso::Aa::getNumberOfAtom(), pappso::last, m_atomCount, and m_name.

Referenced by createInstance(), and getInstanceMutation().

◆ getAccession()

const QString & pappso::AaModification::getAccession ( ) const

◆ getInstance() [1/2]

AaModificationP pappso::AaModification::getInstance ( const OboPsiModTerm oboterm)
static

Definition at line 420 of file aamodification.cpp.

421{
422
423 QMutexLocker locker(&m_mutex);
424 MapAccessionModifications::iterator it =
425 m_mapAccessionModifications.find(oboterm.m_accession);
426 if(it == m_mapAccessionModifications.end())
427 {
428 // not found
429 std::pair<MapAccessionModifications::iterator, bool> insert_res =
430 m_mapAccessionModifications.insert(std::pair<QString, AaModificationP>(
431 oboterm.m_accession, AaModification::createInstance(oboterm)));
432 it = insert_res.first;
433 }
434 else
435 {
436 // found
437 }
438 return it->second;
439}
static MapAccessionModifications m_mapAccessionModifications

References createInstance(), pappso::OboPsiModTerm::m_accession, m_mapAccessionModifications, and m_mutex.

◆ getInstance() [2/2]

AaModificationP pappso::AaModification::getInstance ( const QString &  accession)
static

Definition at line 375 of file aamodification.cpp.

376{
377 try
378 {
379 QMutexLocker locker(&m_mutex);
380 MapAccessionModifications::iterator it =
381 m_mapAccessionModifications.find(accession);
382 if(it == m_mapAccessionModifications.end())
383 {
384
385 // not found
386 std::pair<MapAccessionModifications::iterator, bool> insert_res =
388 std::pair<QString, AaModificationP>(
389 accession, AaModification::createInstance(accession)));
390 it = insert_res.first;
391 }
392 else
393 {
394 // found
395 }
396 return it->second;
397 }
398 catch(ExceptionNotFound &e)
399 {
400 throw ExceptionNotFound(
401 QObject::tr("ERROR getting instance of : %1 NOT FOUND\n%2")
402 .arg(accession)
403 .arg(e.qwhat()));
404 }
405 catch(PappsoException &e)
406 {
407 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
408 .arg(accession)
409 .arg(e.qwhat()));
410 }
411 catch(std::exception &e)
412 {
413 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
414 .arg(accession)
415 .arg(e.what()));
416 }
417}

References createInstance(), m_mapAccessionModifications, m_mutex, pappso::PappsoException::qwhat(), and pappso::PappsoException::what().

Referenced by pappso::Peptide::Peptide(), pappso::PeptideFragment::PeptideFragment(), pappso::PeptideFragmentIonListBase::PeptideFragmentIonListBase(), getInstanceXtandemMod(), pappso::PeptideModificatorPipeline::parseFixedModification(), pappso::PeptideModificatorPipeline::parseLabeledModification(), pappso::PeptideModificatorPipeline::parsePotentialModification(), and pappso::PeptideStrParser::parseStringToPeptide().

◆ getInstanceCustomizedMod()

AaModificationP pappso::AaModification::getInstanceCustomizedMod ( pappso_double  modificationMass)
static

Definition at line 355 of file aamodification.cpp.

356{
357 QString accession = QString("%1").arg(modificationMass);
358 qDebug() << accession;
359 QMutexLocker locker(&m_mutex);
360 if(m_mapAccessionModifications.find(accession) ==
362 {
363 // not found
364 m_mapAccessionModifications.insert(std::pair<QString, AaModification *>(
365 accession, new AaModification(accession, modificationMass)));
366 }
367 else
368 {
369 // found
370 }
371 return m_mapAccessionModifications.at(accession);
372}

References AaModification(), m_mapAccessionModifications, and m_mutex.

Referenced by pappso::PeptideStrParser::parseStringToPeptide().

◆ getInstanceMutation()

AaModificationP pappso::AaModification::getInstanceMutation ( const QChar &  mut_from,
const QChar &  mut_to 
)
static

get a fake modification coding a mutation from an amino acid to an other

Parameters
mut_fromorginal amino acid
mut_totargeted amino acid

Definition at line 615 of file aamodification.cpp.

616{
617 QString accession(QString("MUTATION:%1=>%2").arg(mut_from).arg(mut_to));
618 try
619 {
620 QMutexLocker locker(&m_mutex);
621 MapAccessionModifications::iterator it =
622 m_mapAccessionModifications.find(accession);
623 if(it == m_mapAccessionModifications.end())
624 {
625 Aa aa_from(mut_from.toLatin1());
626 Aa aa_to(mut_to.toLatin1());
627 AaModificationP instance_mutation =
628 createInstanceMutation(aa_from, aa_to);
629
630 std::pair<MapAccessionModifications::iterator, bool> insert_res =
632 std::pair<QString, AaModificationP>(accession,
633 instance_mutation));
634 it = insert_res.first;
635 }
636 else
637 {
638 // found
639 }
640 return it->second;
641 }
642 catch(ExceptionNotFound &e)
643 {
644 throw ExceptionNotFound(
645 QObject::tr("ERROR getting instance of : %1 NOT FOUND\n%2")
646 .arg(accession)
647 .arg(e.qwhat()));
648 }
649 catch(PappsoException &e)
650 {
651 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
652 .arg(accession)
653 .arg(e.qwhat()));
654 }
655 catch(std::exception &e)
656 {
657 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
658 .arg(accession)
659 .arg(e.what()));
660 }
661} // namespace pappso

References createInstanceMutation(), m_mapAccessionModifications, m_mutex, pappso::PappsoException::qwhat(), and pappso::PappsoException::what().

◆ getInstanceXtandemMod()

AaModificationP pappso::AaModification::getInstanceXtandemMod ( const QString &  type,
pappso_double  mass,
const PeptideSp peptide_sp,
unsigned int  position 
)
static

Definition at line 443 of file aamodification.cpp.

447{
449 if(MzRange(mass, precision).contains(getInstance("MOD:00719")->getMass()))
450 {
451 if(type == "M")
452 {
453 return getInstance("MOD:00719");
454 }
455 if(type == "K")
456 {
457 return getInstance("MOD:01047");
458 }
459 }
460 // accession== "MOD:00057"
461 if(MzRange(mass, precision).contains(getInstance("MOD:00408")->getMass()))
462 {
463 // id: MOD:00394
464 // name: acetylated residue
465 // potential N-terminus modifications
466 if(position == 0)
467 {
468 return getInstance("MOD:00408");
469 }
470 }
471 if(MzRange(mass, precision).contains(getInstance("MOD:01160")->getMass()))
472 {
473 //-17.02655
474 // loss of ammonia [MOD:01160] -17.026549
475 return getInstance("MOD:01160");
476 }
477
478 if(MzRange(mass, precision).contains(getInstance("MOD:01060")->getMass()))
479 {
480 //// iodoacetamide [MOD:00397] 57.021464
481 if(type == "C")
482 {
483 return getInstance("MOD:01060");
484 }
485 else
486 {
487 return getInstance("MOD:00397");
488 }
489 }
490 if(MzRange(mass, precision).contains(getInstance("MOD:00704")->getMass()))
491 {
492 // loss of water
493 /*
494 if (position == 0) {
495 if (peptide_sp.get()->getSequence().startsWith("EG")) {
496 return getInstance("MOD:00365");
497 }
498 if (peptide_sp.get()->getSequence().startsWith("ES")) {
499 return getInstance("MOD:00953");
500 }
501 if (type == "E") {
502 return getInstance("MOD:00420");
503 }
504 }
505 */
506 // dehydrated residue [MOD:00704] -18.010565
507 return getInstance("MOD:00704");
508 }
509 if(MzRange(mass, precision).contains(getInstance("MOD:00696")->getMass()))
510 {
511 // phosphorylated residue [MOD:00696] 79.966330
512 return getInstance("MOD:00696");
513 }
514 bool isCter = false;
515 if(peptide_sp.get()->size() == (position + 1))
516 {
517 isCter = true;
518 }
519 if((position == 0) || isCter)
520 {
521 if(MzRange(mass, precision).contains(getInstance("MOD:00429")->getMass()))
522 {
523 // dimethyl
524 return getInstance("MOD:00429");
525 }
526 if(MzRange(mass, precision).contains(getInstance("MOD:00552")->getMass()))
527 {
528 // 4x(2)H labeled dimethyl residue
529 return getInstance("MOD:00552");
530 }
531 if(MzRange(mass, precision).contains(getInstance("MOD:00638")->getMass()))
532 {
533 // 2x(13)C,6x(2)H-dimethylated arginine
534 return getInstance("MOD:00638");
535 }
536 }
537 throw PappsoException(
538 QObject::tr("tandem modification not found : %1 %2 %3 %4")
539 .arg(type)
540 .arg(mass)
541 .arg(peptide_sp.get()->getSequence())
542 .arg(position));
543}
pappso_double getMass() const
static AaModificationP getInstance(const QString &accession)
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
Definition: precision.cpp:130
const PrecisionBase * PrecisionPtr
Definition: precision.h:122

References pappso::PrecisionFactory::getDaltonInstance(), getInstance(), and getMass().

◆ getMass()

pappso_double pappso::AaModification::getMass ( ) const

◆ getName()

const QString & pappso::AaModification::getName ( ) const

Definition at line 99 of file aamodification.cpp.

100{
101 return m_name;
102}

References m_name.

◆ getNumberOfAtom()

int pappso::AaModification::getNumberOfAtom ( AtomIsotopeSurvey  atom) const
finaloverridevirtual

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

Implements pappso::AtomNumberInterface.

Definition at line 553 of file aamodification.cpp.

554{
555 // qDebug() << "AaModification::getNumberOfAtom(AtomIsotopeSurvey atom) NOT
556 // IMPLEMENTED";
557 return m_atomCount.at(atom);
558}

References m_atomCount.

Referenced by pappso::PeptideFragment::getNumberOfAtom().

◆ getNumberOfIsotope()

int pappso::AaModification::getNumberOfIsotope ( Isotope  isotope) const
finaloverridevirtual

get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule

Implements pappso::AtomNumberInterface.

Definition at line 562 of file aamodification.cpp.

563{
564 try
565 {
566 return m_mapIsotope.at(isotope);
567 }
568 catch(std::exception &e)
569 {
570 throw PappsoException(
571 QObject::tr("ERROR in AaModification::getNumberOfIsotope %2")
572 .arg(e.what()));
573 }
574}

References m_mapIsotope.

◆ isInternal()

bool pappso::AaModification::isInternal ( ) const

Definition at line 578 of file aamodification.cpp.

579{
580 if(m_accession.startsWith("internal:"))
581 {
582 return true;
583 }
584 return false;
585}

References m_accession.

◆ setDiffFormula()

void pappso::AaModification::setDiffFormula ( const QString &  diff_formula)
protected

Definition at line 188 of file aamodification.cpp.

189{
190 QRegularExpression rx("(^|\\s)([C,H,O,N,H,S])\\s([-]{0,1}\\d+)");
191 QRegularExpressionMatchIterator i = rx.globalMatch(diff_formula);
192
193 while(i.hasNext())
194 {
195 QRegularExpressionMatch match = i.next();
196
197 qDebug() << match.captured(2) << " " << match.captured(2) << " "
198 << match.captured(3);
199
200 if(match.captured(2) == "C")
201 {
202 m_atomCount[AtomIsotopeSurvey::C] = match.captured(3).toInt();
203 }
204 else if(match.captured(2) == "H")
205 {
206 m_atomCount[AtomIsotopeSurvey::H] = match.captured(3).toInt();
207 }
208 else if(match.captured(2) == "N")
209 {
210 m_atomCount[AtomIsotopeSurvey::N] = match.captured(3).toInt();
211 }
212 else if(match.captured(2) == "O")
213 {
214 m_atomCount[AtomIsotopeSurvey::O] = match.captured(3).toInt();
215 }
216 else if(match.captured(2) == "S")
217 {
218 m_atomCount[AtomIsotopeSurvey::S] = match.captured(3).toInt();
219 }
220 }
221
222 // look for isotopes :
223 rx.setPattern("\\(([-]{0,1}\\d+)\\)([C,H,O,N,H,S])\\s([-]{0,1}\\d+)");
224
225 i = rx.globalMatch(diff_formula);
226
227 while(i.hasNext())
228 {
229 QRegularExpressionMatch match = i.next();
230
231 qDebug() << match.captured(1) << " " << match.captured(2) << " "
232 << match.captured(3);
233
234 int number_of_isotopes = match.captured(3).toInt();
235
236 if(match.captured(2) == "C")
237 {
238 if(match.captured(1) == "13")
239 {
240 m_mapIsotope.at(Isotope::C13) = number_of_isotopes;
241 }
242 m_atomCount[AtomIsotopeSurvey::C] += number_of_isotopes;
243 }
244 else if(match.captured(2) == "H")
245 {
246 if(match.captured(1) == "2")
247 {
248 m_mapIsotope.at(Isotope::H2) = number_of_isotopes;
249 }
250 m_atomCount[AtomIsotopeSurvey::H] += number_of_isotopes;
251 }
252 else if(match.captured(2) == "N")
253 {
254 if(match.captured(1) == "15")
255 {
256 m_mapIsotope.at(Isotope::N15) = number_of_isotopes;
257 }
258 m_atomCount[AtomIsotopeSurvey::N] += number_of_isotopes;
259 }
260 else if(match.captured(2) == "O")
261 {
262 if(match.captured(1) == "17")
263 {
264 m_mapIsotope.at(Isotope::O17) = number_of_isotopes;
265 }
266 else if(match.captured(1) == "18")
267 {
268 m_mapIsotope.at(Isotope::O18) = number_of_isotopes;
269 }
270 m_atomCount[AtomIsotopeSurvey::O] += number_of_isotopes;
271 }
272 else if(match.captured(2) == "S")
273 {
274 if(match.captured(1) == "33")
275 {
276 m_mapIsotope.at(Isotope::S33) = number_of_isotopes;
277 }
278 else if(match.captured(1) == "34")
279 {
280 m_mapIsotope.at(Isotope::S34) = number_of_isotopes;
281 }
282 else if(match.captured(1) == "36")
283 {
284 m_mapIsotope.at(Isotope::S36) = number_of_isotopes;
285 }
286 m_atomCount[AtomIsotopeSurvey::S] += number_of_isotopes;
287 }
288 }
289
291}
void calculateMassFromChemicalComponents()

References pappso::C, pappso::C13, calculateMassFromChemicalComponents(), pappso::H, pappso::H2, m_atomCount, m_mapIsotope, pappso::N, pappso::N15, pappso::O, pappso::O17, pappso::O18, pappso::S, pappso::S33, pappso::S34, and pappso::S36.

Referenced by createInstance().

◆ setXrefOrigin()

void pappso::AaModification::setXrefOrigin ( const QString &  origin)
protected

set list of amino acid on which this modification takes place

  • origin string of the form "S T" for Serine or Threonine, "X" for any amino acid (see OBO PSI format)

Definition at line 181 of file aamodification.cpp.

182{
183 // xref: Origin: "N"
184 // xref: Origin: "X"
185 m_origin = origin;
186}

References m_origin.

Referenced by createInstance().

Member Data Documentation

◆ m_accession

const QString pappso::AaModification::m_accession
protected

Definition at line 91 of file aamodification.h.

Referenced by calculateMassFromChemicalComponents(), getAccession(), and isInternal().

◆ m_atomCount

std::map<AtomIsotopeSurvey, int> pappso::AaModification::m_atomCount
private

◆ m_mapAccessionModifications

AaModification::MapAccessionModifications pappso::AaModification::m_mapAccessionModifications
staticprivate
Initial value:
= [] {
return ret;
}()
std::map< QString, AaModificationP > MapAccessionModifications

Definition at line 122 of file aamodification.h.

Referenced by getInstance(), getInstanceCustomizedMod(), and getInstanceMutation().

◆ m_mapIsotope

std::map<Isotope, int> pappso::AaModification::m_mapIsotope
private

◆ m_mass

pappso_double pappso::AaModification::m_mass
private

Definition at line 116 of file aamodification.h.

Referenced by calculateMassFromChemicalComponents(), and getMass().

◆ m_mutex

QMutex pappso::AaModification::m_mutex
staticprivate

Definition at line 124 of file aamodification.h.

Referenced by getInstance(), getInstanceCustomizedMod(), and getInstanceMutation().

◆ m_name

QString pappso::AaModification::m_name
protected

Definition at line 92 of file aamodification.h.

Referenced by createInstance(), createInstanceMutation(), and getName().

◆ m_origin

QString pappso::AaModification::m_origin
private

Definition at line 117 of file aamodification.h.

Referenced by AaModification(), and setXrefOrigin().


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