libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
filterms1windowselection.cpp
Go to the documentation of this file.
1
/**
2
* \file core/filter/filterms1windowselection.cpp
3
* \date 28/09/2026
4
* \author Olivier Langella
5
* \brief filter extract ms1 window selection
6
*/
7
8
9
/*
10
* PeptidOMS, Spectra to protein alignment tool
11
* Copyright (C) 2026 Olivier Langella
12
* <olivier.langella@cnrs.fr>
13
*
14
* This program 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
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
26
*
27
*/
28
29
#include "
filterms1windowselection.h
"
30
#include <qlogging.h>
31
#include <qvariant.h>
32
#include "
pappsomspp/core/exception/exceptionnotpossible.h
"
33
#include "
pappsomspp/core/processing/cbor/mzcbor/precursor.h
"
34
#include "
pappsomspp/core/processing/filters/filterresample.h
"
35
36
FilterMs1WindowSelection::FilterMs1WindowSelection
(
37
const
pappso::cbor::mzcbor::QcborSpectrumPrecursor
&precursor)
38
{
39
qDebug();
40
pappso::cbor::mzcbor::IsolationWindow
isolation_window = precursor.
getIsolationWindow
();
41
m_targetMz
= isolation_window.
getTargetMz
();
42
m_lowerMz
= isolation_window.
getLowerMz
();
43
m_upperMz
= isolation_window.
getUpperMz
();
44
45
46
if
((
m_upperMz
== 0) || (
m_lowerMz
== 0))
47
{
48
throw
pappso::ExceptionNotPossible
(
49
QObject::tr(
"ERROR: unable to find isolation Window in precursor"
));
50
}
51
}
52
53
FilterMs1WindowSelection::FilterMs1WindowSelection
(
const
FilterMs1WindowSelection
&other)
54
:
m_targetMz
(other.
m_targetMz
),
m_lowerMz
(other.
m_lowerMz
),
m_upperMz
(other.
m_upperMz
)
55
{
56
}
57
58
/**
59
* Destructor
60
*/
61
FilterMs1WindowSelection::~FilterMs1WindowSelection
()
62
{
63
}
64
65
66
pappso::Trace
&
67
FilterMs1WindowSelection::filter
(
pappso::Trace
&data_points)
const
68
{
69
pappso::FilterResampleKeepSmaller
(
m_upperMz
).
filter
(data_points);
70
pappso::FilterResampleKeepGreater
(
m_lowerMz
).
filter
(data_points);
71
return
data_points;
72
}
FilterMs1WindowSelection::~FilterMs1WindowSelection
virtual ~FilterMs1WindowSelection()
Definition
filterms1windowselection.cpp:61
FilterMs1WindowSelection::m_targetMz
double m_targetMz
Definition
filterms1windowselection.h:69
FilterMs1WindowSelection::filter
pappso::Trace & filter(pappso::Trace &data_points) const override
Definition
filterms1windowselection.cpp:67
FilterMs1WindowSelection::m_upperMz
double m_upperMz
Definition
filterms1windowselection.h:71
FilterMs1WindowSelection::FilterMs1WindowSelection
FilterMs1WindowSelection(const pappso::cbor::mzcbor::QcborSpectrumPrecursor &precursor)
Definition
filterms1windowselection.cpp:36
FilterMs1WindowSelection::m_lowerMz
double m_lowerMz
Definition
filterms1windowselection.h:70
pappso::ExceptionNotPossible
Definition
exceptionnotpossible.h:29
pappso::FilterResampleKeepGreater
Definition
filterresample.h:55
pappso::FilterResampleKeepGreater::filter
Trace & filter(Trace &trace) const override
Definition
filterresample.cpp:79
pappso::FilterResampleKeepSmaller
Definition
filterresample.h:42
pappso::FilterResampleKeepSmaller::filter
Trace & filter(Trace &trace) const override
Definition
filterresample.cpp:47
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
pappso::cbor::mzcbor::QcborSpectrumPrecursor
Definition
qcborspectrumprecursor.h:47
pappso::cbor::mzcbor::QcborSpectrumPrecursor::getIsolationWindow
IsolationWindow getIsolationWindow() const
Definition
qcborspectrumprecursor.cpp:85
exceptionnotpossible.h
filterms1windowselection.h
filterresample.h
precursor.h
PSI precursor object for mzML/mzCBOR.
pappso::cbor::mzcbor::IsolationWindow
Definition
precursor.h:43
pappso::cbor::mzcbor::IsolationWindow::getUpperMz
double getUpperMz() const
compute isolation window upper m/z given cvParam informations
Definition
precursor.cpp:141
pappso::cbor::mzcbor::IsolationWindow::getLowerMz
double getLowerMz() const
compute isolation window lower m/z given cvParam informations
Definition
precursor.cpp:104
pappso::cbor::mzcbor::IsolationWindow::getTargetMz
double getTargetMz() const
get isolation window target m/z given cvParam informations
Definition
precursor.cpp:86
pappsomspp
core
processing
cbor
mzcbor
copyreplace
filterms1windowselection.cpp
Generated on
for libpappsomspp by
1.17.0