Learn R Programming

⚠️There's a newer version (1.0.6) 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

539

Version

0.2.0

License

GPL-3

Maintainer

Alberto Garre

Last Published

January 27th, 2021

Functions in biogrowth (0.2.0)

FitDynamicGrowthMCMC

FitDynamicGrowthMCMC class
FitDynamicGrowth

FitDynamicGrowth class
MCMCgrowth

MCMCgrowth class
CPM_model

Secondary Cardinal Parameter (CPM) model
IsothermalGrowth

IsothermalGrowth class
FitMultipleGrowthMCMC

FitMultipleGrowthMCMC class
FitSecondaryGrowth

FitSecondaryGrowth class
FitIsoGrowth

FitIsoGrowth class
DynamicGrowth

DynamicGrowth class
FitMultipleDynamicGrowth

FitMultipleDynamicGrowth class
arabian_tractors

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

Model definition checks for predict_stochastic_growth
example_dynamic_growth

Microbial growth under dynamic conditions
check_secondary_pars

Basic checks of secondary parameters
is.StochasticGrowth

Test of StochasticGrowth object
example_cardinal

Growth rates obtained for several growth experiments
get_dyna_residuals

Residuals of dynamic prediction
extract_secondary_pars

A helper to build the secondary models
fit_MCMC_growth

Fit growth models using MCMC
get_iso_residuals

Residuals of isothermal prediction
calculate_gammas_secondary

Gamma factors for fitting secondary models
fit_secondary_growth

Fit secondary growth models
calculate_gammas

Calculates every gamma factor
fit_dynamic_growth

Fit dynamic growth models
check_primary_pars

Basic check of parameters for primary models
full_Ratkowski

Full Ratkowsky model
trilinear_model

Trilinear growth model
is.FitDynamicGrowthMCMC

Test of FitDynamicGrowthMCMC object
multiple_experiments

A set of growth experiments under dynamic conditions
is.FitDynamicGrowth

Test of FitDynamicGrowth object
logistic_model

Logistic growth model
iso_Baranyi

Isothermal Baranyi model
predict_dynamic_growth

Growth under dynamic conditions
predict_MCMC_growth

Stochastic growth of MCMC fit
TimeDistribution

TimeDistribution class
Q0_to_lambda

Lag phase duration from Q0
is.FitSecondaryGrowth

Test of FitSecondaryGrowth object
is.FitMultipleDynamicGrowthMCMC

Test of FitMultipleDynamicGrowthMCMC object
fit_isothermal_growth

Fit primary growth models
zwietering_gamma

Zwietering gamma model
get_multi_dyna_residuals

Residuals of multiple dynamic predictions
StochasticGrowth

StochasticGrowth class
dBaranyi

Baranyi growth model
distribution_to_logcount

Distribution of times to reach a certain microbial count
get_secondary_residuals

Residuals of secondary models
predict_isothermal_growth

Isothermal microbial growth
growth_salmonella

Growth of Salmonella spp in broth
predict_stochastic_growth

Isothermal growth with variability
is.DynamicGrowth

Test of DynamicGrowth object
is.IsothermalGrowth

Test of IsothermalGrowth object
iso_repGompertz

Reparameterized Gompertz model
lambda_to_Q0

Q0 from lag phase duration
is.MCMCgrowth

Test of MCMCgrowth object
secondary_model_data

Metainformation of secondary growth models
approx_env

Generates functions for linear interpolation of environmental conditions
example_env_conditions

Environmental conditions during a dynamic experiment
time_to_logcount

Time to reach a given microbial count
extract_primary_pars

A helper to build the primary models
fit_multiple_growth_MCMC

Fitting growth models to multiple dynamic experiments using MCMC
fit_multiple_growth

Fitting growth models to multiple dynamic experiments
is.FitIsoGrowth

Test of FitIsoGrowth object
is.FitMultipleDynamicGrowth

Test of FitMultipleDynamicGrowth object
primary_model_data

Metainformation of primary growth models
richards_model

Richards growth model