libpappsomspp
Library for mass spectrometry
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
 

Private Attributes

double m_ratioPassY = 0
 

Detailed Description

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

Definition at line 93 of file filterpass.h.

Constructor & Destructor Documentation

◆ FilterHighPassPercentage() [1/2]

FilterHighPassPercentage::FilterHighPassPercentage ( double  y_ratio)

Definition at line 102 of file filterpass.cpp.

103  : m_ratioPassY(ratio_pass_y)
104 {
105 }

◆ FilterHighPassPercentage() [2/2]

FilterHighPassPercentage::FilterHighPassPercentage ( const FilterHighPassPercentage other)

Definition at line 107 of file filterpass.cpp.

109  : m_ratioPassY(other.m_ratioPassY)
110 {
111 }

◆ ~FilterHighPassPercentage()

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

Definition at line 99 of file filterpass.h.

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 }

References m_ratioPassY, and pappso::maxYDataPoint().

◆ operator=()

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

Definition at line 114 of file filterpass.cpp.

115 {
116  m_ratioPassY = other.m_ratioPassY;
117 
118  return *this;
119 }

References m_ratioPassY.

Member Data Documentation

◆ m_ratioPassY

double pappso::FilterHighPassPercentage::m_ratioPassY = 0
private

Definition at line 107 of file filterpass.h.

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


The documentation for this class was generated from the following files:
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:126
pappso::maxYDataPoint
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
Definition: trace.cpp:127
pappso::FilterHighPassPercentage::m_ratioPassY
double m_ratioPassY
Definition: filterpass.h:107