OpenMS
|
DataFilter array providing some convenience functions. More...
#include <OpenMS/PROCESSING/MISC/DataFilters.h>
Classes | |
struct | DataFilter |
Representation of a peak/feature filter combining FilterType, FilterOperation and a value (either double or String) More... | |
Public Types | |
enum | FilterType { INTENSITY , QUALITY , CHARGE , SIZE , META_DATA } |
Information to filter. More... | |
enum | FilterOperation { GREATER_EQUAL , EQUAL , LESS_EQUAL , EXISTS } |
Filter operation. More... | |
Public Member Functions | |
DataFilters ()=default | |
Size | size () const |
Filter count. More... | |
const DataFilter & | operator[] (Size index) const |
Filter accessor. More... | |
void | add (const DataFilter &filter) |
Adds a filter. More... | |
void | remove (Size index) |
Removes the filter corresponding to index . More... | |
void | replace (Size index, const DataFilter &filter) |
Replaces the filter corresponding to index . More... | |
void | clear () |
Removes all filters. More... | |
void | setActive (bool is_active) |
Enables/disables the all the filters. More... | |
bool | isActive () const |
Returns if the filters are enabled. More... | |
bool | passes (const Feature &feature) const |
Returns if the feature fulfills the current filter criteria. More... | |
bool | passes (const ConsensusFeature &consensus_feature) const |
Returns if the consensus_feature fulfills the current filter criteria. More... | |
bool | passes (const MSSpectrum &spectrum, Size peak_index) const |
Returns if the a peak in a spectrum at peak_index fulfills the current filter criteria. More... | |
bool | passes (const MSChromatogram &chrom, Size peak_index) const |
Returns if the a peak in a chrom at peak_index fulfills the current filter criteria. More... | |
bool | passes (const Mobilogram &mobilogram, Size peak_index) const |
Returns if the a peak in a mobilogram at peak_index fulfills the current filter criteria. More... | |
Protected Member Functions | |
bool | metaPasses_ (const MetaInfoInterface &meta_interface, const DataFilters::DataFilter &filter, Size index) const |
Returns if the meta value at index of meta_interface (a peak or feature) passes the filter . More... | |
Protected Attributes | |
std::vector< DataFilter > | filters_ |
Array of DataFilters. More... | |
std::vector< Size > | meta_indices_ |
Vector of meta indices acting as index cache. More... | |
bool | is_active_ = false |
Determines if the filters are activated. More... | |
DataFilter array providing some convenience functions.
enum FilterOperation |
enum FilterType |
|
default |
void add | ( | const DataFilter & | filter | ) |
Adds a filter.
void clear | ( | ) |
Removes all filters.
|
inline |
Returns if the filters are enabled.
They are automatically enabled when a filter is added and automatically disabled when the last filter is removed
|
protected |
Returns if the meta value at index
of meta_interface
(a peak or feature) passes the filter
.
const DataFilter& operator[] | ( | Size | index | ) | const |
Filter accessor.
Exception::IndexOverflow | is thrown for invalid indices |
bool passes | ( | const ConsensusFeature & | consensus_feature | ) | const |
Returns if the consensus_feature
fulfills the current filter criteria.
bool passes | ( | const Feature & | feature | ) | const |
Returns if the feature
fulfills the current filter criteria.
|
inline |
Returns if the a peak in a mobilogram
at peak_index
fulfills the current filter criteria.
References DataFilters::DataFilter::field, DataFilters::DataFilter::op, and DataFilters::DataFilter::value.
|
inline |
Returns if the a peak in a chrom
at peak_index
fulfills the current filter criteria.
References DataFilters::DataFilter::field, MSChromatogram::getFloatDataArrays(), MSChromatogram::getIntegerDataArrays(), DataFilters::DataFilter::meta_name, DataFilters::DataFilter::op, and DataFilters::DataFilter::value.
|
inline |
Returns if the a peak in a spectrum
at peak_index
fulfills the current filter criteria.
References DataFilters::DataFilter::field, MSSpectrum::getFloatDataArrays(), MSSpectrum::getIntegerDataArrays(), DataFilters::DataFilter::meta_name, DataFilters::DataFilter::op, and DataFilters::DataFilter::value.
void remove | ( | Size | index | ) |
Removes the filter corresponding to index
.
Exception::IndexOverflow | is thrown for invalid indices |
void replace | ( | Size | index, |
const DataFilter & | filter | ||
) |
Replaces the filter corresponding to index
.
Exception::IndexOverflow | is thrown for invalid indices |
void setActive | ( | bool | is_active | ) |
Enables/disables the all the filters.
Size size | ( | ) | const |
Filter count.
|
protected |
Array of DataFilters.
|
protected |
Determines if the filters are activated.
|
protected |
Vector of meta indices acting as index cache.