addSubs | R Documentation |
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 signature '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
)
object |
An object of class Arena. |
smax |
A numeric vector indicating the maximum substance concentration per grid cell. |
mediac |
A character vector giving the names of substances, which should be added to the environment (the default takes all possible substances). |
difunc |
A character vector ("pde","cpp" or "r") describing the function for diffusion. |
pde |
Choose diffusion transport reaction to be used (default is diffusion only) |
difspeed |
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 ) |
unit |
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) |
add |
A boolean variable defining whether the amount of substance should be summed or replaced |
diffmat |
A matrix with spatial distributed initial concentrations (if not set, a homogenous matrix using smax is created) |
template |
True if diffmat matrix should be used as tempalte only (will be multiplied with smax to obtain cocentrations) |
Dgrid |
A matrix indicating the diffusion speed in x and y direction (given by cm^2/h). |
Vgrid |
A number indicating the advection speed in x direction (given by cm/h). |
addAnyway |
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
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.