libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
correctiontree.cpp
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/specpeptidoms/correctiontree.cpp
3
* \date 24/03/2025
4
* \author Aurélien Berthier
5
* \brief save corrections to apply
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
#include "
correctiontree.h
"
33
34
#include <QDebug>
35
36
pappso::specpeptidoms::CorrectionTree::CorrectionTree
() :
peak
(0)
37
{
38
}
39
40
pappso::specpeptidoms::CorrectionTree::CorrectionTree
(std::size_t
peak
) :
peak
(
peak
)
41
{
42
}
43
44
pappso::specpeptidoms::CorrectionTree::~CorrectionTree
()
45
{
46
}
47
48
void
49
pappso::specpeptidoms::CorrectionTree::addPeaks
(std::size_t peak1, std::size_t peak2)
50
{
51
if
(
msp_left
!=
nullptr
)
52
{
53
msp_left
->addPeaks(peak1, peak2);
54
msp_right
->addPeaks(peak1, peak2);
55
}
56
else
57
{
58
msp_left
= std::make_shared<CorrectionTree>(
CorrectionTree
(peak1));
59
msp_right
= std::make_shared<CorrectionTree>(
CorrectionTree
(peak2));
60
}
61
}
62
63
std::vector<std::vector<std::size_t>>
64
pappso::specpeptidoms::CorrectionTree::getPeaks
()
const
65
{
66
std::vector<std::vector<std::size_t>> v_left, v_right;
67
if
(
peak
== 0 &&
msp_left
!=
nullptr
)
68
{
69
v_left =
msp_left
->getPeaks();
70
v_right =
msp_right
->getPeaks();
71
v_left.insert(v_left.end(), v_right.begin(), v_right.end());
72
}
73
else
if
(
peak
> 0 &&
msp_left
!=
nullptr
)
74
{
75
v_left =
msp_left
->getPeaks();
76
v_right =
msp_right
->getPeaks();
77
v_left.insert(v_left.end(), v_right.begin(), v_right.end());
78
for
(
auto
vec = v_left.begin(); vec != v_left.end(); vec++)
79
{
80
vec->push_back(
peak
);
81
}
82
}
83
else
if
(
peak
> 0)
84
{
85
v_left.push_back({
peak
});
86
}
87
return
v_left;
88
}
pappso::specpeptidoms::CorrectionTree::getPeaks
std::vector< std::vector< std::size_t > > getPeaks() const
Definition
correctiontree.cpp:64
pappso::specpeptidoms::CorrectionTree::msp_left
CorrectionTreeSp msp_left
Definition
correctiontree.h:56
pappso::specpeptidoms::CorrectionTree::peak
std::size_t peak
Definition
correctiontree.h:55
pappso::specpeptidoms::CorrectionTree::CorrectionTree
CorrectionTree()
Definition
correctiontree.cpp:36
pappso::specpeptidoms::CorrectionTree::msp_right
CorrectionTreeSp msp_right
Definition
correctiontree.h:56
pappso::specpeptidoms::CorrectionTree::addPeaks
void addPeaks(std::size_t peak1, std::size_t peak2)
Definition
correctiontree.cpp:49
pappso::specpeptidoms::CorrectionTree::~CorrectionTree
~CorrectionTree()
Definition
correctiontree.cpp:44
correctiontree.h
pappsomspp
core
processing
specpeptidoms
correctiontree.cpp
Generated on
for libpappsomspp by
1.17.0