Loading...
Searching...
No Matches
filterresample.h
Go to the documentation of this file.
/**
* \file pappsomspp/filers/filterresample.h
* \date 28/04/2019
* \author Olivier Langella
* \brief collection of filters concerned by X selection
*/
/*******************************************************************************
* Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "filterinterface.h"
#include <cstddef>
#include "../../mzrange.h"
#include "../../exportinmportconfig.h"
#include "../combiners/selectionpolygon.h"
namespace pappso
{
class PMSPP_LIB_DECL FilterResampleKeepSmaller : public FilterInterface
{
private:
double m_value;
public:
FilterResampleKeepSmaller(double x_value);
FilterResampleKeepSmaller(const FilterResampleKeepSmaller &other);
virtual ~FilterResampleKeepSmaller(){};
Trace &filter(Trace &trace) const override;
};
class PMSPP_LIB_DECL FilterResampleKeepGreater : public FilterInterface
{
private:
double m_value;
public:
FilterResampleKeepGreater(double x_value);
FilterResampleKeepGreater(const FilterResampleKeepGreater &other);
virtual ~FilterResampleKeepGreater(){};
FilterResampleKeepGreater &operator=(const FilterResampleKeepGreater &other);
Trace &filter(Trace &trace) const override;
double getThresholdX() const;
};
class PMSPP_LIB_DECL FilterResampleRemoveXRange : public FilterInterface
{
private:
double m_minX;
double m_maxX;
public:
FilterResampleRemoveXRange(double min_x, double max_x);
FilterResampleRemoveXRange(const FilterResampleRemoveXRange &other);
virtual ~FilterResampleRemoveXRange(){};
FilterResampleRemoveXRange &
operator=(const FilterResampleRemoveXRange &other);
Trace &filter(Trace &trace) const override;
};
class PMSPP_LIB_DECL FilterResampleKeepXRange : public FilterInterface
{
private:
double m_minX;
double m_maxX;
public:
FilterResampleKeepXRange(double min_x = 0, double max_x = 0);
FilterResampleKeepXRange(const FilterResampleKeepXRange &other);
virtual ~FilterResampleKeepXRange(){};
FilterResampleKeepXRange &operator=(const FilterResampleKeepXRange &other);
Trace &filter(Trace &trace) const override;
};
using SelectionPolygonSpecVector = std::vector<SelectionPolygonSpec>;
class PMSPP_LIB_DECL FilterResampleKeepPointInPolygon : public FilterInterface
{
public:
FilterResampleKeepPointInPolygon();
FilterResampleKeepPointInPolygon(const SelectionPolygon &selection_polygon,
DataKind data_kind);
FilterResampleKeepPointInPolygon(
const SelectionPolygonSpecVector &selection_polygon_specs);
FilterResampleKeepPointInPolygon(
const FilterResampleKeepPointInPolygon &other);
virtual ~FilterResampleKeepPointInPolygon(){};
void
newSelectionPolygonSpec(const SelectionPolygonSpec &selection_polygon_spec);
FilterResampleKeepPointInPolygon &
operator=(const FilterResampleKeepPointInPolygon &other);
using FilterInterface::filter;
Trace &filter(Trace &trace) const override;
Trace &filter(Trace &trace, double dt_value, double rt_value) const;
private:
std::vector<SelectionPolygonSpec> m_selectionPolygonSpecs;
double m_lowestMz = std::numeric_limits<double>::max();
double m_greatestMz = std::numeric_limits<double>::min();
};
class PMSPP_LIB_DECL MassSpectrumFilterResampleRemoveMzRange
: public MassSpectrumFilterInterface
{
private:
const FilterResampleRemoveXRange m_filterRange;
public:
MassSpectrumFilterResampleRemoveMzRange(const MzRange &mz_range);
MassSpectrumFilterResampleRemoveMzRange(
const MassSpectrumFilterResampleRemoveMzRange &other);
virtual ~MassSpectrumFilterResampleRemoveMzRange(){};
MassSpectrum &filter(MassSpectrum &spectrum) const override;
};
class PMSPP_LIB_DECL MassSpectrumFilterResampleKeepMzRange
: public MassSpectrumFilterInterface
{
private:
const FilterResampleKeepXRange m_filterRange;
public:
MassSpectrumFilterResampleKeepMzRange(const MzRange &mz_range);
MassSpectrumFilterResampleKeepMzRange(
const MassSpectrumFilterResampleKeepMzRange &other);
virtual ~MassSpectrumFilterResampleKeepMzRange(){};
MassSpectrum &filter(MassSpectrum &spectrum) const override;
};
} // namespace pappso
pappso::FilterInterface
generic interface to apply a filter on a trace
Definition filterinterface.h:40
pappso::FilterResampleKeepGreater
Definition filterresample.h:53
pappso::FilterResampleKeepGreater::m_value
double m_value
Definition filterresample.h:55
pappso::FilterResampleKeepGreater::~FilterResampleKeepGreater
virtual ~FilterResampleKeepGreater()
Definition filterresample.h:60
pappso::FilterResampleKeepPointInPolygon
Definition filterresample.h:106
pappso::FilterResampleKeepPointInPolygon::~FilterResampleKeepPointInPolygon
virtual ~FilterResampleKeepPointInPolygon()
Definition filterresample.h:119
pappso::FilterResampleKeepPointInPolygon::m_selectionPolygonSpecs
std::vector< SelectionPolygonSpec > m_selectionPolygonSpecs
Definition filterresample.h:133
pappso::FilterResampleKeepSmaller
Definition filterresample.h:40
pappso::FilterResampleKeepSmaller::m_value
double m_value
Definition filterresample.h:42
pappso::FilterResampleKeepSmaller::~FilterResampleKeepSmaller
virtual ~FilterResampleKeepSmaller()
Definition filterresample.h:47
pappso::FilterResampleKeepXRange
Definition filterresample.h:87
pappso::FilterResampleKeepXRange::m_maxX
double m_maxX
Definition filterresample.h:90
pappso::FilterResampleKeepXRange::~FilterResampleKeepXRange
virtual ~FilterResampleKeepXRange()
Definition filterresample.h:95
pappso::FilterResampleKeepXRange::m_minX
double m_minX
Definition filterresample.h:89
pappso::FilterResampleRemoveXRange
Definition filterresample.h:70
pappso::FilterResampleRemoveXRange::~FilterResampleRemoveXRange
virtual ~FilterResampleRemoveXRange()
Definition filterresample.h:78
pappso::FilterResampleRemoveXRange::m_maxX
double m_maxX
Definition filterresample.h:73
pappso::FilterResampleRemoveXRange::m_minX
double m_minX
Definition filterresample.h:72
pappso::MassSpectrumFilterInterface
generic interface to apply a filter on a MassSpectrum This is the same as FilterInterface,...
Definition filterinterface.h:56
pappso::MassSpectrumFilterResampleKeepMzRange
Definition filterresample.h:156
pappso::MassSpectrumFilterResampleKeepMzRange::~MassSpectrumFilterResampleKeepMzRange
virtual ~MassSpectrumFilterResampleKeepMzRange()
Definition filterresample.h:164
pappso::MassSpectrumFilterResampleKeepMzRange::m_filterRange
const FilterResampleKeepXRange m_filterRange
Definition filterresample.h:158
pappso::MassSpectrumFilterResampleRemoveMzRange
Definition filterresample.h:141
pappso::MassSpectrumFilterResampleRemoveMzRange::m_filterRange
const FilterResampleRemoveXRange m_filterRange
Definition filterresample.h:143
pappso::MassSpectrumFilterResampleRemoveMzRange::~MassSpectrumFilterResampleRemoveMzRange
virtual ~MassSpectrumFilterResampleRemoveMzRange()
Definition filterresample.h:149
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition massspectrum.h:73
pappso::MzRange
Definition mzrange.h:46
pappso::SelectionPolygon
Definition selectionpolygon.h:61
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:148
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition exportinmportconfig.h:14
filterinterface.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::DataKind
DataKind
Definition types.h:211
pappso::SelectionPolygonSpecVector
std::vector< SelectionPolygonSpec > SelectionPolygonSpecVector
Definition filterresample.h:103
pappso::SelectionPolygonSpec
Definition selectionpolygon.h:157