libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::FilterHighPassPercentage Class Reference

remove datapoints below a given intensity percentage (ratio) of the maximum intensity More...

#include <filterpass.h>

Inheritance diagram for pappso::FilterHighPassPercentage:
pappso::FilterInterface

Public Member Functions

 FilterHighPassPercentage (double y_ratio)
 FilterHighPassPercentage (const FilterHighPassPercentage &other)
virtual ~FilterHighPassPercentage ()
FilterHighPassPercentageoperator= (const FilterHighPassPercentage &other)
Tracefilter (Trace &data_points) const override
Public Member Functions inherited from pappso::FilterInterface
virtual ~FilterInterface ()

Private Attributes

double m_ratioPassY = 0

Detailed Description

remove datapoints below a given intensity percentage (ratio) of the maximum intensity

Definition at line 75 of file filterpass.h.

Constructor & Destructor Documentation

◆ FilterHighPassPercentage() [1/2]

FilterHighPassPercentage::FilterHighPassPercentage ( double y_ratio)

Definition at line 104 of file filterpass.cpp.

104 : m_ratioPassY(ratio_pass_y)
105{
106}

References m_ratioPassY.

Referenced by FilterHighPassPercentage(), and operator=().

◆ FilterHighPassPercentage() [2/2]

FilterHighPassPercentage::FilterHighPassPercentage ( const FilterHighPassPercentage & other)

Definition at line 108 of file filterpass.cpp.

110{
111}

References FilterHighPassPercentage(), and m_ratioPassY.

◆ ~FilterHighPassPercentage()

virtual pappso::FilterHighPassPercentage::~FilterHighPassPercentage ( )
inlinevirtual

Definition at line 81 of file filterpass.h.

81{};

Member Function Documentation

◆ filter()

Trace & FilterHighPassPercentage::filter ( Trace & data_points) const
overridevirtual

Implements pappso::FilterInterface.

Definition at line 123 of file filterpass.cpp.

124{
125 auto it_max = maxYDataPoint(data_points.begin(), data_points.end());
126 if(it_max == data_points.end())
127 return data_points;
128 double pass = (it_max->y * m_ratioPassY);
129 Trace new_data_points;
130 for(auto &&data_point : data_points)
131 {
132 if(data_point.y > pass)
133 {
134 new_data_points.push_back(data_point);
135 }
136 }
137 data_points = std::move(new_data_points);
138 return data_points;
139}
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
Definition trace.cpp:169

References m_ratioPassY, and pappso::maxYDataPoint().

◆ operator=()

FilterHighPassPercentage & FilterHighPassPercentage::operator= ( const FilterHighPassPercentage & other)

Definition at line 114 of file filterpass.cpp.

115{
117
118 return *this;
119}

References FilterHighPassPercentage(), and m_ratioPassY.

Member Data Documentation

◆ m_ratioPassY

double pappso::FilterHighPassPercentage::m_ratioPassY = 0
private

Definition at line 89 of file filterpass.h.

Referenced by FilterHighPassPercentage(), FilterHighPassPercentage(), filter(), and operator=().


The documentation for this class was generated from the following files: