kp {OenoKPM} | R Documentation |
Calculates kinetic parameters as a function of model fit for CO2 production as a function of time
Description
A function that, based on the observed data, the independent variable (e.g. time in h) and the dependent variable (e.g. CO2 production in g L-1), performs the modeling of the fermentation curve based on the chosen model (5PL, Gompertz, or 4PL).
Next, the coefficients are used in mathematical formulas to obtain the following kinetic parameters:
tLag - Duration of the latency phase for CO2 production;
Vmax - Maximum rate of production of CO2;
tVmax - Moment in which maximum fermentation rate occurs;
CO2Vmax - CO2 Produced until Maximum fermentation rate occurs;
Ymax - Maximum production of carbon dioxide (CO2);
Usage
kp(
data,
model,
save.xls = FALSE,
dir.save,
xls.name,
startA,
startB,
startC,
startD,
startG
)
Arguments
data |
Data frame to be analyzed. The data frame must be in the following order:
|
model |
Model to be adjusted. Argument for model:
|
save.xls |
If TRUE, an xlsx file containing the coefficients and kinetic parameters will be saved in the working directory. If FALSE, the xlsx file will not be saved. |
dir.save |
Directory path where the xlsx file is to be saved. |
xls.name |
File name. Must contain the format. For example, "Parameters.xlsx". |
startA |
Starting estimate of the value of A for model. |
startB |
Starting estimate of the value of B for model. |
startC |
Starting estimate of the value of C for model. |
startD |
Starting estimate of the value of D for model. |
startG |
Starting estimate of the value of G for model. |
Details
Curve fitting from the observed data is performed by the nlsLM() function in the 'minpack.lm' package.
You can see our article for more details on the mathematical formulas used to obtain each kinetic parameter (Gava et al., 2020). In addition, feel free to use it as a reference in your works.
Value
The analyzed model coefficients and the calculated kinetic parameters are returned in a data.frame. In addition, a "Parameters.xlsx" file can be generated, containing the coefficients and kinetic parameters of each studied fermentation curve.
Author(s)
Angelo Gava
References
Gava, A., Borsato, D., & Ficagna, E. (2020). Effect of mixture of fining agents on the fermentation kinetics of base wine for sparkling wine production: Use of methodology for modeling. LWT, 131, 109660. doi:10.1016/j.lwt.2020.109660
Zwietering, M. H., Jongenburger, I., Rombouts, F. M., & Van't Riet, K. J. A. E. M. (1990). Modeling of the bacterial growth curve. Applied and environmental microbiology, 56(6), 1875-1881. doi:10.1128/aem.56.6.1875-1881.1990
Examples
#Creating a data.frame.
#First, columns containing independent variable.
#Second, columns containing dependent variable.
#The data frame created presents two
#fermentation curves for two yeasts with
#different times and carbon dioxide production.
df <- data.frame('Time_Yeast_A' = seq(0,280, by=6.23),
'Time_Yeast_B' = seq(0,170, by=3.7777778),
'CO2_Production_Yeast_A' = c(0,0.97,4.04,9.62,13.44,17.50,
24.03,27.46,33.75,36.40,40.80,
44.24,48.01,50.85,54.85,57.51,
61.73,65.43,66.50,72.41,75.47,
77.22,78.49,79.26,80.31,81.04,
81.89,82.28,82.56,83.13,83.62,
84.11,84.47,85.02,85.31,85.61,
86.05,86.27,85.29,86.81,86.94,
87.13,87.33,87.45,87.85),
'CO2_Production_Yeast_B' = c(0,0.41,0.70,3.05,15.61,18.41,
21.37,23.23,28.28,41.28,43.98,
49.54,54.43,60.40,63.75,69.29,
76.54,78.38,80.91,83.72,84.66,
85.39,85.81,86.92,87.38,87.61,
88.38,88.57,88.72,88.82,89.22,
89.32,89.52,89.71,89.92,90.11,
90.31,90.50,90.70,90.90,91.09,
91.29,91.49,91.68,91.88))
#Using the kp() function to find the
#coefficients and kinetic parameters
#according to the adopted model.
kp(data = df,
model = 1,
startA = 0,
startB = 1.5,
startC = 500,
startD = 92,
startG = 1500,
save.xls = FALSE) #5PL Model adopted
kp(data = df,model = 2,
startA = 92,
startB = 1.5,
startC = 0,
startD = NA,
startG = NA,
save.xls = FALSE) #Gompertz Model adopted
kp(data = df,
startA = 0,
startB = 2.5,
startC = 10,
startD = 92,
startG = NA,
model = 3,
save.xls = FALSE) #4PL Model adopted
#Saving an xlsx file. In this example,
#we will use saving a temporary file in
#the temporary file directories.