libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
filterlowintensitysignalremoval.h
Go to the documentation of this file.
1
/* BEGIN software license
2
*
3
* msXpertSuite - mass spectrometry software suite
4
* -----------------------------------------------
5
* Copyright(C) 2009,...,2021 Filippo Rusconi
6
*
7
* http://www.msxpertsuite.org
8
*
9
* This file is part of the msXpertSuite project.
10
*
11
* The msXpertSuite project is the successor of the massXpert project. This
12
* project now includes various independent modules:
13
*
14
* - massXpert, model polymer chemistries and simulate mass spectrometric data;
15
* - mineXpert, a powerful TIC chromatogram/mass spectrum viewer/miner;
16
*
17
* This program is free software: you can redistribute it and/or modify
18
* it under the terms of the GNU General Public License as published by
19
* the Free Software Foundation, either version 3 of the License, or
20
* (at your option) any later version.
21
*
22
* This program is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
* GNU General Public License for more details.
26
*
27
* You should have received a copy of the GNU General Public License
28
* along with this program. If not, see <http://www.gnu.org/licenses/>.
29
*
30
* END software license
31
*/
32
33
34
#pragma once
35
36
37
#include <QObject>
38
39
#include "
../../trace/trace.h
"
40
#include "
pappsomspp/export-import-config.h
"
41
#include "
filternameinterface.h
"
42
43
44
namespace
pappso
45
{
46
47
48
class
FilterLowIntensitySignalRemoval
;
49
50
typedef
std::shared_ptr<FilterLowIntensitySignalRemoval>
51
FilterLowIntensitySignalRemovalSPtr
;
52
typedef
std::shared_ptr<const FilterLowIntensitySignalRemoval>
53
FilterLowIntensitySignalRemovalCstSPtr
;
54
55
56
/**
57
* @brief Redefines the floor intensity of the Trace
58
*
59
* The amplitude of the trace is computed (maxValue - minValue)
60
* Its fraction is calculated = amplitude * (percentage / 100)
61
* The threshold value is computed as (minValue + fraction)
62
*
63
* When the values to be filtered are below that threshold they acquire that
64
* threshold value.
65
*
66
* When the values to be filtered are above that threshold they remain
67
* unchanged.
68
*
69
* This effectively re-floors the values to threshold.
70
*/
71
class
PMSPP_LIB_DECL
FilterLowIntensitySignalRemoval
72
:
public
FilterNameInterface
73
{
74
public
:
75
FilterLowIntensitySignalRemoval
(
double
mean,
76
double
std_dev,
77
double
threshold);
78
FilterLowIntensitySignalRemoval
(
const
QString ¶meters);
79
FilterLowIntensitySignalRemoval
(
const
FilterLowIntensitySignalRemoval
&other);
80
81
virtual
~FilterLowIntensitySignalRemoval
();
82
83
FilterLowIntensitySignalRemoval
&
84
operator=
(
const
FilterLowIntensitySignalRemoval
&other);
85
86
Trace
&
filter
(
Trace
&data_points)
const override
;
87
88
double
getThreshold
()
const
;
89
QString
name
()
const override
;
90
91
QString
toString
()
const override
;
92
93
protected
:
94
void
buildFilterFromString
(
const
QString &strBuildParams)
override
;
95
96
Trace
&
nonConstFilter
(
Trace
&data_points);
97
98
std::size_t
detectClusterApices
(
const
Trace
&trace);
99
100
Trace::const_iterator
backwardFindApex
(
const
Trace
&trace,
101
Trace::const_iterator iter,
102
double
distance_threshold);
103
104
Trace::const_iterator
forwardFindApex
(
const
Trace
&trace,
105
Trace::const_iterator iter,
106
double
distance_threshold);
107
Trace
reconstructTrace
(
const
Trace
&trace);
108
109
private
:
110
static
constexpr
double
nan
= std::numeric_limits<double>::quiet_NaN();
111
112
double
m_threshold
;
113
double
m_noiseMean
;
114
double
m_noiseStdDev
;
115
116
constexpr
static
double
INTRA_CLUSTER_INTER_PEAK_DISTANCE
= 1.1;
117
118
const
std::size_t
m_minIntPointCount
= 5;
119
const
std::size_t
m_minIntStdDevFactor
= 2;
120
121
double
m_min
;
122
double
m_max
;
123
double
m_minMean
;
124
double
m_minStdDev
;
125
double
m_noiseLevel
;
126
127
bool
m_seen_upward_phase
=
false
;
128
129
using
TraceCIter
= Trace::const_iterator;
130
131
// Beware HYPER-ROUGH inialization of the iterator !
132
TraceCIter
m_prevApex
=
static_cast<
Trace::const_iterator
>
(0);
133
TraceCIter
m_curApex
=
static_cast<
Trace::const_iterator
>
(0);
134
TraceCIter
m_curIter
=
static_cast<
Trace::const_iterator
>
(0);
135
TraceCIter
m_prevIter
=
static_cast<
Trace::const_iterator
>
(0);
136
137
using
ClusterApices
= std::vector<TraceCIter>;
138
using
ApicesSPtr
= std::shared_ptr<ClusterApices>;
139
140
// All the cluster apices
141
std::vector<ApicesSPtr>
m_clusters
;
142
};
143
}
// namespace pappso
pappso::FilterLowIntensitySignalRemoval
Redefines the floor intensity of the Trace.
Definition
filterlowintensitysignalremoval.h:73
pappso::FilterLowIntensitySignalRemoval::m_curApex
TraceCIter m_curApex
Definition
filterlowintensitysignalremoval.h:133
pappso::FilterLowIntensitySignalRemoval::m_minIntStdDevFactor
const std::size_t m_minIntStdDevFactor
Definition
filterlowintensitysignalremoval.h:119
pappso::FilterLowIntensitySignalRemoval::nonConstFilter
Trace & nonConstFilter(Trace &data_points)
Definition
filterlowintensitysignalremoval.cpp:614
pappso::FilterLowIntensitySignalRemoval::ApicesSPtr
std::shared_ptr< ClusterApices > ApicesSPtr
Definition
filterlowintensitysignalremoval.h:138
pappso::FilterLowIntensitySignalRemoval::ClusterApices
std::vector< TraceCIter > ClusterApices
Definition
filterlowintensitysignalremoval.h:137
pappso::FilterLowIntensitySignalRemoval::m_noiseLevel
double m_noiseLevel
Definition
filterlowintensitysignalremoval.h:125
pappso::FilterLowIntensitySignalRemoval::backwardFindApex
Trace::const_iterator backwardFindApex(const Trace &trace, Trace::const_iterator iter, double distance_threshold)
Definition
filterlowintensitysignalremoval.cpp:397
pappso::FilterLowIntensitySignalRemoval::m_curIter
TraceCIter m_curIter
Definition
filterlowintensitysignalremoval.h:134
pappso::FilterLowIntensitySignalRemoval::name
QString name() const override
Definition
filterlowintensitysignalremoval.cpp:665
pappso::FilterLowIntensitySignalRemoval::FilterLowIntensitySignalRemoval
FilterLowIntensitySignalRemoval(double mean, double std_dev, double threshold)
Definition
filterlowintensitysignalremoval.cpp:52
pappso::FilterLowIntensitySignalRemoval::getThreshold
double getThreshold() const
Definition
filterlowintensitysignalremoval.cpp:646
pappso::FilterLowIntensitySignalRemoval::m_noiseMean
double m_noiseMean
Definition
filterlowintensitysignalremoval.h:113
pappso::FilterLowIntensitySignalRemoval::m_minStdDev
double m_minStdDev
Definition
filterlowintensitysignalremoval.h:124
pappso::FilterLowIntensitySignalRemoval::reconstructTrace
Trace reconstructTrace(const Trace &trace)
Definition
filterlowintensitysignalremoval.cpp:535
pappso::FilterLowIntensitySignalRemoval::filter
Trace & filter(Trace &data_points) const override
Definition
filterlowintensitysignalremoval.cpp:604
pappso::FilterLowIntensitySignalRemoval::m_prevApex
TraceCIter m_prevApex
Definition
filterlowintensitysignalremoval.h:132
pappso::FilterLowIntensitySignalRemoval::forwardFindApex
Trace::const_iterator forwardFindApex(const Trace &trace, Trace::const_iterator iter, double distance_threshold)
Definition
filterlowintensitysignalremoval.cpp:466
pappso::FilterLowIntensitySignalRemoval::m_threshold
double m_threshold
Definition
filterlowintensitysignalremoval.h:112
pappso::FilterLowIntensitySignalRemoval::detectClusterApices
std::size_t detectClusterApices(const Trace &trace)
Definition
filterlowintensitysignalremoval.cpp:131
pappso::FilterLowIntensitySignalRemoval::m_minIntPointCount
const std::size_t m_minIntPointCount
Definition
filterlowintensitysignalremoval.h:118
pappso::FilterLowIntensitySignalRemoval::m_min
double m_min
Definition
filterlowintensitysignalremoval.h:121
pappso::FilterLowIntensitySignalRemoval::operator=
FilterLowIntensitySignalRemoval & operator=(const FilterLowIntensitySignalRemoval &other)
Definition
filterlowintensitysignalremoval.cpp:88
pappso::FilterLowIntensitySignalRemoval::m_seen_upward_phase
bool m_seen_upward_phase
Definition
filterlowintensitysignalremoval.h:127
pappso::FilterLowIntensitySignalRemoval::INTRA_CLUSTER_INTER_PEAK_DISTANCE
static constexpr double INTRA_CLUSTER_INTER_PEAK_DISTANCE
Definition
filterlowintensitysignalremoval.h:116
pappso::FilterLowIntensitySignalRemoval::m_max
double m_max
Definition
filterlowintensitysignalremoval.h:122
pappso::FilterLowIntensitySignalRemoval::TraceCIter
Trace::const_iterator TraceCIter
Definition
filterlowintensitysignalremoval.h:129
pappso::FilterLowIntensitySignalRemoval::m_minMean
double m_minMean
Definition
filterlowintensitysignalremoval.h:123
pappso::FilterLowIntensitySignalRemoval::m_noiseStdDev
double m_noiseStdDev
Definition
filterlowintensitysignalremoval.h:114
pappso::FilterLowIntensitySignalRemoval::m_prevIter
TraceCIter m_prevIter
Definition
filterlowintensitysignalremoval.h:135
pappso::FilterLowIntensitySignalRemoval::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition
filterlowintensitysignalremoval.cpp:102
pappso::FilterLowIntensitySignalRemoval::nan
static constexpr double nan
Definition
filterlowintensitysignalremoval.h:110
pappso::FilterLowIntensitySignalRemoval::toString
QString toString() const override
Return a string with the textual representation of the configuration data.
Definition
filterlowintensitysignalremoval.cpp:654
pappso::FilterLowIntensitySignalRemoval::m_clusters
std::vector< ApicesSPtr > m_clusters
Definition
filterlowintensitysignalremoval.h:141
pappso::FilterNameInterface
Interface that allows to build filter objects from strings.
Definition
filternameinterface.h:42
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
filternameinterface.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::FilterLowIntensitySignalRemovalCstSPtr
std::shared_ptr< const FilterLowIntensitySignalRemoval > FilterLowIntensitySignalRemovalCstSPtr
Definition
filterlowintensitysignalremoval.h:53
pappso::FilterLowIntensitySignalRemovalSPtr
std::shared_ptr< FilterLowIntensitySignalRemoval > FilterLowIntensitySignalRemovalSPtr
Definition
filterlowintensitysignalremoval.h:51
trace.h
pappsomspp
core
processing
filters
filterlowintensitysignalremoval.h
Generated on
for libpappsomspp by
1.17.0