Skip to contents

The function can be used to add substances to the growth environment by providing concentrations in mM.

Usage

add_compounds(
  object,
  compounds,
  concentrations,
  compound.names = NULL,
  is.constant = NULL,
  compound.D = NULL
)

Arguments

object

S4-object of type growthSimulation.

compounds

Character vector with the compound IDs of substances to add to the environment. Compound IDs should correspond to the models' exchange reactions IDs ("EX_[cpdid]"), without the "EX_" prefix.

concentrations

Numeric vector with the concentrations of the compounds from `compounds` in the same order. Values in mM.

compound.names

Character vector with the compound names.

is.constant

Logical vector that indicates if the compound should remain constant over time despite of potential uptake or production by cells.

compound.D

Numeric vector with the compounds' diffusion coefficients in \(\mu\)m^2/s. Default: 75

Value

Return a S4-object of type growthSimulation.

Details

Compound concentration are equally distributed across the whole growth environment. If the compound is already present, old and new concentrations are added. More options are planned.

If no compound names are provided, the current names are kept (if compound is already present) or the compound ID is also used as name (in case the compound is new).

You can also define "Inf" for the compound diffusion rates in 'compound.D'. This has the effect, that the compound will be evenly distributed across the whole growth environment again at every iteration during the simulation.

Examples

sim <- init_simulation(cbind(c(-100, -100, 100, 100), c(-100, 100, 100, -100)),
                       gridFieldSize = 2, gridFieldLayers = 3)

sim <- add_compounds(sim,
                     compounds = c("cpd00027_e0","cpd00029_e0","cpd00047_e0",
                                   "cpd00159_e0","cpd00211_e0"),
                     concentrations = c(50,0,0,0,0),
                     compound.names = c("D-Glucose","Acetate","Formate",
                                        "L-Lactate","Butyrate"),
                     is.constant = rep(FALSE, 5))