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 75 of file filterpass.h.

Constructor & Destructor Documentation

◆ FilterHighPassPercentage() [1/2]

FilterHighPassPercentage::FilterHighPassPercentage ( double  y_ratio)

Definition at line 103 of file filterpass.cpp.

104  : m_ratioPassY(ratio_pass_y)
105 {
106 }

◆ FilterHighPassPercentage() [2/2]

FilterHighPassPercentage::FilterHighPassPercentage ( const FilterHighPassPercentage other)

Definition at line 108 of file filterpass.cpp.

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

◆ ~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 124 of file filterpass.cpp.

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

References m_ratioPassY, and pappso::maxYDataPoint().

◆ operator=()

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

Definition at line 115 of file filterpass.cpp.

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

References m_ratioPassY.

Member Data Documentation

◆ m_ratioPassY

double pappso::FilterHighPassPercentage::m_ratioPassY = 0
private

Definition at line 89 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:132
pappso::maxYDataPoint
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
Definition: trace.cpp:138
pappso::FilterHighPassPercentage::m_ratioPassY
double m_ratioPassY
Definition: filterpass.h:89