Learn R Programming

⚠️There's a newer version (1.0.8) of this package.Take me there.

biogrowth

The goal of biogrowth is to ease the development of mathematical models to describe population growth. It includes functions for:

  • making predictions under static environmental conditions.
  • making predictions under dynamic environmental conditions.
  • making predictions under static or dynamic conditions considering parameter uncertainty.
  • fitting models to data gathered under static environmental conditions.
  • fitting models to data gathered under dynamic environmental conditions.

The fuctions in biogrowth follow the methods of predictive microbiology, where the modelling process is divided two steps: primary and secondary modelling. The user has the flexibility to choose between several primary (Baranyi, modified Gompertz and Trilinear) and secondary models (cardinal parameter model, Zwietering-type model, full Ratkowsky model).

Authors

The biogrowth package has been developed by researchers of the Food Microbiology Laboratory of Wageningen University and Research.

  • Alberto Garre,
  • Jeroen Koomen,
  • Heidy den Besten,
  • Marcel Zwietering.

Questions and comments can be directed to Alberto Garre (alberto.garreperez (at) wur.nl). For bug reports, please use the GitHub page of the project.

Installation

You can install the released version of biogrowth from CRAN with:

install.packages("biogrowth")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("albgarre/biogrowth")

Example

As an example of the features included in the package, the following code chunk generates a prediction of microbial growth under dynamic conditions considering parameter uncertainty.

library(tidyverse)
#> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
#> ✓ ggplot2 3.3.2     ✓ purrr   0.3.4
#> ✓ tibble  3.0.4     ✓ dplyr   1.0.2
#> ✓ tidyr   1.1.2     ✓ stringr 1.4.0
#> ✓ readr   1.4.0     ✓ forcats 0.5.0
#> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
#> x dplyr::filter() masks stats::filter()
#> x dplyr::lag()    masks stats::lag()
library(biogrowth)
set.seed(1241)

my_model <- "Baranyi"
my_times <- seq(0, 30, length = 100)
n_sims <- 3000

pars <- tribble(
    ~par, ~mean, ~sd, ~scale,
    "logN0", 0, .2, "original",
    "mu", 2, .3, "sqrt",
    "lambda", 4, .4, "sqrt",
    "logNmax", 6, .5, "original"
)

stoc_growth <- predict_stochastic_growth(my_model, my_times, n_sims, pars)

plot(stoc_growth)

As an additional example, the following code chunk fits a model to a set of experiments under dynamic conditions.


## We will use the multiple_experiments data set

data("multiple_experiments")

## For each environmental factor, we need to defined a model

sec_names <- c(temperature = "CPM", pH = "CPM")

## Any model parameter can be fixed

known <- list(Nmax = 1e8, N0 = 1e0, Q0 = 1e-3,
    temperature_n = 2, temperature_xmin = 20, temperature_xmax = 35,
    pH_n = 2, pH_xmin = 5.5, pH_xmax = 7.5, pH_xopt = 6.5)

## The rest require starting values for model fitting

start <- list(mu_opt = .8, temperature_xopt = 30)

## We can now call the fitting function

global_fit <- fit_multiple_growth(start, multiple_experiments, known, sec_names)

## Any single environmental factor can be added to the plot using add_factor

plot(global_fit, add_factor = "temperature")

This is only a small sample of the functions included in the package. For a complete list, please check the package vignette.

Copy Link

Version

Install

install.packages('biogrowth')

Monthly Downloads

623

Version

0.2.3

License

GPL-3

Maintainer

Alberto Garre

Last Published

August 23rd, 2021

Functions in biogrowth (0.2.3)

Q0_to_lambda

Lag phase duration from Q0
calculate_gammas_secondary

Gamma factors for fitting secondary models
check_primary_pars

Basic check of parameters for primary models
example_dynamic_growth

Microbial growth under dynamic conditions
FitMultipleDynamicGrowth

FitMultipleDynamicGrowth class
example_env_conditions

Environmental conditions during a dynamic experiment
get_iso_residuals

Residuals of isothermal prediction
StochasticGrowth

StochasticGrowth class
dBaranyi

Baranyi growth model
conditions_pH_temperature

Conditions during a dynamic growth experiment
get_secondary_residuals

Residuals of secondary models
check_secondary_pars

Basic checks of secondary parameters
distribution_to_logcount

Distribution of times to reach a certain microbial count
growth_pH_temperature

Example of dynamic growth
FitDynamicGrowthMCMC

FitDynamicGrowthMCMC class
get_multi_dyna_residuals

Residuals of multiple dynamic predictions
is.FitMultipleDynamicGrowthMCMC

Test of FitMultipleDynamicGrowthMCMC object
is.FitSecondaryGrowth

Test of FitSecondaryGrowth object
FitMultipleGrowthMCMC

FitMultipleGrowthMCMC class
predict_isothermal_growth

Isothermal microbial growth
iso_repGompertz

Reparameterized Gompertz model
predict_stochastic_growth

Isothermal growth with variability
is.DynamicGrowth

Test of DynamicGrowth object
primary_model_data

Metainformation of primary growth models
fit_multiple_growth

Fitting growth models to multiple dynamic experiments
CPM_model

Secondary Cardinal Parameter (CPM) model
TimeDistribution

TimeDistribution class
fit_isothermal_growth

Fit primary growth models
DynamicGrowth

DynamicGrowth class
is.IsothermalGrowth

Test of IsothermalGrowth object
approx_env

Generates functions for linear interpolation of environmental conditions
growth_salmonella

Growth of Salmonella spp in broth
richards_model

Richards growth model
is.FitDynamicGrowthMCMC

Test of FitDynamicGrowthMCMC object
is.FitDynamicGrowth

Test of FitDynamicGrowth object
FitDynamicGrowth

FitDynamicGrowth class
is.FitIsoGrowth

Test of FitIsoGrowth object
FitSecondaryGrowth

FitSecondaryGrowth class
check_stochastic_pars

Model definition checks for predict_stochastic_growth
example_cardinal

Growth rates obtained for several growth experiments
full_Ratkowski

Full Ratkowsky model
MCMCgrowth

MCMCgrowth class
fit_MCMC_growth

Fit growth models using MCMC
lambda_to_Q0

Q0 from lag phase duration
fit_dynamic_growth

Fit dynamic growth models
multiple_experiments

A set of growth experiments under dynamic conditions
logistic_model

Logistic growth model
get_dyna_residuals

Residuals of dynamic prediction
predict_MCMC_growth

Stochastic growth of MCMC fit
is.MCMCgrowth

Test of MCMCgrowth object
predict_dynamic_growth

Growth under dynamic conditions
arabian_tractors

Number of tractors in the Arab World according to the World Bank
extract_primary_pars

A helper to build the primary models
time_to_logcount

Time to reach a given microbial count
is.FitMultipleDynamicGrowth

Test of FitMultipleDynamicGrowth object
secondary_model_data

Metainformation of secondary growth models
IsothermalGrowth

IsothermalGrowth class
iso_Baranyi

Isothermal Baranyi model
fit_multiple_growth_MCMC

Fitting growth models to multiple dynamic experiments using MCMC
calculate_gammas

Calculates every gamma factor
is.StochasticGrowth

Test of StochasticGrowth object
trilinear_model

Trilinear growth model
fit_secondary_growth

Fit secondary growth models
extract_secondary_pars

A helper to build the secondary models
zwietering_gamma

Zwietering gamma model
FitIsoGrowth

FitIsoGrowth class