OpenMS
2.7.0
|
AbsoluteQuantitation is a class to support absolute or relative quantitation for targeted or untargeted quantitation workflows (e.g., Isotope Dilution Mass Spectrometry). More...
#include <OpenMS/ANALYSIS/QUANTITATION/AbsoluteQuantitation.h>
Public Member Functions | |
AbsoluteQuantitation () | |
Constructor. More... | |
~AbsoluteQuantitation () | |
Destructor. More... | |
void | setQuantMethods (std::vector< AbsoluteQuantitationMethod > &quant_methods) |
quant_method setter. A list of AbsoluteQuantitationMethod classes are given as input and a map is constructed based on their component_name member. More... | |
std::vector< AbsoluteQuantitationMethod > | getQuantMethods () |
quant_method getter. A list of AbsoluteQuantitationMethod classes are returned. More... | |
std::map< String, AbsoluteQuantitationMethod > | getQuantMethodsAsMap () |
double | calculateRatio (const Feature &component_1, const Feature &component_2, const String &feature_name) |
This function calculates the ratio between features. More... | |
double | calculateBias (const double &actual_concentration, const double &calculated_concentration) |
This function calculates the bias of the calibration. More... | |
Param | fitCalibration (const std::vector< AbsoluteQuantitationStandards::featureConcentration > &component_concentrations, const String &feature_name, const String &transformation_model, const Param &transformation_model_params) |
This function fits the calibration points to the model. More... | |
void | calculateBiasAndR (const std::vector< AbsoluteQuantitationStandards::featureConcentration > &component_concentrations, const String &feature_name, const String &transformation_model, const Param &transformation_model_params, std::vector< double > &biases, double &correlation_coefficient) |
This function calculates the biases and the correlation coefficient of the calibration points. More... | |
bool | optimizeCalibrationCurveIterative (std::vector< AbsoluteQuantitationStandards::featureConcentration > &component_concentrations, const String &feature_name, const String &transformation_model, const Param &transformation_model_params, Param &optimized_params) |
This function optimizes the parameters of the calibration for a given component iteratively. More... | |
void | optimizeCalibrationCurves (std::map< String, std::vector< AbsoluteQuantitationStandards::featureConcentration >> &components_concentrations) |
This function optimizes the parameters of the calibration for a all components. More... | |
void | optimizeSingleCalibrationCurve (const String &component_name, std::vector< AbsoluteQuantitationStandards::featureConcentration > &component_concentrations) |
This function optimizes the parameters of the calibration for a single component. More... | |
double | applyCalibration (const Feature &component, const Feature &IS_component, const String &feature_name, const String &transformation_model, const Param &transformation_model_params) |
This function applies the calibration curve to the component. More... | |
void | quantifyComponents (FeatureMap &unknowns) |
This function applies the calibration curve to all components. 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... | |
Protected Member Functions | |
std::vector< AbsoluteQuantitationStandards::featureConcentration > | extractComponents_ (const std::vector< AbsoluteQuantitationStandards::featureConcentration > &component_concentrations, const std::vector< size_t > &component_concentrations_indices) |
This function extracts out the components. More... | |
int | jackknifeOutlierCandidate_ (const std::vector< AbsoluteQuantitationStandards::featureConcentration > &component_concentrations, const String &feature_name, const String &transformation_model, const Param &transformation_model_params) |
This function computes a candidate outlier point by iteratively leaving one point out to find the one which results in the maximum R^2 of a first order linear regression of the remaining ones. More... | |
int | residualOutlierCandidate_ (const std::vector< AbsoluteQuantitationStandards::featureConcentration > &component_concentrations, const String &feature_name, const String &transformation_model, const Param &transformation_model_params) |
This function computes a candidate outlier point by computing the residuals of all points to the linear fit and selecting the one with the largest deviation. More... | |
Protected Member Functions inherited from DefaultParamHandler | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Private Member Functions | |
void | updateMembers_ () |
Synchronize members with param class. More... | |
Private Attributes | |
size_t | min_points_ |
double | max_bias_ |
double | min_correlation_coefficient_ |
size_t | max_iters_ |
String | outlier_detection_method_ |
bool | use_chauvenet_ |
String | optimization_method_ |
std::map< String, AbsoluteQuantitationMethod > | quant_methods_ |
map between components and quantitation methods More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from DefaultParamHandler | |
static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &prefix="") |
Writes all parameters to meta values. 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... | |
AbsoluteQuantitation is a class to support absolute or relative quantitation for targeted or untargeted quantitation workflows (e.g., Isotope Dilution Mass Spectrometry).
Method: A transformation model where y = ratio (analyte/IS) corresponding to peak height or peak area and x = ratio (analyte/IS) corresponding to concentration is used to fit a series of runs with standards of known concentrations that span the detection range of the instrument. The fitted transformation model can then be used to quantify the concentration of an analyte in an unknown sample given the analyte peak height or area, IS peak height or area, and IS concentration.
Terms: component: A protein, peptide, or compound fragment, transition, or whole species that is measured by e.g., LC-MS, LC-MS/MS, GC-MS, GC-MS/MS, LC-MS-TOF, HPLC-UV, HPLC-IR, etc. calibration curve: A series of standards that are used to correlate instrument measurements to actual concentrations
Constructor.
~AbsoluteQuantitation | ( | ) |
Destructor.
double applyCalibration | ( | const Feature & | component, |
const Feature & | IS_component, | ||
const String & | feature_name, | ||
const String & | transformation_model, | ||
const Param & | transformation_model_params | ||
) |
This function applies the calibration curve to the component.
component | the component to be quantified |
IS_component | the internal standard (IS) of the component to be quantified. This can be an empty feature if there is no IS for the component. |
feature_name | name of the feature to calculate the absolute concentration. |
transformation_model | model used to fit the calibration points |
transformation_model_params | parameters used by the transformation_model |
Exception::UnableToFit |
double calculateBias | ( | const double & | actual_concentration, |
const double & | calculated_concentration | ||
) |
This function calculates the bias of the calibration.
The bias is defined as the following: |actual_concentration - calculated_concentration|/actual_concentration * 100% This is in contrast to accuracy, which is defined as the following: calculated_concentration/actual_concentration * 100%
actual_concentration | the actual concentration of the component |
calculated_concentration | the calibration curve back calculated concentration of the component |
Exception::UnableToFit |
void calculateBiasAndR | ( | const std::vector< AbsoluteQuantitationStandards::featureConcentration > & | component_concentrations, |
const String & | feature_name, | ||
const String & | transformation_model, | ||
const Param & | transformation_model_params, | ||
std::vector< double > & | biases, | ||
double & | correlation_coefficient | ||
) |
This function calculates the biases and the correlation coefficient of the calibration points.
component_concentrations | list of structures with features and concentrations |
feature_name | name of the feature to calculate the absolute concentration. |
transformation_model | model used to fit the calibration points |
transformation_model_params | parameters used by the transformation_model |
biases | Vector of point biases |
correlation_coefficient | Pearson's R |
None |
double calculateRatio | ( | const Feature & | component_1, |
const Feature & | component_2, | ||
const String & | feature_name | ||
) |
This function calculates the ratio between features.
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 |
Exception::UnableToFit |
|
protected |
This function extracts out the components.
component_concentrations | list of structures with features and concentrations |
component_concentrations_indices | indices to extract out |
None |
Param fitCalibration | ( | const std::vector< AbsoluteQuantitationStandards::featureConcentration > & | component_concentrations, |
const String & | feature_name, | ||
const String & | transformation_model, | ||
const Param & | transformation_model_params | ||
) |
This function fits the calibration points to the model.
component_concentrations | list of structures with features and concentrations |
feature_name | name of the feature to calculate the absolute concentration. |
transformation_model | model used to fit the calibration points |
transformation_model_params | parameters used by the transformation_model |
Exception::UnableToFit |
std::vector<AbsoluteQuantitationMethod> getQuantMethods | ( | ) |
quant_method getter. A list of AbsoluteQuantitationMethod classes are returned.
std::map<String, AbsoluteQuantitationMethod> getQuantMethodsAsMap | ( | ) |
|
protected |
This function computes a candidate outlier point by iteratively leaving one point out to find the one which results in the maximum R^2 of a first order linear regression of the remaining ones.
component_concentrations | list of structures with features and concentrations |
feature_name | name of the feature to calculate the absolute concentration. |
transformation_model | model used to fit the calibration points |
transformation_model_params | parameters used by the transformation_model |
Exception::UnableToFit | is thrown if fitting cannot be performed |
bool optimizeCalibrationCurveIterative | ( | std::vector< AbsoluteQuantitationStandards::featureConcentration > & | component_concentrations, |
const String & | feature_name, | ||
const String & | transformation_model, | ||
const Param & | transformation_model_params, | ||
Param & | optimized_params | ||
) |
This function optimizes the parameters of the calibration for a given component iteratively.
component_concentrations | list of structures with features and concentrations. The optimal points will be returned. |
feature_name | name of the feature to calculate the absolute concentration. |
transformation_model | model used to fit the calibration points |
transformation_model_params | parameters used by the transformation_model |
optimized_params | optimized parameters |
Exception::UnableToFit |
void optimizeCalibrationCurves | ( | std::map< String, std::vector< AbsoluteQuantitationStandards::featureConcentration >> & | components_concentrations | ) |
This function optimizes the parameters of the calibration for a all components.
components_concentrations | An AbsoluteQuantitationStandards::components_to_concentrations type. Note that the method will update the list of featureConcentrations in place. The resulting components_concentrations will reflect the optimal set of points for downstream QC/QA. |
void optimizeSingleCalibrationCurve | ( | const String & | component_name, |
std::vector< AbsoluteQuantitationStandards::featureConcentration > & | component_concentrations | ||
) |
This function optimizes the parameters of the calibration for a single component.
[in] | component_name | |
[in,out] | component_concentrations | The method will update the argument in place. The resulting value will reflect the optimal set of points for downstream QC/QA. |
void quantifyComponents | ( | FeatureMap & | unknowns | ) |
This function applies the calibration curve to all components.
An additional annotation for metaValue of "calculated_concentration" and "concentration_units" corresponding to the absolute concentration as back-calculated from the fitted calibration curve model and parameters will be added to each sub-feature. It is assumed that all duplicate components have been removed. If not, the function will quantify all components, but the first internal standard found will be used to calculate the ratio for the calculation.
unknowns | A FeatureMap to quantify. |
|
protected |
This function computes a candidate outlier point by computing the residuals of all points to the linear fit and selecting the one with the largest deviation.
component_concentrations | list of structures with features and concentrations |
feature_name | name of the feature to calculate the absolute concentration. |
transformation_model | model used to fit the calibration points |
transformation_model_params | parameters used by the transformation_model |
Exception::UnableToFit | is thrown if fitting cannot be performed |
void setQuantMethods | ( | std::vector< AbsoluteQuantitationMethod > & | quant_methods | ) |
quant_method setter. A list of AbsoluteQuantitationMethod classes are given as input and a map is constructed based on their component_name member.
quant_methods | A list of AbsoluteQuantitationMethod classes |
|
privatevirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
map between components and quantitation methods
|
private |