43 class ConsensusFeature;
102 void fromString(
const String & filter);
130 void remove(
Size index);
143 void setActive(
bool is_active);
157 bool passes(
const Feature & feature)
const;
165 if (!is_active_)
return true;
167 for (
Size i = 0; i < filters_.size(); i++)
170 if (filter.
field == INTENSITY)
175 if (spectrum[peak_index].getIntensity() < filter.
value)
return false;
180 if (spectrum[peak_index].getIntensity() != filter.
value)
return false;
185 if (spectrum[peak_index].getIntensity() > filter.
value)
return false;
193 else if (filter.
field == META_DATA)
198 for (
Size j = 0; j < f_arrays.size(); ++j)
200 if (f_arrays[j].getName() == filter.
meta_name)
209 if (filter.
op == EQUAL && f_arrays[f_index][peak_index] != filter.
value)
return false;
210 else if (filter.
op == LESS_EQUAL && f_arrays[f_index][peak_index] > filter.
value)
return false;
211 else if (filter.
op == GREATER_EQUAL && f_arrays[f_index][peak_index] < filter.
value)
return false;
218 for (
Size j = 0; j < i_arrays.size(); ++j)
220 if (i_arrays[j].getName() == filter.
meta_name)
229 if (filter.
op == EQUAL && i_arrays[i_index][peak_index] != filter.
value)
return false;
230 else if (filter.
op == LESS_EQUAL && i_arrays[i_index][peak_index] > filter.
value)
return false;
231 else if (filter.
op == GREATER_EQUAL && i_arrays[i_index][peak_index] < filter.
value)
return false;
235 if (f_index == -1 && i_index == -1)
return false;
254 else if (filter.
op != EXISTS)
263 if (filter.
op != EQUAL)
return false;
272 if (filter.
op == EQUAL && (
double)data_value != filter.
value)
return false;
273 else if (filter.
op == LESS_EQUAL && (
double)data_value > filter.
value)
return false;
274 else if (filter.
op == GREATER_EQUAL && (
double)data_value < filter.
value)
return false;
Filter the intensity value.
Definition: DataFilters.h:58
bool isActive() const
Returns if the filters are enabled.
Definition: DataFilters.h:151
A more convenient string class.
Definition: String.h:57
FilterOperation
Filter operation.
Definition: DataFilters.h:65
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
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:134
DataType valueType() const
returns the type of value stored
Definition: DataValue.h:350
std::vector< Size > meta_indices_
Vector of meta indices acting as index cache.
Definition: DataFilters.h:245
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
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:89
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:56
FilterType
Information to filter.
Definition: DataFilters.h:56
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
Representation of a peak/feature filter combining FilterType, FilterOperation and a value...
Definition: DataFilters.h:74
Equal to the value.
Definition: DataFilters.h:68
FilterType field
Field to filter.
Definition: DataFilters.h:80
bool passes(const MSSpectrum &spectrum, Size peak_index) const
Returns if the peak fulfills the current filter criteria.
Definition: DataFilters.h:163
double value
Value for comparison.
Definition: DataFilters.h:84
std::vector< DataFilter > filters_
Array of DataFilters.
Definition: DataFilters.h:243
string value
Definition: DataValue.h:67
An LC-MS feature.
Definition: Feature.h:70
Filter the charge value.
Definition: DataFilters.h:60
std::vector< IntegerDataArray > IntegerDataArrays
Definition: MSSpectrum.h:95
String value_string
String value for comparison (for meta data)
Definition: DataFilters.h:86
FilterOperation op
Filter operation.
Definition: DataFilters.h:82
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:251
String meta_name
Name of the considered meta information.
Definition: DataFilters.h:88
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
Filter the overall quality value.
Definition: DataFilters.h:59
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
DataFilter array providing some convenience functions.
Definition: DataFilters.h:50
String toString(T i)
toString functions (single argument)
Definition: StringUtils.h:68
Greater than the value or equal to the value.
Definition: DataFilters.h:67
bool value_is_numerical
Bool value that indicates if the specified value is numerical.
Definition: DataFilters.h:90
bool is_active_
Determines if the filters are activated.
Definition: DataFilters.h:248
Less than the value or equal to the value.
Definition: DataFilters.h:69
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays.
empty value
Definition: DataValue.h:73
Filter the number of subordinates/elements.
Definition: DataFilters.h:61