libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
aastringcodemassmatching.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/amino_acid/aastringcodemassmatching.h
3 * \date 10/05/2023
4 * \author Olivier Langella
5 * \brief convert mass list to amino acid string code list
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 "../exportinmportconfig.h"
31#include "aastringcodec.h"
32#include "../mzrange.h"
33
34namespace pappso
35{
36
37/**
38 * @brief convert a list of mass to amino acid string codes
39 */
41{
42 public:
43 /**
44 * Default constructor
45 */
46 AaStringCodeMassMatching(const AaCode &aa_code,
47 std::size_t model_max_size,
48 PrecisionPtr precision);
49
50 /**
51 * Copy constructor
52 *
53 * @param other TODO
54 */
56
57 /**
58 * Destructor
59 */
61
62 PrecisionPtr getPrecisionPtr() const;
63
64
65 /** @brief get amino acid string code from mass delta list
66 * mass delta is a list of masses differences found in a spectrum
67 * see @file /pappsomspp/filers/filtepeakdelta.h functions
68 */
69 std::vector<uint32_t>
70 getAaCodeFromMassList(std::vector<double> &mass_list) const;
71
72
73 /** @brief get amino acid string code from a single mass delta
74 * @param mass the mass to look for
75 */
76 std::vector<uint32_t> getAaCodeFromMass(double mass) const;
77
78
79 /** @brief get amino acid string code from a single mass delta wearing a
80 * specific modification
81 * @param mass the mass to look for
82 * @param aa amino acid with modification
83 * @param quantifier the minimum number of this aa modified required in the
84 * given aa sequence
85 */
86 std::vector<uint32_t> getAaCodeFromMassWearingModification(
87 double mass, const Aa &aa, int quantifier) const;
88
89
90 /** @brief filter a list of amino acid string code
91 * find elementary amino acids (one base only) in the list and retrieve 2 or
92 * more amino acid string containing only basic aminio acid found
93 */
94 std::vector<uint32_t> filterCodeList(std::vector<uint32_t> &code_list) const;
95
96 private:
97 PrecisionPtr m_precision = nullptr;
99
101
102
103 uint32_t m_base = 0;
104
106 {
107 std::uint32_t code = 0;
108 double mz_range_low = 0;
109 double mz = 0;
110 double mz_range_up = 0;
111 };
112
113 std::vector<aaCodeAndMassRange> m_codeMassList;
114};
115} // namespace pappso
code and decodefrom amino acid string to integer
collection of integer code for each amino acid 0 => null 1 to 20 => amino acid sorted by there mass (...
Definition aacode.h:43
convert a list of mass to amino acid string codes
std::vector< aaCodeAndMassRange > m_codeMassList
code and decode amino acid string sequence to unique integer
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39