View source: R/aa_baseline_correction.R
| aa_baseline_correction | R Documentation |
Corrects isotopic ratios by subtracting a source amino acid baseline (e.g., Phe or Lys) to isolate trophic enrichment. Automatically handles both raw data and averaged (Mean/SD) data, applying exact quadrature error propagation for standard deviations.
aa_baseline_correction(
data,
references = "Phe",
invert = "Thr",
drop_ref = TRUE
)
data |
A data frame containing isotopic ratios. |
references |
Character vector of the amino acid(s) to use as the baseline.
If multiple are provided (e.g., |
invert |
Character vector of amino acids that undergo inverse trophic
fractionation (typically |
drop_ref |
Logical. If |
A data.frame of the same class as data with baseline-corrected
isotopic values. For raw datasets, ratios are updated in place; for averaged datasets,
means and standard deviations are updated with propagated quadrature errors.
If drop_ref = TRUE, columns corresponding to references are omitted.
# Example using raw isotopic ratio data
raw_df <- data.frame(
R_Phe = c(5.1, 5.3, 5.0),
R_Glu = c(15.2, 16.0, 15.5),
R_Thr = c(-2.1, -2.5, -2.0)
)
aa_baseline_correction(raw_df, references = "Phe", invert = "Thr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.