OpenMS  2.8.0
Public Member Functions | Private Attributes | List of all members
MRMFeatureFilter Class Reference

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>

Inheritance diagram for MRMFeatureFilter:
[legend]
Collaboration diagram for MRMFeatureFilter:
[legend]

Public Member Functions

 MRMFeatureFilter ()
 Constructor. More...
 
 ~MRMFeatureFilter () override
 Destructor. More...
 
void getDefaultParameters (Param &params) 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 DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () 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< Stringsubsections_
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MRMFeatureFilter()

Constructor.

◆ ~MRMFeatureFilter()

~MRMFeatureFilter ( )
override

Destructor.

Member Function Documentation

◆ accumulateFilterValues()

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.

Parameters
[out]filter_valuesA list of MRMFeatureQC objects filled with the values determined by the filter_template from the samples
[in]samplesA list of feature maps
[in]filter_templateA MRMFeatureQC object that will be used as a template to fill in values derived from the sample feature maps
[in]transitionstransitions from a TargetedExperiment

◆ calculateFilterValuesMean()

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.

Parameters
[out]filter_meanA MRMFeatureQC object whose members will be replaced by the mean values
[in]filter_valuesA list of MRMFeatureQC objects
[in]filter_templateA MRMFeatureQC object that will be used as a template to fill in values

◆ calculateFilterValuesPercRSD()

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.

Parameters
[out]filter_rsdA MRMFeatureQC object whose members will be replaced by PercentRSD
[in]filter_varA MRMFeatureQC object with the variance
[in]filter_meanA MRMFeatureQC object with the mean

◆ calculateFilterValuesVar()

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.

Parameters
[out]filter_varA MRMFeatureQC object whose members will be replaced by the variance of the values
[in]filter_valuesA list of MRMFeatureQC objects
[in]filter_meanA MRMFeatureQC object with the mean values of the filter_values
[in]filter_templateA MRMFeatureQC object that will be used as a template to fill in values

◆ calculateIonRatio()

double calculateIonRatio ( const Feature component_1,
const Feature component_2,
const String feature_name 
) const

Calculates the ion ratio between two transitions.

Parameters
component_1component of the numerator
component_2component of the denominator
feature_namename of the feature to calculate the ratio on e.g., peak_apex, peak_area
Returns
The ratio.

◆ calculateResolution()

double calculateResolution ( Feature component_1,
Feature component_2 
) const

Calculates the resolution between two features.

Parameters
component_1component 1
component_2component 2
Returns
The difference.

◆ calculateRTDifference()

double calculateRTDifference ( Feature component_1,
Feature component_2 
) const

Calculates the retention time difference between two features.

Parameters
component_1First eluting component
component_2Second eluting component
Returns
The difference.

◆ checkMetaValue()

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.

Parameters
[in]componentcomponent of the numerator
[in]meta_value_keyName of the metaValue
[in]meta_value_lLower bound (inclusive) for the metaValue range
[in]meta_value_uUpper bound (inclusive) for the metaValue range
[out]key_existstrue if the given key is found, false otherwise
Returns
True if the metaValue is within the bounds, and False otherwise.

◆ checkRange()

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.

◆ countLabelsAndTransitionTypes()

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.

Parameters
componentcomponent_group with subordinates
transitionstransitions from a TargetedExperiment
Returns
Map of labels/transition types and their corresponding number.

◆ EstimateBackgroundInterferences()

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.

Parameters
[in]samplesmultiple Blank samples to estimate the background intensity values FeatureMaps
[in,out]filter_templateA 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]transitionstransitions from a TargetedExperiment

◆ EstimateDefaultMRMFeatureQCValues()

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)

Parameters
[in]samplesSamples (typically Standards) from which to estimate the lower and upper bound values for the MRMFeatureQC members
[in,out]filter_templateA 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]transitionstransitions from a TargetedExperiment
[in]init_template_valuesBoolean indicating whether to initialize the template values based on the first sample

◆ EstimatePercRSD()

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.

Parameters
[in]samplesmultiple pooled QC samples or replicate Unknown samples FeatureMaps
[in,out]filter_templateA 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]transitionstransitions from a TargetedExperiment

◆ FilterFeatureMap()

void FilterFeatureMap ( FeatureMap features,
const MRMFeatureQC filter_criteria,
const TargetedExperiment transitions 
)

Flags or filters features and subordinates in a FeatureMap.

Parameters
featuresFeatureMap to flag or filter
filter_criteriaMRMFeatureQC class defining QC parameters
transitionstransitions from a TargetedExperiment

◆ FilterFeatureMapBackgroundInterference()

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.

Parameters
featuresFeatureMap to flag or filter
filter_criteriaMRMFeatureQC class defining QC parameters defining the acceptable limits of PercentBackgroundInterference where PercentBackgroundInterference = (value Sample)/(value Blank)*100Percent
filter_valuesMRMFeatureQC class filled with bounds representing the average values found in e.g., pooled QC samples or replicate Unknown samples

◆ FilterFeatureMapPercRSD()

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.

Parameters
featuresFeatureMap to flag or filter
filter_criteriaMRMFeatureQC class defining QC parameters defining the acceptable limits of the PercentRSD where PercentRSD = (value std dev)/(value mean)*100Percent
filter_valuesMRMFeatureQC class filled with bounds representing the PercentRSD found in e.g., pooled QC samples or replicate Unknown samples

◆ getDefaultParameters()

void getDefaultParameters ( Param params) const

Get the class' default parameters.

Parameters
[out]paramsOutput parameters

◆ getUniqueSorted()

StringList getUniqueSorted ( const StringList messages) const

Sorts the messages and returns a copy without duplicates.

Parameters
[in]messagesA StringList containing the failure messages
Returns
A copy of the input, without duplicates

◆ initMetaValue()

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.

Parameters
[in]componentcomponent of the numerator
[in]meta_value_keyName of the metaValue
[in,out]meta_value_lLower bound (inclusive) for the metaValue range
[in,out]meta_value_uUpper bound (inclusive) for the metaValue range
[out]key_existstrue if the given key is found, false otherwise

◆ initRange()

void initRange ( const T &  value,
T &  value_l,
T &  value_u 
) const

Sets value_l and value_u to value.

◆ setMetaValue()

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.

Parameters
[in]componentcomponent of the numerator
[in]meta_value_keyName of the metaValue
[in,out]meta_value_lLower bound (inclusive) for the metaValue range
[in,out]meta_value_uUpper bound (inclusive) for the metaValue range
[out]key_existstrue if the given key is found, false otherwise

◆ setRange()

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.

◆ TransferLLOQAndULOQToCalculatedConcentrationBounds()

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.

Parameters
[in]quantitation_methodsThe absolute quantitation methods that has been determined for each component
[in,out]filter_templateA 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.

◆ updateMembers_()

void updateMembers_ ( )
overridevirtual

Synchronize members with param class.

Reimplemented from DefaultParamHandler.

◆ updateMetaValue()

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.

Parameters
[in]componentcomponent of the numerator
[in]meta_value_keyName of the metaValue
[in,out]meta_value_lLower bound (inclusive) for the metaValue range
[in,out]meta_value_uUpper bound (inclusive) for the metaValue range
[out]key_existstrue if the given key is found, false otherwise

◆ updateRange()

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.

◆ zeroFilterValues()

void zeroFilterValues ( MRMFeatureQC filter_zeros,
const MRMFeatureQC filter_template 
) const

Set all members in MRMFeatureQC to zero.

Parameters
[out]filter_zeroA MRMFeatureQC object whose members have been set to 0
[in]filter_templateA MRMFeatureQC object that will be used as a template to fill in values

Member Data Documentation

◆ flag_or_filter_

String flag_or_filter_
private

flag or filter (i.e., remove) features that do not pass the QC