calibrate_mw: Perform a molecular weight calibration

View source: R/calibrate_mw.R

calibrate_mwR Documentation

Perform a molecular weight calibration

Description

Perform a molecular weight calibration

Usage

calibrate_mw(
  time,
  mw,
  type = "quadratic",
  newdata = NULL,
  output = "time",
  predict = TRUE
)

Arguments

time

A numeric vector of retention times.

mw

A numeric vector of molecular weights.

type

Chosse from a "linear" or "quadratic" fit.

newdata

A vector of retention times or molecular weights.

output

Choose the output type: "time" for retention time or "mw" for molecular weight. Output "time" is an inverse prediction useful primarily for plotting.

predict

Logical. Predict from the model?

Value

An object of class "lm" if predict = FALSE, or a vector of model predictions/inverse predictions if predict = TRUE.

Examples

retention <- c(11.35890, 19.49773, 19.24173, 13.88310, 18.73001, 17.67315)
mw_kda <- c(0.69, 2000.00, 440.00, 1.80, 158.00, 44.00)
# return tick positions for 1, 10, 100, and 1000 kDa,
# based on a quadratic calibration curve:
calibrate_mw(retention, mw_kda, newdata = c(1, 10, 100, 1000), predict = TRUE)

bentrueman/fffprocessr documentation built on June 23, 2024, 1:23 a.m.