addSubs: Add substances to the environment

Description Usage Arguments Details See Also Examples

Description

The generic function addSubs adds specific substances to the environment.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
)

Arguments

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

Details

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.

See Also

Arena-class and changeSub

Examples

1
2
3
4
5
6
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

Example output

Loading required package: sybil
Loading required package: Matrix
Loading required package: lattice
Loading required package: ReacTran
Loading required package: rootSolve
Loading required package: deSolve
Loading required package: shape
BacArena paper: https://doi.org/10.1371/journal.pcbi.1005544
 Tutorials: https://bacarena.github.io
 Model import from SBML: https://github.com/euba/BacArena/wiki/Model-import
 Development and help: https://github.com/euba/bacarena
[1] "Median lower bound for non-zero and non-Inf exchanges is:-106"
Loading required package: glpkAPI
using GLPK version 4.65

BacArena documentation built on July 2, 2020, 3:16 a.m.