libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
scenario.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/specpeptidoms/scenario.h
3
* \date 24/03/2025
4
* \author Aurélien Berthier
5
* \brief backtracking of 2nd alignment
6
*
7
* C++ implementation of the SpecPeptidOMS algorithm described in :
8
* (1) Benoist, É.; Jean, G.; Rogniaux, H.; Fertin, G.; Tessier, D. SpecPeptidOMS Directly and
9
* Rapidly Aligns Mass Spectra on Whole Proteomes and Identifies Peptides That Are Not Necessarily
10
* Tryptic: Implications for Peptidomics. J. Proteome Res. 2025.
11
* https://doi.org/10.1021/acs.jproteome.4c00870.
12
*/
13
14
/*
15
* Copyright (c) 2025 Aurélien Berthier
16
* <aurelien.berthier@ls2n.fr>
17
*
18
* This program is free software: you can redistribute it and/or modify
19
* it under the terms of the GNU General Public License as published by
20
* the Free Software Foundation, either version 3 of the License, or
21
* (at your option) any later version.
22
*
23
* This program is distributed in the hope that it will be useful,
24
* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
* GNU General Public License for more details.
27
*
28
* You should have received a copy of the GNU General Public License
29
* along with this program. If not, see <http://www.gnu.org/licenses/>.
30
*/
31
32
#pragma once
33
34
#include <cstddef>
35
#include <vector>
36
#include "
pappsomspp/core/processing/specpeptidoms/types.h
"
37
38
namespace
pappso
39
{
40
namespace
specpeptidoms
41
{
42
struct
ScenarioCell
43
{
44
std::size_t
previous_row
,
previous_column
;
45
AlignType
alignment_type
;
46
};
47
48
// struct InterpretationCell
49
// {
50
// uint8_t aa;
51
// double shift;
52
// bool found_aa;
53
// };
54
55
class
Scenario
56
{
57
public
:
58
/**
59
* Constructor
60
*/
61
Scenario
();
62
63
/**
64
* Destructor
65
*/
66
~Scenario
();
67
68
/**
69
* @brief Stores the origin (cell location and alignment type) of the provided cell in the
70
* backtracking matrix
71
*/
72
void
saveOrigin
(std::size_t current_row,
73
std::size_t current_column,
74
std::size_t previous_row,
75
std::size_t previous_column,
76
int
score,
77
AlignType
alignment_type);
78
79
/**
80
* @brief Allocate new storage to the backtracking matrix if needed
81
*/
82
void
reserve
(std::size_t n_rows, std::size_t n_columns);
83
84
/**
85
* @brief Returns the scenario cells corresponding to the best alignment and the best alignment's
86
* score
87
*/
88
std::pair<std::vector<ScenarioCell>,
int
>
getBestAlignment
()
const
;
89
90
int
getBestScore
()
const
;
91
92
void
resetScenario
();
93
94
void
clear
();
95
96
private
:
97
std::vector<std::vector<ScenarioCell>>
m_origin_matrix
;
98
std::pair<ScenarioCell, int>
m_best_alignment
= {{0, 0,
AlignType::init
}, -15};
99
};
100
}
// namespace specpeptidoms
101
}
// namespace pappso
pappso::specpeptidoms::Scenario::Scenario
Scenario()
Definition
scenario.cpp:75
pappso::specpeptidoms::Scenario::saveOrigin
void saveOrigin(std::size_t current_row, std::size_t current_column, std::size_t previous_row, std::size_t previous_column, int score, AlignType alignment_type)
Stores the origin (cell location and alignment type) of the provided cell in the backtracking matrix.
Definition
scenario.cpp:42
pappso::specpeptidoms::Scenario::m_best_alignment
std::pair< ScenarioCell, int > m_best_alignment
Definition
scenario.h:98
pappso::specpeptidoms::Scenario::getBestScore
int getBestScore() const
Definition
scenario.cpp:107
pappso::specpeptidoms::Scenario::clear
void clear()
Definition
scenario.cpp:120
pappso::specpeptidoms::Scenario::m_origin_matrix
std::vector< std::vector< ScenarioCell > > m_origin_matrix
Definition
scenario.h:97
pappso::specpeptidoms::Scenario::resetScenario
void resetScenario()
Definition
scenario.cpp:113
pappso::specpeptidoms::Scenario::reserve
void reserve(std::size_t n_rows, std::size_t n_columns)
Allocate new storage to the backtracking matrix if needed.
Definition
scenario.cpp:84
pappso::specpeptidoms::Scenario::~Scenario
~Scenario()
Definition
scenario.cpp:79
pappso::specpeptidoms::Scenario::getBestAlignment
std::pair< std::vector< ScenarioCell >, int > getBestAlignment() const
Returns the scenario cells corresponding to the best alignment and the best alignment's score.
Definition
scenario.cpp:91
pappso::specpeptidoms
Definition
correctiontree.h:40
pappso::specpeptidoms::AlignType
AlignType
Definition
types.h:51
pappso::specpeptidoms::AlignType::init
@ init
Definition
types.h:56
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
types.h
pappso::specpeptidoms::ScenarioCell
Definition
scenario.h:43
pappso::specpeptidoms::ScenarioCell::alignment_type
AlignType alignment_type
Definition
scenario.h:45
pappso::specpeptidoms::ScenarioCell::previous_column
std::size_t previous_column
Definition
scenario.h:44
pappso::specpeptidoms::ScenarioCell::previous_row
std::size_t previous_row
Definition
scenario.h:44
pappsomspp
core
processing
specpeptidoms
scenario.h
Generated on
for libpappsomspp by
1.17.0