Description Usage Arguments Value Examples
Identifies systematic deviations in metabolic data using a smoothing fit. Timepoints that have a median relative deviation above a threshold value are assumed to be influenced by a measurement or methodological bias as compared to the overall trends metabolite concentrations.
1 2 | correct_rel_bias(time, concentration, metabolite, f_smooth = met_smooth_gam,
max.iter = 20, min.deviation = 0.02, ...)
|
time |
A vector of times or sample numbers for metabolite time-courses.
Note, there should be a time value for every |
concentration |
A vector of metabolite concentrations. |
metabolite |
A vector of metabolite names that correspond to |
f_smooth |
Smoothing function (set to met_smooth_gam by default). |
max.iter |
The algorithm correct the single most deviating point at one
time (as it may influence the identification of other
deviations). |
min.deviation |
Smallest median relative deviation to identify as a bias. 0.02 has been found to be a good default for a diverse set of metabolic time-courses from higher eukaryote cell culture. |
... |
Arguments to be passed into |
A vector of corrected concentrations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # Using previously simulated data 40 metabolic trends with 10 time points
data(timecourse)
# Adding an error of 5% at sample 4
logic <- timecourse$sample == 4
timecourse$concentration[logic] <- timecourse$concentration[logic] * 1.05
# Correcting
timecourse$corrected <- correct_rel_bias(timecourse$time,
timecourse$concentration,
timecourse$metabolite)
# Plotting -- the original value of the corrected point is marked in red
par(mfrow = c(8, 5), oma = c(5, 4, 1, 1) + 0.1, mar = c(1, 1, 1, 1) + 0.1)
new.time <- seq(min(timecourse$time), max(timecourse$time), length.out=100)
for (metabolite in unique(timecourse$metabolite)) {
logic <- timecourse$metabolite == metabolite
d <- timecourse[logic, ]
logic2 <- d$concentration != d$corrected
plot(d$time, d$corrected, pch = 16, xlab = '', ylab = '',
ylim = c(min(d$concentration), max(d$concentration)))
smoothed <- met_smooth_gam(d$time, d$corrected,
new.time = new.time, k = 5)
lines(new.time, smoothed)
points(d$time[logic2], d$concentration[logic2], pch = 16, col = 'red')
}
title(xlab = 'Time post inoculation (hours)',
ylab = 'Concentration (mM)', outer = TRUE, line = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.