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_model
and fit_weighting
for all features, if overwrite_fit_param
is TRUE
.
Alternatively, the model and weighting can be defined individually for each feature in the feature
metadata (columns curve_fit_model
and fit_weighting
).
If these details are missing in the metadata, the default values provided via fit_model
and fit_weighting
will be used.
Arguments
- data
A
MidarExperiment
object- include_qualifier
A logical value. If
TRUE
, the function will include quantifier features in the calibration curve calculations.- overwrite_fit_param
If
TRUE
, the function will ignore any fit method and weighting settings defined in the metadata and use the providedfit_model
andfit_weighting
values for all analytes.- fit_model
A character string specifying the default regression fit method to use for the calibration curve. Must be one of
"linear"
or"quadratic"
. This method will be applied if no specific fit method is defined for a feature in the metadata, or whenoverwrite_fit_param = TRUE
.- fit_weighting
A character string specifying the default weighting method for the regression points in the calibration curve. Must be one of
"none"
,"1/x"
, or"1/x^2"
. This method will be applied if no specific weighting method is defined for a feature in the metadata, or whenoverwrite_fit_param = TRUE
.- ignore_failed_calibration
If
FALSE
, raises error if calibration curve fit fails for any feature. IfTRUE
, failed fits will be ignored, and resulting feature concentration will beNA
.- ignore_missing_annotation
If
FALSE
, raises error if any of the following information is missing: calibration curve data, ISTD mix volume and sample amounts for any feature. IfTRUE
, 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.