libpappsomspp
Library for mass spectrometry
pappso::FilterTandemDeisotope Class Reference

Deisotope the mass spectrum this mass spectrum is iterated over and according to a data point-based moving window progression does the following tests: More...

#include <filtertandemremovec13.h>

Inheritance diagram for pappso::FilterTandemDeisotope:
pappso::MassSpectrumFilterInterface

Public Member Functions

 FilterTandemDeisotope (double mz_range_max=0.95, double minimum_mz=200.0)
 
 FilterTandemDeisotope (const FilterTandemDeisotope &other)
 
MassSpectrumfilter (MassSpectrum &data_points) const override
 
- Public Member Functions inherited from pappso::MassSpectrumFilterInterface
virtual ~MassSpectrumFilterInterface ()
 

Private Attributes

double m_arbitrary_range_between_isotopes = 0.95
 
double m_arbitrary_minimum_mz = 200.0
 

Detailed Description

Deisotope the mass spectrum this mass spectrum is iterated over and according to a data point-based moving window progression does the following tests:

  • any data point having a x value (m/z value) less than 200 is conserved;
  • any data point having a x value greater than the previous data point's x value by at least 0.95 is conserved;

remove isotopes as in X!Tandem algorithm this method doesn't really remove isotopes: it cleans up multiple intensities within one Dalton of each other.

first tandem filter is 0.95 (remove_isotopes(_s);)
second tandem filter is 1.5 (clean_isotopes(_s);)

Definition at line 57 of file filtertandemremovec13.h.

Constructor & Destructor Documentation

◆ FilterTandemDeisotope() [1/2]

FilterTandemDeisotope::FilterTandemDeisotope ( double  mz_range_max = 0.95,
double  minimum_mz = 200.0 
)

◆ FilterTandemDeisotope() [2/2]

FilterTandemDeisotope::FilterTandemDeisotope ( const FilterTandemDeisotope other)

Member Function Documentation

◆ filter()

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

Implements pappso::MassSpectrumFilterInterface.

Definition at line 51 of file filtertandemremovec13.cpp.

52 {
53 
54  MassSpectrum massSpectrum;
55 
56  if(data_points.size() > 0)
57  {
58  // auto it_write = data_points.begin();
59  auto it_read = data_points.begin() + 1;
60  auto it_end = data_points.end();
61 
62 
63  DataPoint value_write = *data_points.begin();
64  double last_mz = value_write.x;
65  while(it_read != it_end)
66  {
67  if((it_read->x - last_mz) >= m_arbitrary_range_between_isotopes ||
68  it_read->x < m_arbitrary_minimum_mz)
69  {
70  massSpectrum.push_back(value_write);
71  value_write = *it_read;
72  last_mz = value_write.x;
73  }
74  else if(it_read->y > value_write.y)
75  {
76  value_write = *it_read;
77  }
78  it_read++;
79  }
80  massSpectrum.push_back(value_write);
81  }
82 
83  data_points = std::move(massSpectrum);
84  return data_points;
85 }
Class to represent a mass spectrum.
Definition: massspectrum.h:71
pappso_double x
Definition: datapoint.h:23
pappso_double y
Definition: datapoint.h:24

References m_arbitrary_minimum_mz, m_arbitrary_range_between_isotopes, pappso::DataPoint::x, and pappso::DataPoint::y.

Referenced by pappso::XtandemSpectrumProcess::process().

Member Data Documentation

◆ m_arbitrary_minimum_mz

double pappso::FilterTandemDeisotope::m_arbitrary_minimum_mz = 200.0
private

Definition at line 68 of file filtertandemremovec13.h.

Referenced by FilterTandemDeisotope(), and filter().

◆ m_arbitrary_range_between_isotopes

double pappso::FilterTandemDeisotope::m_arbitrary_range_between_isotopes = 0.95
private

Definition at line 67 of file filtertandemremovec13.h.

Referenced by FilterTandemDeisotope(), and filter().


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