Skip to content

Instantly share code, notes, and snippets.

Avatar

jo jotech

View GitHub Profile
@jotech
jotech / 0_matlab_example.R
Last active May 22, 2019
import matlab models
View 0_matlab_example.R
library("BacArena")
library("R.matlab")
mod <- readMATmod("Actinobacillus_pleuropneumoniae_L20.mat")
arena <- Arena(n=10,m=10)
arena <- addOrg(arena, Bac(mod), 10)
arena <- addDefaultMed(arena, Bac(mod))
sim <- simEnv(arena, time=5)
@jotech
jotech / delayed-o2.R
Last active Apr 10, 2019
Adding oxygen after some time
View delayed-o2.R
library(BacArena)
data("Ec_core")
bac <- Bac(Ec_core)
arena <- Arena(n=20, m=20)
arena <- addOrg(arena,bac,amount=30)
arena <- addSubs(arena, smax=0.05, mediac="EX_glc(e)", unit="mM")
arena <- addSubs(arena, smax=1, mediac=c("EX_pi(e)", "EX_h2o(e)", "EX_nh4(e)"), unit="mM")
# Aenaerobic simulation for 6h
@jotech
jotech / no-space.R
Last active Apr 10, 2019
bacarena_no-space
View no-space.R
library(BacArena)
data("Ec_core")
arena <- Arena(n=10,m=10)
# by setting maxweight to infinity, duplication is disabled
# speed=0 indicates no movement
# limit_growth=FALSE removes the limit of biomass increase
bac <- Bac(Ec_core, speed=0, limit_growth=FALSE, maxweight=Inf)
@jotech
jotech / 0-crossfeeding.R
Last active Apr 18, 2019
Analyzing bacterial interaction and cross-feeding patterns with BacArena
View 0-crossfeeding.R
#
# The sihumi example data set consists of a simulation of 8 gut microbes growing on a western diet for 8 hours.
# Here, we use it to study microbial interactions
#
library(BacArena)
data("sihumi_test")
@jotech
jotech / flux_distribution.R
Last active Feb 1, 2019
Working with flux distribution
View flux_distribution.R
#
# In BacArena the activity of each reaction of an organism (flux distribution) is stored in arena@mflux.
# After finishing a simulation, the time series of the reaction activities can be accessed via eval@simlist.
#
library(BacArena)
data("Ec_core")
bac <- Bac(Ec_core)
arena <- Arena(n=20, m=20)
arena <- addOrg(arena,bac,amount=20)
@jotech
jotech / bacarena-ecoli.R
Last active Oct 25, 2018
How to get started in BacArena
View bacarena-ecoli.R
#
# Doing a simple simulation using the E. coli model (iJO1366)
#
library(BacArena)
data(bcoli_orth)
bac <- Bac(ecoli)
arena <- Arena()
You can’t perform that action at this time.