Skip to contents

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.

Usage

quantify_by_calibration(
  data = NULL,
  overwrite_metadata = FALSE,
  fit_method = c("linear", "quadratic"),
  fit_weighting = c("none", "1/x", "1/x^2"),
  error_failed_calibration = TRUE,
  error_missing_annotation = TRUE
)

Arguments

data

A MidarExperiment object

overwrite_metadata

If TRUE, any fit method and weighting settings defined in the metadata will be ignored and instead the fit_method and fit_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. If FALSE, failed calibration curve fitting will be ignored, and resulting feature concentration will be NA.

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 be NA

Value

A modified MidarExperiment object with updated concentration values.

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.