OpenMS
Loading...
Searching...
No Matches
MRMFeatureFilter.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Douglas McCloskey, Pasquale Domenico Colaianni $
6// $Authors: Douglas McCloskey, Pasquale Domenico Colaianni $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
17
20
21namespace OpenMS
22{
23 class AbsoluteQuantitationMethod;
24
43 class OPENMS_DLLAPI MRMFeatureFilter :
45 {
46
47public:
48
50
52
56
62 void getDefaultParameters(Param& params) const;
63
65 void updateMembers_() override;
66
75 void FilterFeatureMap(FeatureMap& features, const MRMFeatureQC& filter_criteria,
76 const TargetedExperiment& transitions);
77
90 void FilterFeatureMapPercRSD(FeatureMap& features, const MRMFeatureQC& filter_criteria, const MRMFeatureQC& filter_values);
91
105 void FilterFeatureMapBackgroundInterference(FeatureMap& features, const MRMFeatureQC& filter_criteria, const MRMFeatureQC& filter_values);
106
119 void EstimateDefaultMRMFeatureQCValues(const std::vector<FeatureMap>& samples, MRMFeatureQC& filter_template, const TargetedExperiment& transitions, const bool& init_template_values) const;
120
129 void TransferLLOQAndULOQToCalculatedConcentrationBounds(const std::vector<AbsoluteQuantitationMethod>& quantitation_method, MRMFeatureQC& filter_template);
130
141 void EstimatePercRSD(const std::vector<FeatureMap>& samples, MRMFeatureQC& filter_template, const TargetedExperiment& transitions) const;
142
153 void EstimateBackgroundInterferences(const std::vector<FeatureMap>& samples, MRMFeatureQC& filter_template, const TargetedExperiment& transitions) const;
154
165 double calculateIonRatio(const Feature& component_1, const Feature& component_2, const String& feature_name) const;
166
175 double calculateRTDifference(Feature& component_1, Feature& component_2) const;
176
185 double calculateResolution(Feature& component_1, Feature& component_2) const;
186
199 const Feature& component,
200 const String& meta_value_key,
201 const double& meta_value_l,
202 const double& meta_value_u,
203 bool& key_exists
204 ) const;
205
216 const Feature& component,
217 const String& meta_value_key,
218 double& meta_value_l,
219 double& meta_value_u,
220 bool& key_exists
221 ) const;
222
233 const Feature& component,
234 const String& meta_value_key,
235 double& meta_value_l,
236 double& meta_value_u,
237 bool& key_exists
238 ) const;
239
250 const Feature& component,
251 const String& meta_value_key,
252 double& meta_value_l,
253 double& meta_value_u,
254 bool& key_exists
255 ) const;
256
265 std::map<String,int> countLabelsAndTransitionTypes(const Feature& component_group,
266 const TargetedExperiment& transitions) const;
267
275 StringList getUniqueSorted(const StringList& messages) const;
276
285 void accumulateFilterValues(std::vector<MRMFeatureQC>& filter_values, const std::vector<FeatureMap>& samples, const MRMFeatureQC& filter_template, const TargetedExperiment& transitions) const;
286
293 void zeroFilterValues(MRMFeatureQC& filter_zeros, const MRMFeatureQC& filter_template) const;
294
302 void calculateFilterValuesMean(MRMFeatureQC& filter_mean, const std::vector<MRMFeatureQC>& filter_values, const MRMFeatureQC& filter_template) const;
303
312 void calculateFilterValuesVar(MRMFeatureQC& filter_var, const std::vector<MRMFeatureQC>& filter_values, const MRMFeatureQC& filter_mean, const MRMFeatureQC& filter_template) const;
313
321 void calculateFilterValuesPercRSD(MRMFeatureQC& filter_rsd, const MRMFeatureQC& filter_mean, const MRMFeatureQC& filter_var) const;
322
324 template <typename T>
325 bool checkRange(const T& value, const T& value_l, const T& value_u) const;
326
328 template <typename T>
329 void updateRange(const T& value, T& value_l, T& value_u) const;
330
332 template <typename T>
333 void setRange(const T& value, T& value_l, T& value_u) const;
334
336 template <typename T>
337 void initRange(const T& value, T& value_l, T& value_u) const;
338
339private:
340 // Members
343 };
344}
345
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
A container for features.
Definition FeatureMap.h:82
An LC-MS feature.
Definition Feature.h:46
The MRMFeatureFilter either flags components and/or transitions that do not pass the QC criteria or f...
Definition MRMFeatureFilter.h:45
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 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.
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.
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 valu...
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 Absolute...
String flag_or_filter_
flag or filter (i.e., remove) features that do not pass the QC
Definition MRMFeatureFilter.h:342
StringList getUniqueSorted(const StringList &messages) const
Sorts the messages and returns a copy without duplicates.
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 valu...
double calculateRTDifference(Feature &component_1, Feature &component_2) const
Calculates the retention time difference between two features.
void zeroFilterValues(MRMFeatureQC &filter_zeros, const MRMFeatureQC &filter_template) const
Set all members in MRMFeatureQC to zero.
void initRange(const T &value, T &value_l, T &value_u) const
Sets value_l and value_u to value.
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.
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 templat...
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.
double calculateResolution(Feature &component_1, Feature &component_2) const
Calculates the resolution between two features.
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....
void FilterFeatureMap(FeatureMap &features, const MRMFeatureQC &filter_criteria, const TargetedExperiment &transitions)
Flags or filters features and subordinates in a FeatureMap.
void updateMembers_() override
Synchronize members with param class.
double calculateIonRatio(const Feature &component_1, const Feature &component_2, const String &feature_name) const
Calculates the ion ratio between two transitions.
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.
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.
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.
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 replica...
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.
~MRMFeatureFilter() override
Destructor.
void getDefaultParameters(Param &params) const
Get the class' default parameters.
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.
MRMFeatureFilter()
Constructor.
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-comput...
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.
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition MRMFeatureQC.h:60
Management and storage of parameters / INI files.
Definition Param.h:46
A more convenient string class.
Definition String.h:34
A description of a targeted experiment containing precursor and production ions.
Definition TargetedExperiment.h:39
std::vector< String > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19