libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
tracepeaklist.cpp
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/detection/tracepeaklist.cpp
3
* \date 15/09/2021
4
* \author Olivier Langella
5
* \brief trace peak list
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2021 Olivier Langella
10
*<Olivier.Langella@universite-paris-saclay.fr>.
11
*
12
* This file is part of the PAPPSOms++ library.
13
*
14
* PAPPSOms++ is free software: you can redistribute it and/or modify
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation, either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* PAPPSOms++ is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU General Public License for more details.
23
*
24
* You should have received a copy of the GNU General Public License
25
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26
*
27
******************************************************************************/
28
29
30
#include "
tracepeaklist.h
"
31
32
using namespace
pappso
;
33
34
TracePeakList::TracePeakList
()
35
{
36
}
37
38
TracePeakList::TracePeakList
(
const
TracePeakList
&other) : std::vector<
TracePeak
>(other)
39
{
40
}
41
42
TracePeakList::~TracePeakList
()
43
{
44
}
45
46
void
47
pappso::TracePeakList::setTracePeak
(
pappso::TracePeak
&xic_peak)
48
{
49
push_back(xic_peak);
50
}
51
52
53
std::vector<TracePeak>::iterator
54
pappso::findBestTracePeakGivenRtList
(std::vector<TracePeak>::iterator begin,
55
std::vector<TracePeak>::iterator end,
56
const
std::vector<double> &rt_list,
57
std::size_t &nb_peaks)
58
{
59
// get peak containing rt ahead :
60
auto
itend = std::partition(begin, end, [rt_list](
const
TracePeak
&
a
) {
61
for
(
double
rt : rt_list)
62
{
63
if
(
a
.containsRt(rt))
64
{
65
return
true
;
66
};
67
}
68
return
false
;
69
});
70
nb_peaks = std::distance(begin, itend);
71
if
(nb_peaks == 0)
72
return
end;
73
return
std::max_element(
74
begin, itend, [](
const
TracePeak
&
a
,
const
TracePeak
&
b
) {
return
a
.getArea() <
b
.getArea(); });
75
}
76
77
std::vector<TracePeak>::iterator
78
pappso::findTracePeakGivenRt
(std::vector<TracePeak>::iterator begin,
79
std::vector<TracePeak>::iterator end,
80
double
rt)
81
{
82
return
find_if(begin, end, [rt](
const
TracePeak
&
a
) {
return
a
.containsRt(rt); });
83
}
pappso::TracePeakList::TracePeakList
TracePeakList()
Definition
tracepeaklist.cpp:34
pappso::TracePeakList::~TracePeakList
virtual ~TracePeakList()
Definition
tracepeaklist.cpp:42
pappso::TracePeakList::setTracePeak
virtual void setTracePeak(TracePeak &xic_peak) override
Definition
tracepeaklist.cpp:47
pappso::TracePeak
Definition
tracepeak.h:40
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::findBestTracePeakGivenRtList
PMSPP_LIB_DECL std::vector< TracePeak >::iterator findBestTracePeakGivenRtList(std::vector< TracePeak >::iterator begin, std::vector< TracePeak >::iterator end, const std::vector< double > &rt_list, std::size_t &nb_peaks)
find the best peak matching a list of retention times
Definition
tracepeaklist.cpp:54
pappso::findTracePeakGivenRt
PMSPP_LIB_DECL std::vector< TracePeak >::iterator findTracePeakGivenRt(std::vector< TracePeak >::iterator begin, std::vector< TracePeak >::iterator end, double rt)
find the peak matching a retention time
Definition
tracepeaklist.cpp:78
pappso::PeptideIonNter::a
@ a
Definition
peptide.h:77
pappso::PeptideIonNter::b
@ b
Definition
peptide.h:74
tracepeaklist.h
pappsomspp
core
processing
detection
tracepeaklist.cpp
Generated on
for libpappsomspp by
1.17.0