Title: | Individual Growth Curve Parameter Calculation using Polynomial Functions |
---|---|
Description: | Calculation of key bacterial growth curve parameters using fourth degree polynomial functions. Six growth curve parameters are provided including peak growth rate, doubling time, lag time, maximum growth, and etc. 'ipolygrowth' takes time series data from individual biological samples (with technical replicates) or multiple samples. |
Authors: | Jifan Wang [aut, cre, cph] |
Maintainer: | Jifan Wang <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0.9000 |
Built: | 2025-03-03 04:49:30 UTC |
Source: | https://github.com/kivanvan/ipolygrowth |
This function estimates growth parameters for multiple (biological) samples. Technical replicates (multiple time series) are allowed.
ipg_multisample(data, id, time.name, y.name, epsilon = 0.2/100)
ipg_multisample(data, id, time.name, y.name, epsilon = 0.2/100)
data |
Input data frame containing the time and dependent variable (y) of multiple biological samples. Data needs to be in long format (i.e. one row per time point per sample). Remove rows with missing in the dependent variable (y). |
id |
Unique identifier to indicate each biological sample. |
time.name |
Name of the time variable. The variable needs to be numeric. |
y.name |
Name of the dependent variable (y). The variable needs to be numeric. |
epsilon |
Convergence threshold for max y time calculation. The input represents the fraction of the range of the observed dependent variable (y). It needs to be between 0 and 1, and a small value is recommended. The input can be either a single value or a vector of different values (in the same length and order as id) for multiple samples. Default is 0.2% for all samples. |
The function uses the same approach to estimate growth parameters as in ipg_singlesample()
.
A list that contains a table of estimates, polynomial models, a table of beta coefficients, and a table of fitted values, all by sample ID. Growth parameters include peak growth rate, peak growth time, doubling time (at the peak growth), lag time, max y, and max y time.
library(dplyr) data <- growthrates::bactgrowth data <- data %>% mutate(id = paste(strain, conc, sep = "-")) out.multisample <- ipg_multisample(data, "id", "time", "value", 0.2/100)
library(dplyr) data <- growthrates::bactgrowth data <- data %>% mutate(id = paste(strain, conc, sep = "-")) out.multisample <- ipg_multisample(data, "id", "time", "value", 0.2/100)
This function estimates growth parameters for a single (biological) sample. Technical replicates (multiple time series) are allowed.
ipg_singlesample(data, time.name, y.name, epsilon = 0.2/100)
ipg_singlesample(data, time.name, y.name, epsilon = 0.2/100)
data |
Input data frame containing the time and dependent variable (y) from a single biological sample. Data needs to be in long format (i.e. one row per time point). Remove rows with missing in the dependent variable (y). |
time.name |
Name of the time variable. The variable needs to be numeric. |
y.name |
Name of the dependent variable (y). The variable needs to be numeric. |
epsilon |
Convergence threshold for max y time calculation. The input represents the fraction of the range of the observed dependent variable (y). The input needs to be between 0 and 1, and a small value is recommended. Default is 0.2%. |
This function calculates growth curve parameters for a single sample. A 4th degree polynomial is fit to the input data using ordinary least squares estimation. Peak growth time is identified using the second derivative of the estimated polynomial function. Peak growth rate is calculated using the first derivative at peak growth time. Doubling time at peak growth is calculated using the equation: ln(2)/peak growth rate . Lag time is determined using linear interpolation of the peak growth rate to identify the start of the exponential growth phase. Max y time is identified by convergence of the dependent variable where the growth curve reaches an asymptote, with convergence threshold epsilon. Max y is the value of the fitted polynomial function at max y time.
A list that contains a table of estimates, the polynomial model, a table of beta coefficients, and a table of fitted values. Growth parameters include peak growth rate, peak growth time, doubling time (at the peak growth), lag time, max y, and max y time.
library(dplyr) data <- growthrates::bactgrowth df.singlesample <- data %>% dplyr::filter(strain == "D", conc == 0) out.singlesample <- ipg_singlesample(data = df.singlesample, time.name = "time", y.name = "value")
library(dplyr) data <- growthrates::bactgrowth df.singlesample <- data %>% dplyr::filter(strain == "D", conc == 0) out.singlesample <- ipg_singlesample(data = df.singlesample, time.name = "time", y.name = "value")