libpappsomspp
Library for mass spectrometry
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
const
QString
36
PeptideInterface::getFormula
(
unsigned
int
charge)
const
37
{
38
QString carbon(
39
QString(
"C %1"
).arg(this->
getNumberOfAtom
(
AtomIsotopeSurvey::C
) -
40
this->
getNumberOfIsotope
(
Isotope::C13
)));
41
if
(this->
getNumberOfIsotope
(
Isotope::C13
) > 0)
42
{
43
carbon.append(
44
QString(
" (13)C %1"
).arg(this->
getNumberOfIsotope
(
Isotope::C13
)));
45
}
46
QString hydrogen(
47
QString(
"H %1"
).arg(this->
getNumberOfAtom
(
AtomIsotopeSurvey::H
) + charge -
48
this->
getNumberOfIsotope
(
Isotope::H2
)));
49
if
(this->
getNumberOfIsotope
(
Isotope::H2
) > 0)
50
{
51
hydrogen.append(
52
QString(
" (2)H %1"
).arg(this->
getNumberOfIsotope
(
Isotope::H2
)));
53
}
54
QString oxygen(
55
QString(
"O %1"
).arg(this->
getNumberOfAtom
(
AtomIsotopeSurvey::O
) -
56
this->
getNumberOfIsotope
(
Isotope::O17
) -
57
this->
getNumberOfIsotope
(
Isotope::O18
)));
58
if
(this->
getNumberOfIsotope
(
Isotope::O17
) > 0)
59
{
60
oxygen.append(
61
QString(
" (17)O %1"
).arg(this->
getNumberOfIsotope
(
Isotope::O17
)));
62
}
63
if
(this->
getNumberOfIsotope
(
Isotope::O18
) > 0)
64
{
65
oxygen.append(
66
QString(
" (18)O %1"
).arg(this->
getNumberOfIsotope
(
Isotope::O18
)));
67
}
68
QString nitrogen(
69
QString(
"N %1"
).arg(this->
getNumberOfAtom
(
AtomIsotopeSurvey::N
) -
70
this->
getNumberOfIsotope
(
Isotope::N15
)));
71
if
(this->
getNumberOfIsotope
(
Isotope::N15
) > 0)
72
{
73
nitrogen.append(
74
QString(
" (15)N %1"
).arg(this->
getNumberOfIsotope
(
Isotope::N15
)));
75
}
76
77
QString sulfur(
78
QString(
"S %1"
).arg(this->
getNumberOfAtom
(
AtomIsotopeSurvey::S
) -
79
this->
getNumberOfIsotope
(
Isotope::S33
) -
80
this->
getNumberOfIsotope
(
Isotope::S34
) -
81
this->
getNumberOfIsotope
(
Isotope::S36
)));
82
if
(this->
getNumberOfIsotope
(
Isotope::S33
) > 0)
83
{
84
sulfur.append(
85
QString(
" (33)S %1"
).arg(this->
getNumberOfIsotope
(
Isotope::S33
)));
86
}
87
if
(this->
getNumberOfIsotope
(
Isotope::S34
) > 0)
88
{
89
sulfur.append(
90
QString(
" (34)S %1"
).arg(this->
getNumberOfIsotope
(
Isotope::S34
)));
91
}
92
if
(this->
getNumberOfIsotope
(
Isotope::S36
) > 0)
93
{
94
sulfur.append(
95
QString(
" (36)S %1"
).arg(this->
getNumberOfIsotope
(
Isotope::S36
)));
96
}
97
return
QString(
"%1 %2 %3 %4 %5"
)
98
.arg(carbon)
99
.arg(hydrogen)
100
.arg(oxygen)
101
.arg(nitrogen)
102
.arg(sulfur);
103
}
104
}
// namespace pappso
pappso::AtomIsotopeSurvey::S
@ S
pappso::Isotope::H2
@ H2
pappso::Isotope::S36
@ S36
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
Definition:
aa.cpp:39
pappso::Isotope::N15
@ N15
pappso::PeptideInterface::getFormula
virtual const QString getFormula(unsigned int charge) const final
Definition:
peptideinterface.cpp:57
pappso::PeptideInterface::getSequence
virtual const QString getSequence() const =0
amino acid sequence without modification
peptideinterface.h
pappso::Isotope::O17
@ O17
pappso::AtomIsotopeSurvey::H
@ H
pappso::AtomNumberInterface::getNumberOfIsotope
virtual int getNumberOfIsotope(Isotope isotope) const =0
get the number of isotopes C13, H2, O17, O18, N15, S33, S34, S36 in the molecule
pappso::Isotope::S34
@ S34
pappso::PeptideInterface::getSequenceLi
virtual const QString getSequenceLi() const
amino acid sequence without modification where L are replaced by I
Definition:
peptideinterface.cpp:52
pappso::AtomIsotopeSurvey::C
@ C
pappso::Isotope::C13
@ C13
pappso::AtomIsotopeSurvey::N
@ N
pappso::Isotope::O18
@ O18
pappso::AtomNumberInterface::getNumberOfAtom
virtual int getNumberOfAtom(AtomIsotopeSurvey atom) const =0
get the number of atom C, O, N, H in the molecule
pappso::AtomIsotopeSurvey::O
@ O
pappso::Isotope::S33
@ S33
pappsomspp
peptide
peptideinterface.cpp
Generated on Tue Aug 25 2020 11:13:48 for libpappsomspp by
1.8.18