OpenMS
2.8.0
|
The MRMFeatureFilter either flags components and/or transitions that do not pass the QC criteria or filters out components and/or transitions that do not pass the QC criteria. More...
#include <OpenMS/ANALYSIS/OPENSWATH/MRMFeatureFilter.h>
Public Member Functions | |
MRMFeatureFilter () | |
Constructor. More... | |
~MRMFeatureFilter () override | |
Destructor. More... | |
void | getDefaultParameters (Param ¶ms) const |
Get the class' default parameters. More... | |
void | updateMembers_ () override |
Synchronize members with param class. More... | |
void | FilterFeatureMap (FeatureMap &features, const MRMFeatureQC &filter_criteria, const TargetedExperiment &transitions) |
Flags or filters features and subordinates in a FeatureMap. More... | |
void | FilterFeatureMapPercRSD (FeatureMap &features, const MRMFeatureQC &filter_criteria, const MRMFeatureQC &filter_values) |
Flags or filters features and subordinates in a FeatureMap based on a user defined set of filter values derived from calling `EstimatePercRSD`. The user supplied filter_criteria represents the bounds on acceptable PercentRSD values. NOTE that flagging nor filtering will be done on the labels and transitions type counts. More... | |
void | FilterFeatureMapBackgroundInterference (FeatureMap &features, const MRMFeatureQC &filter_criteria, const MRMFeatureQC &filter_values) |
Flags or filters features and subordinates in a FeatureMap based on a user defined set of filter values derived from calling `EstimateBackgroundInterferences`. The user supplied filter_criteria represents the bounds on acceptable PercentBackgroundInterference values. NOTE that filtering is only done on the `Intensity` member. More... | |
void | EstimateDefaultMRMFeatureQCValues (const std::vector< FeatureMap > &samples, MRMFeatureQC &filter_template, const TargetedExperiment &transitions, const bool &init_template_values) const |
Estimate the lower and upper bound values for the MRMFeatureQC class based on a user supplied template. The template can either be initialized from the first sample (meaning all initial template values are over written) or not (meaning the initial template values will be updated if the ranges are found to be too narrow) More... | |
void | TransferLLOQAndULOQToCalculatedConcentrationBounds (const std::vector< AbsoluteQuantitationMethod > &quantitation_method, MRMFeatureQC &filter_template) |
Transfer the lower and upper bound values for the calculated concentrations based off of the AbsoluteQuantitationMethod. More... | |
void | EstimatePercRSD (const std::vector< FeatureMap > &samples, MRMFeatureQC &filter_template, const TargetedExperiment &transitions) const |
Estimate the feature variability as measured by PercentRSD from multiple pooled QC samples or replicate Unknown samples. The returned filter_template can then be used by `FilterFeatureMapPercRSD` in order to filter based on the PercentRSD user defined limits. More... | |
void | EstimateBackgroundInterferences (const std::vector< FeatureMap > &samples, MRMFeatureQC &filter_template, const TargetedExperiment &transitions) const |
Estimate the background interference level based on the average values from Blank samples. The returned filter_template can then be used by `FilterFeatureMapBackgroundInterference` in order to filter on the `Intensity` members of MRMFeatureQC::ComponentGroupQCs and MRMFeatureQC::ComponentQCs. More... | |
double | calculateIonRatio (const Feature &component_1, const Feature &component_2, const String &feature_name) const |
Calculates the ion ratio between two transitions. More... | |
double | calculateRTDifference (Feature &component_1, Feature &component_2) const |
Calculates the retention time difference between two features. More... | |
double | calculateResolution (Feature &component_1, Feature &component_2) const |
Calculates the resolution between two features. More... | |
bool | checkMetaValue (const Feature &component, const String &meta_value_key, const double &meta_value_l, const double &meta_value_u, bool &key_exists) const |
Checks if the metaValue is within the user specified range. More... | |
void | updateMetaValue (const Feature &component, const String &meta_value_key, double &meta_value_l, double &meta_value_u, bool &key_exists) const |
Updates the metaValue ranges based on the value given. More... | |
void | setMetaValue (const Feature &component, const String &meta_value_key, double &meta_value_l, double &meta_value_u, bool &key_exists) const |
Uses the supplied value to set the metaValue ranges. More... | |
void | initMetaValue (const Feature &component, const String &meta_value_key, double &meta_value_l, double &meta_value_u, bool &key_exists) const |
Uses the supplied value to initialize the metaValue ranges to the same value. More... | |
std::map< String, int > | countLabelsAndTransitionTypes (const Feature &component_group, const TargetedExperiment &transitions) const |
Count the number of heavy/light labels and quantifying/detecting/identifying transitions. More... | |
StringList | getUniqueSorted (const StringList &messages) const |
Sorts the messages and returns a copy without duplicates. More... | |
void | accumulateFilterValues (std::vector< MRMFeatureQC > &filter_values, const std::vector< FeatureMap > &samples, const MRMFeatureQC &filter_template, const TargetedExperiment &transitions) const |
Accumulate feature values from a list of FeatureMaps. More... | |
void | zeroFilterValues (MRMFeatureQC &filter_zeros, const MRMFeatureQC &filter_template) const |
Set all members in MRMFeatureQC to zero. More... | |
void | calculateFilterValuesMean (MRMFeatureQC &filter_mean, const std::vector< MRMFeatureQC > &filter_values, const MRMFeatureQC &filter_template) const |
Calculate the mean of each MRMFeatureQC parameter from a list of MRMFeatureQC classes. More... | |
void | calculateFilterValuesVar (MRMFeatureQC &filter_var, const std::vector< MRMFeatureQC > &filter_values, const MRMFeatureQC &filter_mean, const MRMFeatureQC &filter_template) const |
Calculate the var of each MRMFeatureQC parameter from a list of MRMFeatureQC classes. More... | |
void | calculateFilterValuesPercRSD (MRMFeatureQC &filter_rsd, const MRMFeatureQC &filter_mean, const MRMFeatureQC &filter_var) const |
Calculate the relative standard deviation (PercentRSD) of each MRMFeatureQC parameter from pre-computed mean and variance values. More... | |
template<typename T > | |
bool | checkRange (const T &value, const T &value_l, const T &value_u) const |
Checks that the range of value is bracketed by value_l and value_u. More... | |
template<typename T > | |
void | updateRange (const T &value, T &value_l, T &value_u) const |
Updates value_l and value_u according to whether value is greater than value_u or less than value_l. More... | |
template<typename T > | |
void | setRange (const T &value, T &value_l, T &value_u) const |
Sets value_l and value_u to bracket the range 0 to value or value to 0 depending on if value is >0. More... | |
template<typename T > | |
void | initRange (const T &value, T &value_l, T &value_u) const |
Sets value_l and value_u to value. More... | |
Public Member Functions inherited from DefaultParamHandler | |
DefaultParamHandler (const String &name) | |
Constructor with name that is displayed in error messages. More... | |
DefaultParamHandler (const DefaultParamHandler &rhs) | |
Copy constructor. More... | |
virtual | ~DefaultParamHandler () |
Destructor. More... | |
virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () const |
Non-mutable access to the name. More... | |
void | setName (const String &name) |
Mutable access to the name. More... | |
const std::vector< String > & | getSubsections () const |
Non-mutable access to the registered subsections. More... | |
Private Attributes | |
String | flag_or_filter_ |
flag or filter (i.e., remove) features that do not pass the QC More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from DefaultParamHandler | |
static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="") |
Writes all parameters to meta values. More... | |
Protected Member Functions inherited from DefaultParamHandler | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes inherited from DefaultParamHandler | |
Param | param_ |
Container for current parameters. More... | |
Param | defaults_ |
Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
std::vector< String > | subsections_ |
Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
String | error_name_ |
Name that is displayed in error messages during the parameter checking. More... | |
bool | check_defaults_ |
If this member is set to false no checking if parameters in done;. More... | |
bool | warn_empty_defaults_ |
If this member is set to false no warning is emitted when defaults are empty;. More... | |
The MRMFeatureFilter either flags components and/or transitions that do not pass the QC criteria or filters out components and/or transitions that do not pass the QC criteria.
MRMFeatureFilter | ( | ) |
Constructor.
|
override |
Destructor.
void accumulateFilterValues | ( | std::vector< MRMFeatureQC > & | filter_values, |
const std::vector< FeatureMap > & | samples, | ||
const MRMFeatureQC & | filter_template, | ||
const TargetedExperiment & | transitions | ||
) | const |
Accumulate feature values from a list of FeatureMaps.
[out] | filter_values | A list of MRMFeatureQC objects filled with the values determined by the filter_template from the samples |
[in] | samples | A list of feature maps |
[in] | filter_template | A MRMFeatureQC object that will be used as a template to fill in values derived from the sample feature maps |
[in] | transitions | transitions from a TargetedExperiment |
void calculateFilterValuesMean | ( | MRMFeatureQC & | filter_mean, |
const std::vector< MRMFeatureQC > & | filter_values, | ||
const MRMFeatureQC & | filter_template | ||
) | const |
Calculate the mean of each MRMFeatureQC parameter from a list of MRMFeatureQC classes.
[out] | filter_mean | A MRMFeatureQC object whose members will be replaced by the mean values |
[in] | filter_values | A list of MRMFeatureQC objects |
[in] | filter_template | A MRMFeatureQC object that will be used as a template to fill in values |
void calculateFilterValuesPercRSD | ( | MRMFeatureQC & | filter_rsd, |
const MRMFeatureQC & | filter_mean, | ||
const MRMFeatureQC & | filter_var | ||
) | const |
Calculate the relative standard deviation (PercentRSD) of each MRMFeatureQC parameter from pre-computed mean and variance values.
[out] | filter_rsd | A MRMFeatureQC object whose members will be replaced by PercentRSD |
[in] | filter_var | A MRMFeatureQC object with the variance |
[in] | filter_mean | A MRMFeatureQC object with the mean |
void calculateFilterValuesVar | ( | MRMFeatureQC & | filter_var, |
const std::vector< MRMFeatureQC > & | filter_values, | ||
const MRMFeatureQC & | filter_mean, | ||
const MRMFeatureQC & | filter_template | ||
) | const |
Calculate the var of each MRMFeatureQC parameter from a list of MRMFeatureQC classes.
[out] | filter_var | A MRMFeatureQC object whose members will be replaced by the variance of the values |
[in] | filter_values | A list of MRMFeatureQC objects |
[in] | filter_mean | A MRMFeatureQC object with the mean values of the filter_values |
[in] | filter_template | A MRMFeatureQC object that will be used as a template to fill in values |
double calculateIonRatio | ( | const Feature & | component_1, |
const Feature & | component_2, | ||
const String & | feature_name | ||
) | const |
Calculates the ion ratio between two transitions.
component_1 | component of the numerator |
component_2 | component of the denominator |
feature_name | name of the feature to calculate the ratio on e.g., peak_apex, peak_area |
Calculates the resolution between two features.
component_1 | component 1 |
component_2 | component 2 |
Calculates the retention time difference between two features.
component_1 | First eluting component |
component_2 | Second eluting component |
bool checkMetaValue | ( | const Feature & | component, |
const String & | meta_value_key, | ||
const double & | meta_value_l, | ||
const double & | meta_value_u, | ||
bool & | key_exists | ||
) | const |
Checks if the metaValue is within the user specified range.
[in] | component | component of the numerator |
[in] | meta_value_key | Name of the metaValue |
[in] | meta_value_l | Lower bound (inclusive) for the metaValue range |
[in] | meta_value_u | Upper bound (inclusive) for the metaValue range |
[out] | key_exists | true if the given key is found, false otherwise |
bool checkRange | ( | const T & | value, |
const T & | value_l, | ||
const T & | value_u | ||
) | const |
Checks that the range of value is bracketed by value_l and value_u.
std::map<String,int> countLabelsAndTransitionTypes | ( | const Feature & | component_group, |
const TargetedExperiment & | transitions | ||
) | const |
Count the number of heavy/light labels and quantifying/detecting/identifying transitions.
component | component_group with subordinates |
transitions | transitions from a TargetedExperiment |
void EstimateBackgroundInterferences | ( | const std::vector< FeatureMap > & | samples, |
MRMFeatureQC & | filter_template, | ||
const TargetedExperiment & | transitions | ||
) | const |
Estimate the background interference level based on the average values from Blank samples. The returned filter_template can then be used by `FilterFeatureMapBackgroundInterference` in order to filter on the `Intensity` members of MRMFeatureQC::ComponentGroupQCs and MRMFeatureQC::ComponentQCs.
[in] | samples | multiple Blank samples to estimate the background intensity values FeatureMaps |
[in,out] | filter_template | A MRMFeatureQC class that will be used as a template to determine what FeatureMap values to estimate the PercentInterference. The average values will be stored in the upper bound parameter of the filter_template |
[in] | transitions | transitions from a TargetedExperiment |
void EstimateDefaultMRMFeatureQCValues | ( | const std::vector< FeatureMap > & | samples, |
MRMFeatureQC & | filter_template, | ||
const TargetedExperiment & | transitions, | ||
const bool & | init_template_values | ||
) | const |
Estimate the lower and upper bound values for the MRMFeatureQC class based on a user supplied template. The template can either be initialized from the first sample (meaning all initial template values are over written) or not (meaning the initial template values will be updated if the ranges are found to be too narrow)
[in] | samples | Samples (typically Standards) from which to estimate the lower and upper bound values for the MRMFeatureQC members |
[in,out] | filter_template | A MRMFeatureQC class that will be used as a template to fill in the estimated lower and upper values. A "template" is needed so that the MRMFeatureQC::meta_value_qc parameters that the FeatureMap::MetaValues that user would like estimated are known. |
[in] | transitions | transitions from a TargetedExperiment |
[in] | init_template_values | Boolean indicating whether to initialize the template values based on the first sample |
void EstimatePercRSD | ( | const std::vector< FeatureMap > & | samples, |
MRMFeatureQC & | filter_template, | ||
const TargetedExperiment & | transitions | ||
) | const |
Estimate the feature variability as measured by PercentRSD from multiple pooled QC samples or replicate Unknown samples. The returned filter_template can then be used by `FilterFeatureMapPercRSD` in order to filter based on the PercentRSD user defined limits.
[in] | samples | multiple pooled QC samples or replicate Unknown samples FeatureMaps |
[in,out] | filter_template | A MRMFeatureQC class that will be used as a template to determine what FeatureMap values to estimate the PercentRSD for. The PercentRSD values will be stored in the upper bound parameter of the filter_template |
[in] | transitions | transitions from a TargetedExperiment |
void FilterFeatureMap | ( | FeatureMap & | features, |
const MRMFeatureQC & | filter_criteria, | ||
const TargetedExperiment & | transitions | ||
) |
Flags or filters features and subordinates in a FeatureMap.
features | FeatureMap to flag or filter |
filter_criteria | MRMFeatureQC class defining QC parameters |
transitions | transitions from a TargetedExperiment |
void FilterFeatureMapBackgroundInterference | ( | FeatureMap & | features, |
const MRMFeatureQC & | filter_criteria, | ||
const MRMFeatureQC & | filter_values | ||
) |
Flags or filters features and subordinates in a FeatureMap based on a user defined set of filter values derived from calling `EstimateBackgroundInterferences`. The user supplied filter_criteria represents the bounds on acceptable PercentBackgroundInterference values. NOTE that filtering is only done on the `Intensity` member.
features | FeatureMap to flag or filter |
filter_criteria | MRMFeatureQC class defining QC parameters defining the acceptable limits of PercentBackgroundInterference where PercentBackgroundInterference = (value Sample)/(value Blank)*100Percent |
filter_values | MRMFeatureQC class filled with bounds representing the average values found in e.g., pooled QC samples or replicate Unknown samples |
void FilterFeatureMapPercRSD | ( | FeatureMap & | features, |
const MRMFeatureQC & | filter_criteria, | ||
const MRMFeatureQC & | filter_values | ||
) |
Flags or filters features and subordinates in a FeatureMap based on a user defined set of filter values derived from calling `EstimatePercRSD`. The user supplied filter_criteria represents the bounds on acceptable PercentRSD values. NOTE that flagging nor filtering will be done on the labels and transitions type counts.
features | FeatureMap to flag or filter |
filter_criteria | MRMFeatureQC class defining QC parameters defining the acceptable limits of the PercentRSD where PercentRSD = (value std dev)/(value mean)*100Percent |
filter_values | MRMFeatureQC class filled with bounds representing the PercentRSD found in e.g., pooled QC samples or replicate Unknown samples |
void getDefaultParameters | ( | Param & | params | ) | const |
Get the class' default parameters.
[out] | params | Output parameters |
StringList getUniqueSorted | ( | const StringList & | messages | ) | const |
Sorts the messages and returns a copy without duplicates.
[in] | messages | A StringList containing the failure messages |
void initMetaValue | ( | const Feature & | component, |
const String & | meta_value_key, | ||
double & | meta_value_l, | ||
double & | meta_value_u, | ||
bool & | key_exists | ||
) | const |
Uses the supplied value to initialize the metaValue ranges to the same value.
[in] | component | component of the numerator |
[in] | meta_value_key | Name of the metaValue |
[in,out] | meta_value_l | Lower bound (inclusive) for the metaValue range |
[in,out] | meta_value_u | Upper bound (inclusive) for the metaValue range |
[out] | key_exists | true if the given key is found, false otherwise |
void initRange | ( | const T & | value, |
T & | value_l, | ||
T & | value_u | ||
) | const |
Sets value_l and value_u to value.
void setMetaValue | ( | const Feature & | component, |
const String & | meta_value_key, | ||
double & | meta_value_l, | ||
double & | meta_value_u, | ||
bool & | key_exists | ||
) | const |
Uses the supplied value to set the metaValue ranges.
[in] | component | component of the numerator |
[in] | meta_value_key | Name of the metaValue |
[in,out] | meta_value_l | Lower bound (inclusive) for the metaValue range |
[in,out] | meta_value_u | Upper bound (inclusive) for the metaValue range |
[out] | key_exists | true if the given key is found, false otherwise |
void setRange | ( | const T & | value, |
T & | value_l, | ||
T & | value_u | ||
) | const |
Sets value_l and value_u to bracket the range 0 to value or value to 0 depending on if value is >0.
void TransferLLOQAndULOQToCalculatedConcentrationBounds | ( | const std::vector< AbsoluteQuantitationMethod > & | quantitation_method, |
MRMFeatureQC & | filter_template | ||
) |
Transfer the lower and upper bound values for the calculated concentrations based off of the AbsoluteQuantitationMethod.
[in] | quantitation_methods | The absolute quantitation methods that has been determined for each component |
[in,out] | filter_template | A MRMFeatureQC class that will be used as a template to fill in the MRMFeatureQC::ComponentQCs.calculated_concentration bounds based on the LLOQ and ULOQ values given in the quantitation_method. |
|
overridevirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
void updateMetaValue | ( | const Feature & | component, |
const String & | meta_value_key, | ||
double & | meta_value_l, | ||
double & | meta_value_u, | ||
bool & | key_exists | ||
) | const |
Updates the metaValue ranges based on the value given.
[in] | component | component of the numerator |
[in] | meta_value_key | Name of the metaValue |
[in,out] | meta_value_l | Lower bound (inclusive) for the metaValue range |
[in,out] | meta_value_u | Upper bound (inclusive) for the metaValue range |
[out] | key_exists | true if the given key is found, false otherwise |
void updateRange | ( | const T & | value, |
T & | value_l, | ||
T & | value_u | ||
) | const |
Updates value_l and value_u according to whether value is greater than value_u or less than value_l.
void zeroFilterValues | ( | MRMFeatureQC & | filter_zeros, |
const MRMFeatureQC & | filter_template | ||
) | const |
Set all members in MRMFeatureQC to zero.
[out] | filter_zero | A MRMFeatureQC object whose members have been set to 0 |
[in] | filter_template | A MRMFeatureQC object that will be used as a template to fill in values |
|
private |
flag or filter (i.e., remove) features that do not pass the QC