35 #ifndef OPENMS_FILTERING_DATAREDUCTION_DATAFILTERS_H    36 #define OPENMS_FILTERING_DATAREDUCTION_DATAFILTERS_H    44   class ConsensusFeature;
   103       void fromString(
const String & filter);
   106       bool operator==(
const DataFilter & rhs) 
const;
   109       bool operator!=(
const DataFilter & rhs) 
const;
   131     void remove(
Size index);
   144     void setActive(
bool is_active);
   158     bool passes(
const Feature & feature) 
const;
   166       if (!is_active_) 
return true;
   168       for (
Size i = 0; i < filters_.size(); i++)
   171         if (filter.
field == INTENSITY)
   176             if (spectrum[peak_index].getIntensity() < filter.
value) 
return false;
   181             if (spectrum[peak_index].getIntensity() != filter.
value) 
return false;
   186             if (spectrum[peak_index].getIntensity() > filter.
value) 
return false;
   194         else if (filter.
field == META_DATA)
   199           for (
Size j = 0; j < f_arrays.size(); ++j)
   201             if (f_arrays[j].getName() == filter.
meta_name)
   210             if (filter.
op == EQUAL && f_arrays[f_index][peak_index] != filter.
value) 
return false;
   211             else if (filter.
op == LESS_EQUAL && f_arrays[f_index][peak_index] > filter.
value) 
return false;
   212             else if (filter.
op == GREATER_EQUAL && f_arrays[f_index][peak_index] < filter.
value) 
return false;
   219           for (
Size j = 0; j < i_arrays.size(); ++j)
   221             if (i_arrays[j].getName() == filter.
meta_name)
   230             if (filter.
op == EQUAL && i_arrays[i_index][peak_index] != filter.
value) 
return false;
   231             else if (filter.
op == LESS_EQUAL && i_arrays[i_index][peak_index] > filter.
value) 
return false;
   232             else if (filter.
op == GREATER_EQUAL && i_arrays[i_index][peak_index] < filter.
value) 
return false;
   236           if (f_index == -1 && i_index == -1) 
return false;
   255       else if (filter.
op != EXISTS)
   264             if (filter.
op != EQUAL) 
return false;
   273             if (filter.
op == EQUAL && (
double)data_value != filter.
value) 
return false;
   274             else if (filter.
op == LESS_EQUAL && (
double)data_value > filter.
value) 
return false;
   275             else if (filter.
op == GREATER_EQUAL && (
double)data_value < filter.
value) 
return false;
 Filter the intensity value. 
Definition: DataFilters.h:59
 
bool isActive() const
Returns if the filters are enabled. 
Definition: DataFilters.h:152
 
A more convenient string class. 
Definition: String.h:57
 
FilterOperation
Filter operation. 
Definition: DataFilters.h:66
 
unsigned int UInt
Unsigned integer type. 
Definition: Types.h:95
 
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
 
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference. 
Definition: Types.h:135
 
DataType valueType() const
returns the type of value stored 
Definition: DataValue.h:351
 
std::vector< Size > meta_indices_
Vector of meta indices acting as index cache. 
Definition: DataFilters.h:246
 
Main OpenMS namespace. 
Definition: FeatureDeconvolution.h:47
 
const FloatDataArrays & getFloatDataArrays() const
Returns a const reference to the float meta data arrays. 
 
String toString() const
Conversion to String. 
 
std::vector< FloatDataArray > FloatDataArrays
Definition: MSSpectrum.h:90
 
Class to hold strings, numeric values, lists of strings and lists of numeric values. 
Definition: DataValue.h:57
 
FilterType
Information to filter. 
Definition: DataFilters.h:57
 
The representation of a 1D spectrum. 
Definition: MSSpectrum.h:67
 
Representation of a peak/feature filter combining FilterType, FilterOperation and a value...
Definition: DataFilters.h:75
 
Equal to the value. 
Definition: DataFilters.h:69
 
FilterType field
Field to filter. 
Definition: DataFilters.h:81
 
bool passes(const MSSpectrum &spectrum, Size peak_index) const
Returns if the peak fulfills the current filter criteria. 
Definition: DataFilters.h:164
 
double value
Value for comparison. 
Definition: DataFilters.h:85
 
std::vector< DataFilter > filters_
Array of DataFilters. 
Definition: DataFilters.h:244
 
string value 
Definition: DataValue.h:68
 
An LC-MS feature. 
Definition: Feature.h:70
 
Filter the charge value. 
Definition: DataFilters.h:61
 
std::vector< IntegerDataArray > IntegerDataArrays
Definition: MSSpectrum.h:96
 
String value_string
String value for comparison (for meta data) 
Definition: DataFilters.h:87
 
FilterOperation op
Filter operation. 
Definition: DataFilters.h:83
 
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...
Definition: DataFilters.h:252
 
String meta_name
Name of the considered meta information. 
Definition: DataFilters.h:89
 
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
 
Filter the overall quality value. 
Definition: DataFilters.h:60
 
size_t Size
Size type e.g. used as variable which can hold result of size() 
Definition: Types.h:128
 
DataFilter array providing some convenience functions. 
Definition: DataFilters.h:51
 
String toString(T i)
toString functions (single argument) 
Definition: StringUtils.h:69
 
Greater than the value or equal to the value. 
Definition: DataFilters.h:68
 
bool value_is_numerical
Bool value that indicates if the specified value is numerical. 
Definition: DataFilters.h:91
 
bool is_active_
Determines if the filters are activated. 
Definition: DataFilters.h:249
 
Less than the value or equal to the value. 
Definition: DataFilters.h:70
 
A 2-dimensional consensus feature. 
Definition: ConsensusFeature.h:65
 
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays. 
 
empty value 
Definition: DataValue.h:74
 
Filter the number of subordinates/elements. 
Definition: DataFilters.h:62