
Last chance! 50% off unlimited learning
Sale ends in
The generic function addSubs
adds specific substances to the environment.
addSubs(
object,
smax = 0,
mediac = object@mediac,
difunc = "pde",
pde = "Diff2d",
difspeed = 0.02412,
unit = "mmol/cell",
add = TRUE,
diffmat = NULL,
template = FALSE,
Dgrid = NULL,
Vgrid = NULL,
addAnyway = FALSE
)# S4 method for Arena
addSubs(
object,
smax = 0,
mediac = object@mediac,
difunc = "pde",
pde = "Diff2d",
difspeed = 0.02412,
unit = "mmol/cell",
add = TRUE,
diffmat = NULL,
template = FALSE,
Dgrid = NULL,
Vgrid = NULL,
addAnyway = FALSE
)
An object of class Arena.
A numeric vector indicating the maximum substance concentration per grid cell.
A character vector giving the names of substances, which should be added to the environment (the default takes all possible substances).
A character vector ("pde","cpp" or "r") describing the function for diffusion.
Choose diffusion transport reaction to be used (default is diffusion only)
A number indicating the diffusion rate (given by cm^2/h). Default is set to glucose diffusion in a aqueous solution (6.7e-6 cm^2/s * 3600 s/h = 0.02412 cm^2/h )
A character used as chemical unit to set the amount of the substances to be added (valid values are: mmol/cell, mmol/cm2, mmol/arena, mM)
A boolean variable defining whether the amount of substance should be summed or replaced
A matrix with spatial distributed initial concentrations (if not set, a homogenous matrix using smax is created)
True if diffmat matrix should be used as tempalte only (will be multiplied with smax to obtain cocentrations)
A matrix indicating the diffusion speed in x and y direction (given by cm^2/h).
A number indicating the advection speed in x direction (given by cm/h).
If true substance will be added even if there is no connection (i.e. exchanges) with organisms
If nothing but object
is given, then all possible substrates are initilized with a concentration of 0. Afterwards, changeSub can be used to modify the concentrations of specific substances.
Arena-class
and changeSub
# NOT RUN {
data(Ec_core, envir = environment()) #get Escherichia coli core metabolic model
bac <- Bac(Ec_core,deathrate=0.05,
minweight=0.05,growtype="exponential") #initialize a bacterium
arena <- Arena(n=20,m=20) #initialize the environment
arena <- addOrg(arena,bac,amount=10) #add 10 organisms
arena <- addSubs(arena,20,c("EX_glc(e)","EX_o2(e)","EX_pi(e)")) #add glucose, o2, pi
# }
Run the code above in your browser using DataLab