OpenMS
AbsoluteQuantitation Class Reference

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>

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

Public Member Functions

 AbsoluteQuantitation ()
 Constructor. More...
 
 ~AbsoluteQuantitation () override
 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< AbsoluteQuantitationMethodgetQuantMethods ()
 quant_method getter. A list of AbsoluteQuantitationMethod classes are returned. More...
 
std::map< String, AbsoluteQuantitationMethodgetQuantMethodsAsMap ()
 
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...
 
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...
 

Protected Member Functions

std::vector< AbsoluteQuantitationStandards::featureConcentrationextractComponents_ (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_ () override
 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, AbsoluteQuantitationMethodquant_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 &key_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< 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

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 & Destructor Documentation

◆ AbsoluteQuantitation()

Constructor.

◆ ~AbsoluteQuantitation()

~AbsoluteQuantitation ( )
override

Destructor.

Member Function Documentation

◆ applyCalibration()

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.

Parameters
componentthe component to be quantified
IS_componentthe internal standard (IS) of the component to be quantified. This can be an empty feature if there is no IS for the component.
feature_namename of the feature to calculate the absolute concentration.
transformation_modelmodel used to fit the calibration points
transformation_model_paramsparameters used by the transformation_model
Returns
The absolute concentration.
Exceptions
Exception::UnableToFit

◆ calculateBias()

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%

Parameters
actual_concentrationthe actual concentration of the component
calculated_concentrationthe calibration curve back calculated concentration of the component
Returns
The bias.
Exceptions
Exception::UnableToFit

◆ calculateBiasAndR()

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.

Parameters
component_concentrationslist of structures with features and concentrations
feature_namename of the feature to calculate the absolute concentration.
transformation_modelmodel used to fit the calibration points
transformation_model_paramsparameters used by the transformation_model
biasesVector of point biases
correlation_coefficientPearson's R
Exceptions
None

◆ calculateRatio()

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

This function calculates the ratio between features.

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.
Exceptions
Exception::UnableToFit

◆ extractComponents_()

std::vector<AbsoluteQuantitationStandards::featureConcentration> extractComponents_ ( const std::vector< AbsoluteQuantitationStandards::featureConcentration > &  component_concentrations,
const std::vector< size_t > &  component_concentrations_indices 
)
protected

This function extracts out the components.

Parameters
component_concentrationslist of structures with features and concentrations
component_concentrations_indicesindices to extract out
Returns
component_concentrations_sub sublist of structures with features and concentrations.
Exceptions
None

◆ fitCalibration()

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.

Parameters
component_concentrationslist of structures with features and concentrations
feature_namename of the feature to calculate the absolute concentration.
transformation_modelmodel used to fit the calibration points
transformation_model_paramsparameters used by the transformation_model
Returns
updated Param object
Exceptions
Exception::UnableToFit

◆ getQuantMethods()

std::vector<AbsoluteQuantitationMethod> getQuantMethods ( )

quant_method getter. A list of AbsoluteQuantitationMethod classes are returned.

◆ getQuantMethodsAsMap()

std::map<String, AbsoluteQuantitationMethod> getQuantMethodsAsMap ( )

◆ jackknifeOutlierCandidate_()

int jackknifeOutlierCandidate_ ( const std::vector< AbsoluteQuantitationStandards::featureConcentration > &  component_concentrations,
const String feature_name,
const String transformation_model,
const Param transformation_model_params 
)
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.

Parameters
component_concentrationslist of structures with features and concentrations
feature_namename of the feature to calculate the absolute concentration.
transformation_modelmodel used to fit the calibration points
transformation_model_paramsparameters used by the transformation_model
Returns
The position of the candidate outlier point in component_concentrations.
Exceptions
Exception::UnableToFitis thrown if fitting cannot be performed

◆ optimizeCalibrationCurveIterative()

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.

Parameters
component_concentrationslist of structures with features and concentrations.
The optimal points will be returned.
feature_namename of the feature to calculate the absolute concentration.
transformation_modelmodel used to fit the calibration points
transformation_model_paramsparameters used by the transformation_model
optimized_paramsoptimized parameters
Returns
true if a a fit was found, false otherwise
Exceptions
Exception::UnableToFit

◆ optimizeCalibrationCurves()

void optimizeCalibrationCurves ( std::map< String, std::vector< AbsoluteQuantitationStandards::featureConcentration >> &  components_concentrations)

This function optimizes the parameters of the calibration for a all components.

Parameters
components_concentrationsAn 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.

◆ optimizeSingleCalibrationCurve()

void optimizeSingleCalibrationCurve ( const String component_name,
std::vector< AbsoluteQuantitationStandards::featureConcentration > &  component_concentrations 
)

This function optimizes the parameters of the calibration for a single component.

Note
This method is provided primarily to ease Python bindings. C++ users are encouraged to use optimizeCalibrationCurves().
Parameters
[in]component_name
[in,out]component_concentrationsThe method will update the argument in place. The resulting value will reflect the optimal set of points for downstream QC/QA.

◆ quantifyComponents()

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.

Parameters
unknownsA FeatureMap to quantify.

◆ residualOutlierCandidate_()

int residualOutlierCandidate_ ( const std::vector< AbsoluteQuantitationStandards::featureConcentration > &  component_concentrations,
const String feature_name,
const String transformation_model,
const Param transformation_model_params 
)
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.

Parameters
component_concentrationslist of structures with features and concentrations
feature_namename of the feature to calculate the absolute concentration.
transformation_modelmodel used to fit the calibration points
transformation_model_paramsparameters used by the transformation_model
Returns
The position of the candidate outlier point in component_concentrations.
Exceptions
Exception::UnableToFitis thrown if fitting cannot be performed

◆ setQuantMethods()

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.

Parameters
quant_methodsA list of AbsoluteQuantitationMethod classes

◆ updateMembers_()

void updateMembers_ ( )
overrideprivatevirtual

Synchronize members with param class.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ max_bias_

double max_bias_
private

◆ max_iters_

size_t max_iters_
private

◆ min_correlation_coefficient_

double min_correlation_coefficient_
private

◆ min_points_

size_t min_points_
private

◆ optimization_method_

String optimization_method_
private

◆ outlier_detection_method_

String outlier_detection_method_
private

◆ quant_methods_

std::map<String, AbsoluteQuantitationMethod> quant_methods_
private

map between components and quantitation methods

◆ use_chauvenet_

bool use_chauvenet_
private