libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
peptideinterface.cpp
Go to the documentation of this file.
1
2/*******************************************************************************
3 * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
4 *
5 * This file is part of the PAPPSOms++ library.
6 *
7 * PAPPSOms++ is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * PAPPSOms++ is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * Contributors:
21 * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
22 *implementation
23 ******************************************************************************/
24
25#include "peptideinterface.h"
26
27namespace pappso
28{
29
30const QString
32{
33 return QString(this->getSequence()).replace("L", "I");
34}
35
36const QString
37PeptideInterface::getFormula(unsigned int charge) const
38{
39 QString carbon(QString("C %1").arg(this->getNumberOfAtom(Enums::AtomIsotopeSurvey::C) -
42 {
43 carbon.append(QString(" (13)C %1").arg(this->getNumberOfIsotope(Enums::Isotope::C13)));
44 }
45 QString hydrogen(QString("H %1").arg(this->getNumberOfAtom(Enums::AtomIsotopeSurvey::H) + charge -
48 {
49 hydrogen.append(QString(" (2)H %1").arg(this->getNumberOfIsotope(Enums::Isotope::H2)));
50 }
51 QString oxygen(QString("O %1").arg(this->getNumberOfAtom(Enums::AtomIsotopeSurvey::O) -
55 {
56 oxygen.append(QString(" (17)O %1").arg(this->getNumberOfIsotope(Enums::Isotope::O17)));
57 }
59 {
60 oxygen.append(QString(" (18)O %1").arg(this->getNumberOfIsotope(Enums::Isotope::O18)));
61 }
62 QString nitrogen(QString("N %1").arg(this->getNumberOfAtom(Enums::AtomIsotopeSurvey::N) -
65 {
66 nitrogen.append(QString(" (15)N %1").arg(this->getNumberOfIsotope(Enums::Isotope::N15)));
67 }
68
69 QString sulfur(QString("S %1").arg(
73 {
74 sulfur.append(QString(" (33)S %1").arg(this->getNumberOfIsotope(Enums::Isotope::S33)));
75 }
77 {
78 sulfur.append(QString(" (34)S %1").arg(this->getNumberOfIsotope(Enums::Isotope::S34)));
79 }
81 {
82 sulfur.append(QString(" (36)S %1").arg(this->getNumberOfIsotope(Enums::Isotope::S36)));
83 }
84 return QString("%1 %2 %3 %4 %5").arg(carbon).arg(hydrogen).arg(oxygen).arg(nitrogen).arg(sulfur);
85}
86} // namespace pappso
87
90{
91 pappso::ChemicalFormula formula(*this);
92
93 formula.addIsotopeCount({Enums::Isotope::H, (std::int16_t)charge});
94
95 return formula;
96}
virtual int getNumberOfIsotope(Enums::Isotope isotope) const =0
get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
virtual int getNumberOfAtom(Enums::AtomIsotopeSurvey atom) const =0
get the number of atom C, O, N, H in the molecule
void addIsotopeCount(const IsotopeCount &isotope_count)
add an atom or isotope to the forumla
virtual const QString getSequence() const =0
amino acid sequence without modification
virtual const QString getSequenceLi() const
amino acid sequence without modification where L are replaced by I
virtual const QString getFormula(unsigned int charge) const final
virtual const ChemicalFormula getChemicalFormulaCharge(unsigned int charge) const
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39