libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
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
27
namespace
pappso
28
{
29
30
const
QString
31
PeptideInterface::getSequenceLi
()
const
32
{
33
return
QString(this->
getSequence
()).replace(
"L"
,
"I"
);
34
}
35
36
const
QString
37
PeptideInterface::getFormula
(
unsigned
int
charge)
const
38
{
39
QString carbon(QString(
"C %1"
).arg(this->
getNumberOfAtom
(
Enums::AtomIsotopeSurvey::C
) -
40
this->
getNumberOfIsotope
(
Enums::Isotope::C13
)));
41
if
(this->
getNumberOfIsotope
(
Enums::Isotope::C13
) > 0)
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 -
46
this->
getNumberOfIsotope
(
Enums::Isotope::H2
)));
47
if
(this->
getNumberOfIsotope
(
Enums::Isotope::H2
) > 0)
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
) -
52
this->
getNumberOfIsotope
(
Enums::Isotope::O17
) -
53
this->
getNumberOfIsotope
(
Enums::Isotope::O18
)));
54
if
(this->
getNumberOfIsotope
(
Enums::Isotope::O17
) > 0)
55
{
56
oxygen.append(QString(
" (17)O %1"
).arg(this->
getNumberOfIsotope
(
Enums::Isotope::O17
)));
57
}
58
if
(this->
getNumberOfIsotope
(
Enums::Isotope::O18
) > 0)
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
) -
63
this->
getNumberOfIsotope
(
Enums::Isotope::N15
)));
64
if
(this->
getNumberOfIsotope
(
Enums::Isotope::N15
) > 0)
65
{
66
nitrogen.append(QString(
" (15)N %1"
).arg(this->
getNumberOfIsotope
(
Enums::Isotope::N15
)));
67
}
68
69
QString sulfur(QString(
"S %1"
).arg(this->
getNumberOfAtom
(
Enums::AtomIsotopeSurvey::S
) -
70
this->
getNumberOfIsotope
(
Enums::Isotope::S33
) -
71
this->
getNumberOfIsotope
(
Enums::Isotope::S34
) -
72
this->
getNumberOfIsotope
(
Enums::Isotope::S36
)));
73
if
(this->
getNumberOfIsotope
(
Enums::Isotope::S33
) > 0)
74
{
75
sulfur.append(QString(
" (33)S %1"
).arg(this->
getNumberOfIsotope
(
Enums::Isotope::S33
)));
76
}
77
if
(this->
getNumberOfIsotope
(
Enums::Isotope::S34
) > 0)
78
{
79
sulfur.append(QString(
" (34)S %1"
).arg(this->
getNumberOfIsotope
(
Enums::Isotope::S34
)));
80
}
81
if
(this->
getNumberOfIsotope
(
Enums::Isotope::S36
) > 0)
82
{
83
sulfur.append(QString(
" (36)S %1"
).arg(this->
getNumberOfIsotope
(
Enums::Isotope::S36
)));
84
}
85
return
QString(
"%1 %2 %3 %4 %5"
).arg(carbon).arg(hydrogen).arg(oxygen).arg(nitrogen).arg(sulfur);
86
}
87
}
// namespace pappso
88
89
const
pappso::ChemicalFormula
90
pappso::PeptideInterface::getChemicalFormulaCharge
(
unsigned
int
charge)
const
91
{
92
pappso::ChemicalFormula
formula(*
this
);
93
94
formula.
addIsotopeCount
({
Enums::Isotope::H
, (std::int16_t)charge});
95
96
return
formula;
97
}
pappso::AtomNumberInterface::getNumberOfIsotope
virtual int getNumberOfIsotope(Enums::Isotope isotope) const =0
get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
pappso::AtomNumberInterface::getNumberOfAtom
virtual int getNumberOfAtom(Enums::AtomIsotopeSurvey atom) const =0
get the number of atom C, O, N, H in the molecule
pappso::ChemicalFormula
Definition
chemicalformula.h:44
pappso::ChemicalFormula::addIsotopeCount
void addIsotopeCount(const IsotopeCount &isotope_count)
add an atom or isotope to the forumla
Definition
chemicalformula.cpp:641
pappso::PeptideInterface::getSequence
virtual const QString getSequence() const =0
amino acid sequence without modification
pappso::PeptideInterface::getSequenceLi
virtual const QString getSequenceLi() const
amino acid sequence without modification where L are replaced by I
Definition
peptideinterface.cpp:31
pappso::PeptideInterface::getFormula
virtual const QString getFormula(unsigned int charge) const final
Definition
peptideinterface.cpp:37
pappso::PeptideInterface::getChemicalFormulaCharge
virtual const ChemicalFormula getChemicalFormulaCharge(unsigned int charge) const
Definition
peptideinterface.cpp:90
pappso::Enums::AtomIsotopeSurvey::C
@ C
Definition
types.h:104
pappso::Enums::AtomIsotopeSurvey::S
@ S
Definition
types.h:108
pappso::Enums::AtomIsotopeSurvey::N
@ N
Definition
types.h:107
pappso::Enums::AtomIsotopeSurvey::H
@ H
Definition
types.h:105
pappso::Enums::AtomIsotopeSurvey::O
@ O
Definition
types.h:106
pappso::Enums::Isotope::S36
@ S36
Definition
types.h:132
pappso::Enums::Isotope::C13
@ C13
Definition
types.h:121
pappso::Enums::Isotope::N15
@ N15
Definition
types.h:128
pappso::Enums::Isotope::S33
@ S33
Definition
types.h:130
pappso::Enums::Isotope::O18
@ O18
Definition
types.h:126
pappso::Enums::Isotope::O17
@ O17
Definition
types.h:125
pappso::Enums::Isotope::H
@ H
Definition
types.h:122
pappso::Enums::Isotope::S34
@ S34
Definition
types.h:131
pappso::Enums::Isotope::H2
@ H2
Definition
types.h:123
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
peptideinterface.h
pappsomspp
core
peptide
peptideinterface.cpp
Generated on
for libpappsomspp by
1.17.0