Calculate concentrations based on external calibration
Source:R/calc-calibrations.R
quantify_by_calibration.Rd
Concentrations of all features in all analyses are determined using ISTD-normalized intensities and corresponding external calibration curves.
Calibration curves are calculated for each feature based on calibration sample concentrations defined in the qc_concentrations
metadata.
The regression fit model (linear or quadratic) and the weighting method (either "none", "1/x", or "1/x^2") can be defined globally via
the arguments fit_method
and fit_weighting
for all features, if overwrite_metadata
is TRUE
.
Alternatively, the model and weighting can be defined individually for each feature in the feature
metadata (columns curve_fit_method
and fit_weighting
).
If these details are missing in the metadata, the default values provided via fit_method
and fit_weighting
will be used.
Arguments
- data
A
MidarExperiment
object- overwrite_metadata
If
TRUE
, any fit method and weighting settings defined in the metadata will be ignored and instead thefit_method
andfit_weighting
are used for all features- fit_method
A character string indicating the default regression fit method to use for the calibration curve. Must be one of
"linear"
or"quadratic"
. This method will be used if no specific fit method is defined for a feature in the metadata.- fit_weighting
A character string indicating the default weighting method for the regression points in the calibration curve. Must be one of
"none"
,"1/x"
, or"1/x^2"
. If no specific weighting method is defined for a feature in the metadata, this method will be used.- error_failed_calibration
If
TRUE
, an error will be raised if the calibration curve fitting failed for any feature. IfFALSE
, failed calibration curve fitting will be ignored, and resulting feature concentration will beNA
.- error_missing_annotation
Raise error if any of the following information is missing: calibration curve data, ISTD mix volume and sample amounts for any feature. If
FALSE
, missing annotations will be ignored, and resulting feature concentration will beNA
Details
The concentrations are added to the dataset
table as feature_conc
column. The results of the regression and the calculated LoD and LoQ values are stored in the metrics_calibration
table of the returned MidarExperiment
object.
See also
calc_calibration_results()
for calculating the calibration curve results including LoD and LoQ.
quantify_by_istd()
for calculation of concentrations based on spiked-in internal standard concentration.