libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
proteinintegercode.h
Go to the documentation of this file.
1/**
2 * \file protein/proteinintegercode.h
3 * \date 22/05/2023
4 * \author Olivier Langella
5 * \brief transform protein amino acid sequence into vectors of amino acid codes
6 */
7
8
9/*******************************************************************************
10 * Copyright (c) 2023 Olivier Langella
11 *<Olivier.Langella@universite-paris-saclay.fr>.
12 *
13 * This file is part of PAPPSOms++.
14 *
15 * PAPPSOms++ is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PAPPSOms++ is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
27 *
28 ******************************************************************************/
29
30#pragma once
31
32#include "../exportinmportconfig.h"
33#include "../amino_acid/aastringcodec.h"
34#include "protein.h"
35#include <vector>
36
37namespace pappso
38{
39
40/**
41 * @brief
42 */
44{
45 public:
46 /**
47 * Default constructor
48 */
50 const AaStringCodec &codec,
51 std::size_t aa_str_max_size = 5);
52
53 /**
54 * Copy constructor
55 *
56 * @param other TODO
57 */
59
60 /**
61 * Destructor
62 */
63 virtual ~ProteinIntegerCode();
64
65 const std::vector<std::uint8_t> &getSeqAaCode() const;
66
67 const std::vector<std::uint32_t> &
68 getPeptideCodedFragment(std::size_t size) const;
69
70
71 /** @brief list of positions and matched codes along protein sequence
72 */
73 std::vector<std::pair<std::size_t, std::uint32_t>>
74 match(const std::vector<uint32_t> &code_list) const;
75
76
77 /** @brief process convolution of spectrum code list along protein sequence
78 *
79 * @param code_list_from_spectrum unique sorted sequence codes given by the
80 * spectrum decoder
81 */
82 std::vector<double>
83 convolution(const std::vector<uint32_t> &code_list_from_spectrum) const;
84
85 pappso::ProteinSp getProteinSp() const;
86
87 private:
88 std::vector<std::uint32_t>
89 computePeptideCodeFragments(const AaStringCodec &codec,
90 std::size_t fragment_size) const;
91
92 double
93 convolutionKernel(const std::vector<uint32_t> &spectrum_code_list,
94 std::vector<std::uint8_t>::const_iterator it_aa,
95 std::vector<std::uint32_t>::const_iterator it_couple,
96 std::vector<std::uint32_t>::const_iterator it_trio,
97 std::vector<std::uint32_t>::const_iterator it_quatro,
98 std::vector<std::uint32_t>::const_iterator it_cinqo) const;
99
100 private:
102
103 std::vector<std::uint8_t> m_seqAaCode;
104 std::vector<std::vector<std::uint32_t>> m_peptideCodedFragments;
105};
106
107} // namespace pappso
std::vector< std::uint8_t > m_seqAaCode
std::vector< std::vector< std::uint32_t > > m_peptideCodedFragments
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const Protein > ProteinSp
shared pointer on a Protein object
Definition protein.h:47
object to handle a protein