pappsomspp
Library for mass spectrometry
pappso::FilterTandemRemoveC13 Class Reference

clean probable C13 isotopes as in X!Tandem algorithm More...

#include <filtertandemremovec13.h>

Inheritance diagram for pappso::FilterTandemRemoveC13:
pappso::MassSpectrumFilterInterface

Public Member Functions

 FilterTandemRemoveC13 ()
 
 FilterTandemRemoveC13 (const FilterTandemRemoveC13 &other)
 
MassSpectrumfilter (MassSpectrum &data_points) const override
 

Private Attributes

double m_arbitrary_range_between_isotopes = 1.5
 
double m_arbitrary_minimum_mz = 200.0
 

Detailed Description

clean probable C13 isotopes as in X!Tandem algorithm

Definition at line 56 of file filtertandemremovec13.h.

Constructor & Destructor Documentation

◆ FilterTandemRemoveC13() [1/2]

FilterTandemRemoveC13::FilterTandemRemoveC13 ( )

Definition at line 36 of file filtertandemremovec13.cpp.

37 {
38 }

◆ FilterTandemRemoveC13() [2/2]

FilterTandemRemoveC13::FilterTandemRemoveC13 ( const FilterTandemRemoveC13 other)

Definition at line 41 of file filtertandemremovec13.cpp.

42 {
43 }

Member Function Documentation

◆ filter()

MassSpectrum & FilterTandemRemoveC13::filter ( MassSpectrum data_points) const
overridevirtual

Implements pappso::MassSpectrumFilterInterface.

Definition at line 46 of file filtertandemremovec13.cpp.

47 {
48 
49  // Reverse-sort the data points (in y decreasing order) so that we get the
50  // greatest to the front of the vector and we'll then copy the first n data
51  // points to the returned vector. See that return (b < a) ?
52 
53  MassSpectrum massSpectrum;
54  if(data_points.size() > 0)
55  {
56  auto it = data_points.begin();
57  auto itNext = data_points.begin() + 1;
58  auto itEnd = data_points.end();
59 
60  pappso_double prevMz = it->x;
61 
62  while(itNext != itEnd)
63  {
64  if((itNext->x - prevMz) >= m_arbitrary_range_between_isotopes ||
65  itNext->x < m_arbitrary_minimum_mz)
66  {
67  massSpectrum.push_back(*it);
68  it = itNext;
69  prevMz = it->x;
70  }
71  else if(itNext->y > it->y)
72  {
73  it = itNext;
74  }
75 
76  itNext++;
77  }
78  massSpectrum.push_back(*it);
79  }
80 
81  data_points = std::move(massSpectrum);
82  return data_points;
83 }

References m_arbitrary_minimum_mz, and m_arbitrary_range_between_isotopes.

Member Data Documentation

◆ m_arbitrary_minimum_mz

double pappso::FilterTandemRemoveC13::m_arbitrary_minimum_mz = 200.0
private

Definition at line 77 of file filtertandemremovec13.h.

Referenced by filter().

◆ m_arbitrary_range_between_isotopes

double pappso::FilterTandemRemoveC13::m_arbitrary_range_between_isotopes = 1.5
private

Definition at line 76 of file filtertandemremovec13.h.

Referenced by filter().


The documentation for this class was generated from the following files:
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:67
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition: massspectrum.h:89
pappso::FilterTandemRemoveC13::m_arbitrary_minimum_mz
double m_arbitrary_minimum_mz
Definition: filtertandemremovec13.h:77
pappso::FilterTandemRemoveC13::m_arbitrary_range_between_isotopes
double m_arbitrary_range_between_isotopes
Definition: filtertandemremovec13.h:76