knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(Eutropia)
The intestinal bacterium Eubacterium rectale is known to be able to use acetate as energy source under anaerobic conditions and forms butyrate as end product (Rivère et al. (2015) Appl Envrion Microbiol). Acetate is a common fermentation end product in a number of different other intestinal bacteria, including Bifidobacteria (e.g. Bifidobacterium longum). In this tutorial, a co-culture experiment of both species is simulated in an aerobic environment that contains glucose as sole source of carbon and energy. It will be tested if acetate cross-feeding occurs and how the organisms affect each others population growth.
As growth environment, a Petri dish-shaped growth area will be defined with a radius of 80 micro meters. The space for metabolite concentrations is rasterized by rhombic dodecahedrons of size 1 µm (distance between adjacent field centers). The chemical growth environment consists of 6 field layers in height (i.e. the z-dimension).
# create simulation environment sim <- init_simulation("Petri_80", gridFieldSize = 1, gridFieldLayers = 6)
Next, we will read the models for both organisms and place 15 cells each in the growth environment.
# add organisms (15 cells of each as 'starter culture') models <- list() models[['eure']] <- readRDS(system.file("extdata", "eure.RDS", package="Eutropia")) models[['bilo']] <- readRDS(system.file("extdata", "bilo.RDS", package="Eutropia")) sim <- add_organism(sim, model = models[['eure']], name = "E. rectale", ncells = 15, distribution.radius = 25, open.bounds = 1) sim <- add_organism(sim, model = models[['bilo']], name = "B. longum", ncells = 15, distribution.radius = 25, open.bounds = 1)
It is not required, but out of curiosity the initial spatial distribution of cells can be plotted.
plot_cells(sim, scalebar.color = "black")
Now we have a simulation object with cells. Next we will add nutrients to the growth medium.
# Load a medium table dt_medium <- fread(system.file("extdata", "medium.csv", package="Eutropia")) # adding compounds sim <- add_compounds(sim, compounds = dt_medium$cpd.id, concentrations = dt_medium$mM, compound.names = dt_medium$cpd.name, is.constant = dt_medium$is.constant)
We are all set to run our first simulation. It will run either to a maximum of 50 iterations (= 500 minutes simulated time, option niter
) or in maximum 4 minutes and 30 seconds (option lim_time
). In the latter case, the last iteration is allowed to finish even if the time limit is exceeded.
sim <- run_simulation(sim, niter = 50, verbose = 1, lim_time = 4.5)
The package comes with a number of functions to plot simulation results.
# Plot spatial distribution of cells plot_cells(sim, scalebar.color = "black")
# Spatial distribution of glucose plot_environment(sim, compounds = c("cpd00027_e0"), scalebar.color = "black")
# Spatial distribution of acetate, lactate and butyrate plot_environment(sim, compounds = c("cpd00029_e0","cpd00211_e0","cpd00159_e0"), scalebar.color = "black")
# growth curves (total cell mass by species) plot_growth(sim)
# dynamics in metabolite concentrations (calculated by total environment volume) plot_compounds(sim, compounds = c("cpd00029_e0","cpd00211_e0","cpd00159_e0"))
The consumed and produced metabolites (i.e. exchanges) can be retrieved for the simulation.
summary_exchanges(sim)
In addition, the same information can be retrieved for earlier iterations in the simulation.
summary_exchanges(sim, iter = 10)
The results should clearly show that acetate is produced by B. longum and consumed by E. rectale.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.