pappsomspp
Library for mass spectrometry
pappso::FilterHighPassPercentage Class Reference

#include <filterpass.h>

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

Public Member Functions

 FilterHighPassPercentage (double y_ratio)
 
 FilterHighPassPercentage (const FilterHighPassPercentage &other)
 
virtual ~FilterHighPassPercentage ()
 
Tracefilter (Trace &data_points) const override
 

Private Attributes

double m_y_pass_ratio = 0
 

Detailed Description

Definition at line 79 of file filterpass.h.

Constructor & Destructor Documentation

◆ FilterHighPassPercentage() [1/2]

FilterHighPassPercentage::FilterHighPassPercentage ( double  y_ratio)

Definition at line 82 of file filterpass.cpp.

83  : m_y_pass_ratio(y_pass)
84 {
85 }

◆ FilterHighPassPercentage() [2/2]

FilterHighPassPercentage::FilterHighPassPercentage ( const FilterHighPassPercentage other)

Definition at line 86 of file filterpass.cpp.

89 {
90 }

◆ ~FilterHighPassPercentage()

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

Definition at line 87 of file filterpass.h.

90 : public MassSpectrumFilterInterface

Member Function Documentation

◆ filter()

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

Implements pappso::FilterInterface.

Definition at line 92 of file filterpass.cpp.

93 {
94  auto it_max = maxYDataPoint(data_points.begin(), data_points.end());
95  if(it_max == data_points.end())
96  return data_points;
97  double pass = (it_max->y * m_y_pass_ratio);
98  Trace new_data_points;
99  for(auto &&data_point : data_points)
100  {
101  if(data_point.y > pass)
102  {
103  new_data_points.push_back(data_point);
104  }
105  }
106  data_points = std::move(new_data_points);
107  return data_points;
108 }

References m_y_pass_ratio, and pappso::maxYDataPoint().

Member Data Documentation

◆ m_y_pass_ratio

double pappso::FilterHighPassPercentage::m_y_pass_ratio = 0
private

Definition at line 82 of file filterpass.h.

Referenced by filter().


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