libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
spomsprotein.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2025 Aurélien Berthier
3
* <aurelien.berthier@ls2n.fr>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#include "
spomsprotein.h
"
20
21
22
namespace
pappso
23
{
24
namespace
specpeptidoms
25
{
26
SpOMSProtein::SpOMSProtein
(
const
QString &description,
27
const
QString &sequence,
28
const
AaCode
&aa_code)
29
:
m_description
(description),
m_sequence
(sequence)
30
{
31
clear();
32
33
SpOMSAa
aa;
34
35
for
(
const
QChar &aa_str :
m_sequence
)
36
{
37
aa.aa = (
pappso::Enums::AminoAcidChar
)aa_str.toLatin1();
38
aa.code = aa_code.
getAaCode
(aa.aa);
39
aa.mass = aa_code.
getMass
(aa.code);
40
push_back(aa);
41
}
42
43
// by default the sequence is reversed
44
std::reverse(begin(), end());
45
}
46
47
SpOMSProtein::~SpOMSProtein
()
48
{
49
}
50
51
const
QString
52
SpOMSProtein::getAccession
()
const
53
{
54
return
m_description
.split(
" "
).at(0);
55
}
56
57
const
QString &
58
SpOMSProtein::getSequence
()
const
59
{
60
return
m_sequence
;
61
}
62
63
64
const
QString &
65
SpOMSProtein::getCompleteDescription
()
const
66
{
67
return
m_description
;
68
}
69
70
std::vector<SpOMSAa>
71
SpOMSProtein::sliced
(std::size_t position, std::size_t length)
const
72
{
73
74
std::vector<SpOMSAa> aa_vec;
75
76
for
(std::size_t i = 0; i < length; i++)
77
{
78
aa_vec.push_back(at(i + position));
79
}
80
81
return
aa_vec;
82
}
83
}
// namespace specpeptidoms
84
}
// namespace pappso
pappso::AaCode
collection of integer code for each amino acid 0 => null 1 to 20 => amino acid sorted by there mass (...
Definition
aacode.h:44
pappso::AaCode::getAaCode
uint8_t getAaCode(char aa_letter) const
get the integer code of an amino acid with the one letter code
Definition
aacode.cpp:81
pappso::AaCode::getMass
double getMass(uint8_t aa_code) const
get the mass of the amino acid given its integer code the amino acid can bear some modification (if a...
Definition
aacode.cpp:224
pappso::specpeptidoms::SpOMSProtein::getSequence
const QString & getSequence() const
Definition
spomsprotein.cpp:58
pappso::specpeptidoms::SpOMSProtein::SpOMSProtein
SpOMSProtein(const QString &description, const QString &sequence, const AaCode &aa_code)
Definition
spomsprotein.cpp:26
pappso::specpeptidoms::SpOMSProtein::getCompleteDescription
const QString & getCompleteDescription() const
Definition
spomsprotein.cpp:65
pappso::specpeptidoms::SpOMSProtein::getAccession
const QString getAccession() const
Definition
spomsprotein.cpp:52
pappso::specpeptidoms::SpOMSProtein::~SpOMSProtein
virtual ~SpOMSProtein()
Definition
spomsprotein.cpp:47
pappso::specpeptidoms::SpOMSProtein::m_description
QString m_description
Definition
spomsprotein.h:52
pappso::specpeptidoms::SpOMSProtein::sliced
std::vector< SpOMSAa > sliced(std::size_t position, std::size_t length) const
Definition
spomsprotein.cpp:71
pappso::specpeptidoms::SpOMSProtein::m_sequence
QString m_sequence
Definition
spomsprotein.h:53
pappso::Enums::AminoAcidChar
AminoAcidChar
Definition
types.h:187
pappso::specpeptidoms
Definition
correctiontree.h:40
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
spomsprotein.h
pappso::specpeptidoms::SpOMSAa
Definition
spomsprotein.h:31
pappsomspp
core
processing
specpeptidoms
spomsprotein.cpp
Generated on
for libpappsomspp by
1.17.0