libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
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 "
pappsomspp/export-import-config.h
"
33
#include "
../amino_acid/aastringcodec.h
"
34
#include "
protein.h
"
35
#include <vector>
36
37
namespace
pappso
38
{
39
40
/**
41
* @brief
42
*/
43
class
PMSPP_LIB_DECL
ProteinIntegerCode
44
{
45
public
:
46
/**
47
* Default constructor
48
*/
49
ProteinIntegerCode
(
ProteinSp
protein,
50
const
AaStringCodec
&codec,
51
std::size_t aa_str_max_size = 5);
52
53
/**
54
* Copy constructor
55
*
56
* @param other TODO
57
*/
58
ProteinIntegerCode
(
const
ProteinIntegerCode
&other);
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
:
101
ProteinSp
msp_protein
;
102
103
std::vector<std::uint8_t>
m_seqAaCode
;
104
std::vector<std::vector<std::uint32_t>>
m_peptideCodedFragments
;
105
};
106
107
}
// namespace pappso
aastringcodec.h
pappso::AaStringCodec
code and decode amino acid string sequence to unique integer
Definition
aastringcodec.h:52
pappso::ProteinIntegerCode::getPeptideCodedFragment
const std::vector< std::uint32_t > & getPeptideCodedFragment(std::size_t size) const
Definition
proteinintegercode.cpp:107
pappso::ProteinIntegerCode::match
std::vector< std::pair< std::size_t, std::uint32_t > > match(const std::vector< uint32_t > &code_list) const
list of positions and matched codes along protein sequence
Definition
proteinintegercode.cpp:125
pappso::ProteinIntegerCode::convolution
std::vector< double > convolution(const std::vector< uint32_t > &code_list_from_spectrum) const
process convolution of spectrum code list along protein sequence
Definition
proteinintegercode.cpp:161
pappso::ProteinIntegerCode::getSeqAaCode
const std::vector< std::uint8_t > & getSeqAaCode() const
Definition
proteinintegercode.cpp:73
pappso::ProteinIntegerCode::m_seqAaCode
std::vector< std::uint8_t > m_seqAaCode
Definition
proteinintegercode.h:103
pappso::ProteinIntegerCode::convolutionKernel
double convolutionKernel(const std::vector< uint32_t > &spectrum_code_list, std::vector< std::uint8_t >::const_iterator it_aa, std::vector< std::uint32_t >::const_iterator it_couple, std::vector< std::uint32_t >::const_iterator it_trio, std::vector< std::uint32_t >::const_iterator it_quatro, std::vector< std::uint32_t >::const_iterator it_cinqo) const
Definition
proteinintegercode.cpp:186
pappso::ProteinIntegerCode::ProteinIntegerCode
ProteinIntegerCode(ProteinSp protein, const AaStringCodec &codec, std::size_t aa_str_max_size=5)
Definition
proteinintegercode.cpp:35
pappso::ProteinIntegerCode::m_peptideCodedFragments
std::vector< std::vector< std::uint32_t > > m_peptideCodedFragments
Definition
proteinintegercode.h:104
pappso::ProteinIntegerCode::msp_protein
ProteinSp msp_protein
Definition
proteinintegercode.h:101
pappso::ProteinIntegerCode::computePeptideCodeFragments
std::vector< std::uint32_t > computePeptideCodeFragments(const AaStringCodec &codec, std::size_t fragment_size) const
Definition
proteinintegercode.cpp:86
pappso::ProteinIntegerCode::getProteinSp
pappso::ProteinSp getProteinSp() const
Definition
proteinintegercode.cpp:79
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::ProteinSp
std::shared_ptr< const Protein > ProteinSp
shared pointer on a Protein object
Definition
protein.h:47
protein.h
pappsomspp
core
protein
proteinintegercode.h
Generated on
for libpappsomspp by
1.17.0