libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
aamodification.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/amino_acid/aamodification.h
3 * \date 7/3/2015
4 * \author Olivier Langella
5 * \brief amino acid modification model
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
10 *
11 * This file is part of the PAPPSOms++ library.
12 *
13 * PAPPSOms++ is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms++ is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25 *
26 * Contributors:
27 * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
28 *implementation
29 ******************************************************************************/
30
31#include <QRegularExpression>
32#include <QDebug>
33#include <cmath>
34
35#include "aamodification.h"
36#include "aa.h"
37#include "../pappsoexception.h"
38#include "../mzrange.h"
39#include "../peptide/peptide.h"
40#include "../obo/filterobopsimodsink.h"
41#include "../obo/filterobopsimodtermaccession.h"
42#include "../exception/exceptionnotfound.h"
43
44/*
45
46inline void initMyResource() {
47 Q_INIT_RESOURCE(resources);
48}
49*/
50
51namespace pappso
52{
53
55
56AaModification::AaModification(const QString &accession, pappso_double mass)
57 : m_accession(accession), m_mass(mass)
58{
64
66 {Isotope::H2, 0},
67 {Isotope::N15, 0},
68 {Isotope::O17, 0},
69 {Isotope::O18, 0},
70 {Isotope::S33, 0},
71 {Isotope::S34, 0},
72 {Isotope::S36, 0}};
73}
74
75
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}
85
89
90const QString &
92{
93
94 // qDebug();
95 return m_accession;
96}
97
98const QString &
100{
101 return m_name;
102}
103
106 MapAccessionModifications ret;
107
108 return ret;
109 }();
110
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 qDebug() << new_mod->m_mass;
122 return new_mod;
123}
124
126AaModification::createInstance(const QString &accession)
127{
128 if(accession == "internal:Nter_hydrolytic_cleavage_H")
129 {
130 OboPsiModTerm term;
131 term.m_accession = accession;
132 term.m_diffFormula = "H 1";
133 term.m_diffMono = MPROTIUM;
134 term.m_name = "Nter hydrolytic cleavage H+";
135 return (AaModification::createInstance(term));
136 }
137 if(accession == "internal:Cter_hydrolytic_cleavage_HO")
138 {
139 OboPsiModTerm term;
140 term.m_accession = accession;
141 term.m_diffFormula = "H 1 O 1";
143 term.m_name = "Cter hydrolytic cleavage HO";
144 return (AaModification::createInstance(term));
145 }
146 if(accession.startsWith("MUTATION:"))
147 {
148 QRegularExpression regexp_mutation("^MUTATION:([A-Z])=>([A-Z])$");
149 QRegularExpressionMatch match = regexp_mutation.match(accession);
150 if(match.hasMatch())
151 {
152 qDebug() << match.capturedTexts()[1].at(0) << " "
153 << match.capturedTexts()[2].at(0);
154
155 Aa aa_from(match.capturedTexts()[1].toStdString().c_str()[0]);
156 Aa aa_to(match.capturedTexts()[2].toStdString().c_str()[0]);
157 AaModificationP instance_mutation =
158 createInstanceMutation(aa_from, aa_to);
159 return instance_mutation;
160 // m_psiModLabel<<"|";
161 }
162 }
163 if(accession.startsWith("C13N15:"))
164 {
165 QRegularExpression regexp_label("^C13N15:([A-Z])$");
166 QRegularExpressionMatch match = regexp_label.match(accession);
167 if(match.hasMatch())
168 {
169 char labelled_aa(match.capturedTexts()[1].toStdString().c_str()[0]);
170
171 AaModificationP instance_labelled_aa_p =
172 createInstanceC13N15LabelledAminoAcid(QChar(labelled_aa));
173
174
175 return instance_labelled_aa_p;
176 // m_psiModLabel<<"|";
177 }
178 }
179 // initMyResource();
180 FilterOboPsiModSink term_list;
181 FilterOboPsiModTermAccession filterm_accession(term_list, accession);
182
183 OboPsiMod psimod(filterm_accession);
184
185 try
186 {
187 return (AaModification::createInstance(term_list.getOne()));
188 }
189 catch(ExceptionNotFound &e)
190 {
191 throw ExceptionNotFound(QObject::tr("modification not found : [%1]\n%2")
192 .arg(accession)
193 .arg(e.qwhat()));
194 }
195}
196
197void
198AaModification::setXrefOrigin(const QString &origin)
199{
200 // xref: Origin: "N"
201 // xref: Origin: "X"
202 m_origin = origin;
203}
204void
205AaModification::setDiffFormula(const QString &diff_formula)
206{
207 QRegularExpression rx("(^|\\s)([C,H,O,N,H,S])\\s([-]{0,1}\\d+)");
208 QRegularExpressionMatchIterator i = rx.globalMatch(diff_formula);
209
210 while(i.hasNext())
211 {
212 QRegularExpressionMatch match = i.next();
213
214 qDebug() << match.captured(2) << " " << match.captured(2) << " "
215 << match.captured(3);
216
217 if(match.captured(2) == "C")
218 {
219 m_atomCount[AtomIsotopeSurvey::C] = match.captured(3).toInt();
220 }
221 else if(match.captured(2) == "H")
222 {
223 m_atomCount[AtomIsotopeSurvey::H] = match.captured(3).toInt();
224 }
225 else if(match.captured(2) == "N")
226 {
227 m_atomCount[AtomIsotopeSurvey::N] = match.captured(3).toInt();
228 }
229 else if(match.captured(2) == "O")
230 {
231 m_atomCount[AtomIsotopeSurvey::O] = match.captured(3).toInt();
232 }
233 else if(match.captured(2) == "S")
234 {
235 m_atomCount[AtomIsotopeSurvey::S] = match.captured(3).toInt();
236 }
237 }
238
239 // look for isotopes :
240 rx.setPattern("\\(([-]{0,1}\\d+)\\)([C,H,O,N,H,S])\\s([-]{0,1}\\d+)");
241
242 i = rx.globalMatch(diff_formula);
243
244 while(i.hasNext())
245 {
246 QRegularExpressionMatch match = i.next();
247
248 qDebug() << match.captured(1) << " " << match.captured(2) << " "
249 << match.captured(3);
250
251 int number_of_isotopes = match.captured(3).toInt();
252
253 if(match.captured(2) == "C")
254 {
255 if(match.captured(1) == "13")
256 {
257 m_mapIsotope.at(Isotope::C13) = number_of_isotopes;
258 }
259 m_atomCount[AtomIsotopeSurvey::C] += number_of_isotopes;
260 }
261 else if(match.captured(2) == "H")
262 {
263 if(match.captured(1) == "2")
264 {
265 m_mapIsotope.at(Isotope::H2) = number_of_isotopes;
266 }
267 m_atomCount[AtomIsotopeSurvey::H] += number_of_isotopes;
268 }
269 else if(match.captured(2) == "N")
270 {
271 if(match.captured(1) == "15")
272 {
273 m_mapIsotope.at(Isotope::N15) = number_of_isotopes;
274 }
275 m_atomCount[AtomIsotopeSurvey::N] += number_of_isotopes;
276 }
277 else if(match.captured(2) == "O")
278 {
279 if(match.captured(1) == "17")
280 {
281 m_mapIsotope.at(Isotope::O17) = number_of_isotopes;
282 }
283 else if(match.captured(1) == "18")
284 {
285 m_mapIsotope.at(Isotope::O18) = number_of_isotopes;
286 }
287 m_atomCount[AtomIsotopeSurvey::O] += number_of_isotopes;
288 }
289 else if(match.captured(2) == "S")
290 {
291 if(match.captured(1) == "33")
292 {
293 m_mapIsotope.at(Isotope::S33) = number_of_isotopes;
294 }
295 else if(match.captured(1) == "34")
296 {
297 m_mapIsotope.at(Isotope::S34) = number_of_isotopes;
298 }
299 else if(match.captured(1) == "36")
300 {
301 m_mapIsotope.at(Isotope::S36) = number_of_isotopes;
302 }
303 m_atomCount[AtomIsotopeSurvey::S] += number_of_isotopes;
304 }
305 }
306
308}
309
310
311void
313{
314 pappso_double theoreticalm_mass = 0;
315 std::map<AtomIsotopeSurvey, int>::const_iterator it_atom =
317 if(it_atom != m_atomCount.end())
318 {
319 theoreticalm_mass += MASSCARBON * (it_atom->second);
320 }
321 it_atom = m_atomCount.find(AtomIsotopeSurvey::H);
322 if(it_atom != m_atomCount.end())
323 {
324 theoreticalm_mass += MPROTIUM * (it_atom->second);
325 }
326
327 it_atom = m_atomCount.find(AtomIsotopeSurvey::O);
328 if(it_atom != m_atomCount.end())
329 {
330 theoreticalm_mass += MASSOXYGEN * (it_atom->second);
331 }
332
333 it_atom = m_atomCount.find(AtomIsotopeSurvey::N);
334 if(it_atom != m_atomCount.end())
335 {
336 theoreticalm_mass += MASSNITROGEN * (it_atom->second);
337 }
338 it_atom = m_atomCount.find(AtomIsotopeSurvey::S);
339 if(it_atom != m_atomCount.end())
340 {
341 theoreticalm_mass += MASSSULFUR * (it_atom->second);
342 }
343
344 qDebug() << theoreticalm_mass;
345
346 theoreticalm_mass += DIFFC12C13 * m_mapIsotope.at(Isotope::C13);
347 theoreticalm_mass += DIFFH1H2 * m_mapIsotope.at(Isotope::H2);
348 theoreticalm_mass += DIFFN14N15 * m_mapIsotope.at(Isotope::N15);
349 theoreticalm_mass += DIFFO16O17 * m_mapIsotope.at(Isotope::O17);
350 theoreticalm_mass += DIFFO16O18 * m_mapIsotope.at(Isotope::O18);
351 theoreticalm_mass += DIFFS32S33 * m_mapIsotope.at(Isotope::S33);
352 theoreticalm_mass += DIFFS32S34 * m_mapIsotope.at(Isotope::S34);
353 theoreticalm_mass += DIFFS32S36 * m_mapIsotope.at(Isotope::S36);
354
355
356 if(m_mass == 0.0)
357 {
358 m_mass = theoreticalm_mass;
359 }
360 else
361 {
362 pappso_double diff = std::fabs((pappso_double)m_mass - theoreticalm_mass);
363 if(diff < 0.001)
364 {
365 m_mass = theoreticalm_mass;
366 qDebug() << diff;
367 }
368 else
369 {
370 qDebug()
371 << "ERROR in AaModification::calculateMassFromChemicalComponents "
372 "theo="
373 << theoreticalm_mass << " m=" << m_mass << " diff=" << diff
374 << " accession=" << m_accession;
375 }
376 }
377}
378
381{
382 QString accession = QString("%1").arg(modificationMass);
383 qDebug() << accession;
384 QMutexLocker locker(&m_mutex);
385 if(m_mapAccessionModifications.find(accession) ==
387 {
388 // not found
389 m_mapAccessionModifications.insert(std::pair<QString, AaModification *>(
390 accession, new AaModification(accession, modificationMass)));
391 }
392 else
393 {
394 // found
395 }
396 return m_mapAccessionModifications.at(accession);
397}
398
400AaModification::getInstance(const QString &accession)
401{
402 try
403 {
404 QMutexLocker locker(&m_mutex);
405 MapAccessionModifications::iterator it =
406 m_mapAccessionModifications.find(accession);
407 if(it == m_mapAccessionModifications.end())
408 {
409
410 // not found
411 std::pair<MapAccessionModifications::iterator, bool> insert_res =
413 std::pair<QString, AaModificationP>(
414 accession, AaModification::createInstance(accession)));
415 it = insert_res.first;
416 }
417 else
418 {
419 // found
420 }
421 return it->second;
422 }
423 catch(ExceptionNotFound &e)
424 {
425 throw ExceptionNotFound(
426 QObject::tr("ERROR getting instance of : %1 NOT FOUND\n%2")
427 .arg(accession)
428 .arg(e.qwhat()));
429 }
430 catch(PappsoException &e)
431 {
432 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
433 .arg(accession)
434 .arg(e.qwhat()));
435 }
436 catch(std::exception &e)
437 {
438 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
439 .arg(accession)
440 .arg(e.what()));
441 }
442}
443
446{
447
448 QMutexLocker locker(&m_mutex);
449
450 std::pair<MapAccessionModifications::iterator, bool> insert_res =
452 std::pair<QString, AaModificationP>(oboterm.m_accession, nullptr));
453
454 if(!insert_res.second)
455 {
456 // Failed to insert, was there already by same key.
457 }
458 else
459 {
460 // Could insert (albeit with nullptr), was not there already by same key.
461 // Just assign to the *correct* pair member the pointer to an
462 // extemporaneously allocated AaModification.
463 insert_res.first->second = AaModification::createInstance(oboterm);
464 }
465
466 return insert_res.first->second;
467}
468
469
472 pappso_double mass,
473 const PeptideSp &peptide_sp,
474 unsigned int position)
475{
477 if(MzRange(mass, precision).contains(getInstance("MOD:00719")->getMass()))
478 {
479 if(type == "M")
480 {
481 return getInstance("MOD:00719");
482 }
483 if(type == "K")
484 {
485 return getInstance("MOD:01047");
486 }
487 }
488 // accession== "MOD:00057"
489 if(MzRange(mass, precision).contains(getInstance("MOD:00408")->getMass()))
490 {
491 // id: MOD:00394
492 // name: acetylated residue
493 // potential N-terminus modifications
494 if(position == 0)
495 {
496 return getInstance("MOD:00408");
497 }
498 }
499 if(MzRange(mass, precision).contains(getInstance("MOD:01160")->getMass()))
500 {
501 //-17.02655
502 // loss of ammonia [MOD:01160] -17.026549
503 return getInstance("MOD:01160");
504 }
505
506 if(MzRange(mass, precision).contains(getInstance("MOD:01060")->getMass()))
507 {
508 //// iodoacetamide [MOD:00397] 57.021464
509 if(type == "C")
510 {
511 return getInstance("MOD:01060");
512 }
513 else
514 {
515 return getInstance("MOD:00397");
516 }
517 }
518 if(MzRange(mass, precision).contains(getInstance("MOD:00704")->getMass()))
519 {
520 // loss of water
521 /*
522 if (position == 0) {
523 if (peptide_sp.get()->getSequence().startsWith("EG")) {
524 return getInstance("MOD:00365");
525 }
526 if (peptide_sp.get()->getSequence().startsWith("ES")) {
527 return getInstance("MOD:00953");
528 }
529 if (type == "E") {
530 return getInstance("MOD:00420");
531 }
532 }
533 */
534 // dehydrated residue [MOD:00704] -18.010565
535 return getInstance("MOD:00704");
536 }
537 if(MzRange(mass, precision).contains(getInstance("MOD:00696")->getMass()))
538 {
539 // phosphorylated residue [MOD:00696] 79.966330
540 return getInstance("MOD:00696");
541 }
542 bool isCter = false;
543 if(peptide_sp.get()->size() == (position + 1))
544 {
545 isCter = true;
546 }
547 if((position == 0) || isCter)
548 {
549 if(MzRange(mass, precision).contains(getInstance("MOD:00429")->getMass()))
550 {
551 // dimethyl
552 return getInstance("MOD:00429");
553 }
554 if(MzRange(mass, precision).contains(getInstance("MOD:00552")->getMass()))
555 {
556 // 4x(2)H labeled dimethyl residue
557 return getInstance("MOD:00552");
558 }
559 if(MzRange(mass, precision).contains(getInstance("MOD:00638")->getMass()))
560 {
561 // 2x(13)C,6x(2)H-dimethylated arginine
562 return getInstance("MOD:00638");
563 }
564 }
565 throw PappsoException(
566 QObject::tr("tandem modification not found : %1 %2 %3 %4")
567 .arg(type)
568 .arg(mass)
569 .arg(peptide_sp.get()->getSequence())
570 .arg(position));
571}
572
575{
576 return m_mass;
577}
578
579
580int
582{
583 // qDebug() << "AaModification::getNumberOfAtom(AtomIsotopeSurvey atom) NOT
584 // IMPLEMENTED";
585 return m_atomCount.at(atom);
586}
587
588
589int
591{
592 try
593 {
594 return m_mapIsotope.at(isotope);
595 }
596 catch(std::exception &e)
597 {
598 throw PappsoException(
599 QObject::tr("ERROR in AaModification::getNumberOfIsotope %2")
600 .arg(e.what()));
601 }
602}
603
604
605bool
607{
608 if(m_accession.startsWith("internal:"))
609 {
610 return true;
611 }
612 return false;
613}
614
616AaModification::createInstanceMutation(const Aa &aa_from, const Aa &aa_to)
617{
618 QString accession(
619 QString("MUTATION:%1=>%2").arg(aa_from.getLetter()).arg(aa_to.getLetter()));
620 double diffMono = aa_to.getMass() - aa_from.getMass();
621 // not found
622 AaModification *instance_mutation;
623 // qDebug() << " AaModification::createInstance begin";
624 instance_mutation = new AaModification(accession, diffMono);
625 // xref: DiffFormula: "C 0 H 0 N 0 O 1 S 0"
626
627 for(std::int8_t atomInt = (std::int8_t)AtomIsotopeSurvey::C;
628 atomInt != (std::int8_t)AtomIsotopeSurvey::last;
629 atomInt++)
630 {
631 AtomIsotopeSurvey atom = static_cast<AtomIsotopeSurvey>(atomInt);
632 instance_mutation->m_atomCount[atom] =
633 aa_to.getNumberOfAtom(atom) - aa_from.getNumberOfAtom(atom);
634 }
635 instance_mutation->m_name = QString("mutation from %1 to %2")
636 .arg(aa_from.getLetter())
637 .arg(aa_to.getLetter());
638 return instance_mutation;
639}
640
641
643AaModification::getInstanceMutation(const QChar &mut_from, const QChar &mut_to)
644{
645 QString accession(QString("MUTATION:%1=>%2").arg(mut_from).arg(mut_to));
646 try
647 {
648 QMutexLocker locker(&m_mutex);
649 MapAccessionModifications::iterator it =
650 m_mapAccessionModifications.find(accession);
651 if(it == m_mapAccessionModifications.end())
652 {
653 Aa aa_from(mut_from.toLatin1());
654 Aa aa_to(mut_to.toLatin1());
655 AaModificationP instance_mutation =
656 createInstanceMutation(aa_from, aa_to);
657
658 std::pair<MapAccessionModifications::iterator, bool> insert_res =
660 std::pair<QString, AaModificationP>(accession,
661 instance_mutation));
662 it = insert_res.first;
663 }
664 else
665 {
666 // found
667 }
668 return it->second;
669 }
670 catch(ExceptionNotFound &e)
671 {
672 throw ExceptionNotFound(
673 QObject::tr("ERROR getting instance of : %1 NOT FOUND\n%2")
674 .arg(accession)
675 .arg(e.qwhat()));
676 }
677 catch(PappsoException &e)
678 {
679 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
680 .arg(accession)
681 .arg(e.qwhat()));
682 }
683 catch(std::exception &e)
684 {
685 throw PappsoException(QObject::tr("ERROR getting instance of %1\n%2")
686 .arg(accession)
687 .arg(e.what()));
688 }
689}
690
693{
694 switch(from_aa.toLatin1())
695 {
696 case 'R':
697 return createInstance("MOD:00587");
698 break;
699 case 'K':
700 return createInstance("MOD:00582");
701 break;
702 case 'F':
703 return createInstance("MOD:00589");
704 break;
705 }
706
707 // At this point we have no MOD ontology term for all the other amino-acid
708 // residue, we need to craft the stuff ourselves.
709
710 QString accession(QString("C13N15:%1").arg(from_aa));
711
712 // Define the diff formula for each amino acid code not handled above.
713
714 QString diff_formula;
715
716 switch(from_aa.toLatin1())
717 {
718 case 'G':
719 diff_formula = "(12)C -2 (13)C 2 (14)N -1 (15)N 1";
720 break;
721 case 'A':
722 diff_formula = "(12)C -3 (13)C 3 (14)N -1 (15)N 1";
723 break;
724 case 'V':
725 diff_formula = "(12)C -5 (13)C 5 (14)N -1 (15)N 1";
726 break;
727 case 'I':
728 diff_formula = "(12)C -6 (13)C 6 (14)N -1 (15)N 1";
729 break;
730 case 'L':
731 diff_formula = "(12)C -6 (13)C 6 (14)N -1 (15)N 1";
732 break;
733 case 'S':
734 diff_formula = "(12)C -3 (13)C 3 (14)N -1 (15)N 1";
735 break;
736 case 'T':
737 diff_formula = "(12)C -4 (13)C 4 (14)N -1 (15)N 1";
738 break;
739 case 'C':
740 diff_formula = "(12)C -3 (13)C 3 (14)N -1 (15)N 1";
741 break;
742 case 'M':
743 diff_formula = "(12)C -5 (13)C 5 (14)N -1 (15)N 1";
744 break;
745 case 'D':
746 diff_formula = "(12)C -4 (13)C 4 (14)N -1 (15)N 1";
747 break;
748 case 'E':
749 diff_formula = "(12)C -5 (13)C 5 (14)N -1 (15)N 1";
750 break;
751 case 'N':
752 diff_formula = "(12)C -4 (13)C 4 (14)N -2 (15)N 2";
753 break;
754 case 'Q':
755 diff_formula = "(12)C -5 (13)C 5 (14)N -2 (15)N 2";
756 break;
757 case 'W':
758 diff_formula = "(12)C -11 (13)C 11 (14)N -2 (15)N 2";
759 break;
760 case 'Y':
761 diff_formula = "(12)C -9 (13)C 9 (14)N -1 (15)N 1";
762 break;
763 case 'H':
764 diff_formula = "(12)C -6 (13)C 6 (14)N -3 (15)N 3";
765 break;
766 case 'P':
767 diff_formula = "(12)C -5 (13)C 5 (14)N -1 (15)N 1";
768 break;
769 default:
770 throw PappsoException(
771 QObject::tr("ERROR creating C13N15-labelled amino acid residue %1\n")
772 .arg(from_aa));
773 }
774
775 OboPsiModTerm obo_psi_term;
776 obo_psi_term.m_accession = accession;
777 obo_psi_term.m_diffFormula = diff_formula;
778 obo_psi_term.m_name = QString("Fully C13N15-labelled %1").arg(from_aa);
779 obo_psi_term.m_diffMono = 0;
780
781 qDebug() << "obo_psi_term.m_diffFormula: " << obo_psi_term.m_diffFormula;
782 return AaModification::createInstance(obo_psi_term);
783}
784
785} // namespace pappso
amino acid modification model
virtual const char & getLetter() const
Definition aabase.cpp:434
const QString & getName() const
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
static AaModificationP createInstance(const QString &saccession)
std::map< Isotope, int > m_mapIsotope
const QString & getAccession() const
static AaModificationP getInstanceXtandemMod(const QString &type, pappso_double mass, const PeptideSp &peptide_sp, unsigned int position)
AaModification(AaModification &&toCopy)
std::map< AtomIsotopeSurvey, int > m_atomCount
int getNumberOfAtom(AtomIsotopeSurvey atom) const override final
get the number of atom C, O, N, H in the molecule
pappso_double getMass() const
void setXrefOrigin(const QString &origin)
set list of amino acid on which this modification takes place
std::map< QString, AaModificationP > MapAccessionModifications
static AaModificationP getInstance(const QString &accession)
static AaModificationP createInstanceC13N15LabelledAminoAcid(const QChar &aa_from)
get heavy amino acid modification C13 N15
static AaModificationP getInstanceCustomizedMod(pappso_double modificationMass)
const QString m_accession
void setDiffFormula(const QString &diff_formula)
static AaModificationP createInstanceMutation(const Aa &aa_from, const Aa &aa_to)
static MapAccessionModifications m_mapAccessionModifications
int getNumberOfIsotope(Isotope isotope) const override final
get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
int getNumberOfAtom(AtomIsotopeSurvey atom) const override final
get the number of atom C, O, N, H in the molecule
Definition aa.cpp:166
pappso_double getMass() const override
Definition aa.cpp:79
const OboPsiModTerm & getOne()
const char * what() const noexcept override
virtual const QString & qwhat() const
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
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)
std::shared_ptr< const Peptide > PeptideSp
const pappso_double DIFFS32S36(35.9670812000 - MASSSULFUR)
const AaModification * AaModificationP
AtomIsotopeSurvey
Definition types.h:89
double pappso_double
A type definition for doubles.
Definition types.h:50
Isotope
Definition types.h:104
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)