libpappsomspp
Library for mass spectrometry
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
31#include <vector>
32#include "aa.h"
33
34namespace pappso
35{
36/**
37 * @brief collection of integer code for each amino acid
38 * 0 => null
39 * 1 to 20 => amino acid sorted by there mass (lower to higher). Leucine is
40 * replaced by Isoleucine
41 */
43{
44 public:
45 /**
46 * Default constructor
47 */
48 AaCode();
49
50 /**
51 * Default copy constructor
52 */
53 AaCode(const AaCode &other);
54
55 /**
56 * Destructor
57 */
58 ~AaCode();
59
60 uint8_t getAaCode(char aa_letter) const;
61
62 const Aa &getAa(char aa_letter) const;
63 const Aa &getAa(uint8_t aa_code) const;
64
65
66 double getMass(uint8_t aa_code) const;
67
68 void addAaModification(char aa_letter, AaModificationP aaModification);
69
70 std::size_t getSize() const;
71
72 private:
73 /** @brief give a number (the code) to each amino acid sorted by mass
74 */
75 void updateNumbers();
76 /** @brief update mass cache
77 */
78 void updateMass();
79
80 private:
81 std::vector<uint8_t> m_asciiTable;
82
83 std::vector<Aa> m_aaCollection;
84 std::vector<double> m_massCollection;
85};
86} // namespace pappso
collection of integer code for each amino acid 0 => null 1 to 20 => amino acid sorted by there mass (...
Definition aacode.h:43
std::vector< double > m_massCollection
Definition aacode.h:84
std::vector< uint8_t > m_asciiTable
Definition aacode.h:81
std::vector< Aa > m_aaCollection
Definition aacode.h:83
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39