libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
aacode.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/amino_acid/aacode.h
3
* \date 03/05/2023
4
* \author Olivier Langella
5
* \brief give an integer code to each amino acid
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2023 Olivier Langella <Olivier.Langella@u-psud.fr>.
10
*
11
* This file is part of PAPPSOms-tools.
12
*
13
* PAPPSOms-tools 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-tools 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-tools. If not, see <http://www.gnu.org/licenses/>.
25
*
26
******************************************************************************/
27
28
#pragma once
29
30
#include "
pappsomspp/export-import-config.h
"
31
#include "
pappsomspp/core/precision.h
"
32
#include <vector>
33
#include "
pappsomspp/core/amino_acid/aa.h
"
34
35
namespace
pappso
36
{
37
/**
38
* @brief collection of integer code for each amino acid
39
* 0 => null
40
* 1 to 20 => amino acid sorted by there mass (lower to higher). Leucine is
41
* replaced by Isoleucine
42
*/
43
class
PMSPP_LIB_DECL
AaCode
44
{
45
public
:
46
/**
47
* Default constructor
48
*/
49
AaCode
();
50
51
/**
52
* Default copy constructor
53
*/
54
AaCode
(
const
AaCode
&other);
55
56
/**
57
* Destructor
58
*/
59
~AaCode
();
60
61
/** @brief get the integer code of an amino acid with the one letter code
62
* @return integer 1 to 20, 0 if not found
63
*/
64
uint8_t
getAaCode
(
char
aa_letter)
const
;
65
66
/** @brief get the integer code of an amino acid enum
67
* @return integer 1 to 20, 0 if not found
68
*/
69
uint8_t
getAaCode
(
pappso::Enums::AminoAcidChar
aa)
const
;
70
71
72
/** @brief get the integer code of an amino acid given a mass and a precision
73
* @return integer 1 to 20, 0 if not found
74
*/
75
uint8_t
getAaCodeByMass
(
double
mass,
PrecisionPtr
precision)
const
;
76
77
/** @brief get the Aa object from the one letter code
78
*/
79
const
Aa
&
getAa
(
char
aa_letter)
const
;
80
81
/** @brief get the Aa object from the amino acid integer code
82
*/
83
const
Aa
&
getAa
(uint8_t aa_code)
const
;
84
85
86
/** @brief get the mass of the amino acid given its integer code
87
* the amino acid can bear some modification (if addAaModification function was used)
88
*/
89
double
getMass
(uint8_t aa_code)
const
;
90
double
getMass
(
char
aa_letter)
const
;
91
92
/** @brief add a modification on an amino acid
93
* for example carbamido on C
94
*/
95
void
addAaModification
(
char
aa_letter,
AaModificationP
aaModification);
96
97
/** @brief number of amino acid coded letters in this aa code
98
*
99
*/
100
std::size_t
getSize
()
const
;
101
102
const
std::vector<Aa> &
getAaCollection
()
const
;
103
104
private
:
105
/** @brief give a number (the code) to each amino acid sorted by mass
106
*/
107
void
updateNumbers
();
108
/** @brief update mass cache
109
*/
110
void
updateMass
();
111
112
private
:
113
std::vector<uint8_t>
m_asciiTable
;
114
115
std::vector<Aa>
m_aaCollection
;
116
std::vector<double>
m_massCollection
;
117
118
pappso::Aa
m_leucine
=
Aa
(
'L'
);
119
};
120
}
// namespace pappso
aa.h
pappso::AaCode::updateNumbers
void updateNumbers()
give a number (the code) to each amino acid sorted by mass
Definition
aacode.cpp:192
pappso::AaCode::addAaModification
void addAaModification(char aa_letter, AaModificationP aaModification)
add a modification on an amino acid for example carbamido on C
Definition
aacode.cpp:169
pappso::AaCode::m_massCollection
std::vector< double > m_massCollection
Definition
aacode.h:116
pappso::AaCode::m_asciiTable
std::vector< uint8_t > m_asciiTable
Definition
aacode.h:113
pappso::AaCode::updateMass
void updateMass()
update mass cache
Definition
aacode.cpp:212
pappso::AaCode::m_leucine
pappso::Aa m_leucine
Definition
aacode.h:118
pappso::AaCode::getAaCodeByMass
uint8_t getAaCodeByMass(double mass, PrecisionPtr precision) const
get the integer code of an amino acid given a mass and a precision
Definition
aacode.cpp:245
pappso::AaCode::AaCode
AaCode()
Definition
aacode.cpp:34
pappso::AaCode::getAaCollection
const std::vector< Aa > & getAaCollection() const
Definition
aacode.cpp:266
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::AaCode::getSize
std::size_t getSize() const
number of amino acid coded letters in this aa code
Definition
aacode.cpp:74
pappso::AaCode::m_aaCollection
std::vector< Aa > m_aaCollection
Definition
aacode.h:115
pappso::AaCode::getAa
const Aa & getAa(char aa_letter) const
get the Aa object from the one letter code
Definition
aacode.cpp:132
pappso::Aa
Definition
aa.h:45
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso::Enums::AminoAcidChar
AminoAcidChar
Definition
types.h:187
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::AaModificationP
const AaModification * AaModificationP
Definition
aamodification.h:52
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition
precision.h:122
precision.h
pappsomspp
core
amino_acid
aacode.h
Generated on
for libpappsomspp by
1.17.0