Skip to content

Commit

Permalink
bacarena 1.8 cran release
Browse files Browse the repository at this point in the history
  • Loading branch information
jotech committed Feb 15, 2019
1 parent 5082cc6 commit 5f1606c
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: BacArena
Title: Modeling Framework for Cellular Communities in their Environments
Version: 1.7
Version: 1.8
Authors@R: c( person("Eugen", "Bauer", , "[email protected]", role = c("aut")),
person("Johannes", "Zimmermann", , "[email protected]", role = c("aut", "cre")))
Author: Eugen Bauer [aut],
Expand Down Expand Up @@ -37,7 +37,7 @@ Suggests:
LinkingTo: Rcpp,
RcppArmadillo,
RcppEigen
License: GPL-3
License: GPL-3 | file LICENSE
VignetteBuilder: knitr
RoxygenNote: 6.1.0
LazyData: true
11 changes: 11 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
BacArena v.1.8 (Release data: 2019-02-15)
Changes:
- improved detection of limiting substances (shadow costs)
- shadow costs analysis now possible with cplex, too
- support for non-default objective functions
- fixed interaction finding in findfeeding3()
- occupied arena cells valid also for human cells (bug in emptyHood)

* github reference: https://github.com/euba/BacArena/releases/tag/v1.8


BacArena v.1.7 (Release date: 2018-05-09)
==============
Changes:
Expand Down
2 changes: 1 addition & 1 deletion R/Arena.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ setMethod("addOrg", "Arena", function(object, specI, amount=1, x=NULL, y=NULL, p
neworgdat[(lastind+1):(amount+lastind),'type']=rep(type, amount)
neworgdat[(lastind+1):(amount+lastind),'phenotype']=rep(NA, amount)
}else{
if(x<1 || x>n || y<1 || y>m){stop("The positions of the individuals are beyond the dimensions of the environment.")}
if( any(x<1) || any(x>n) || any(y<1) || any(y>m) ){stop("The positions of the individuals are beyond the dimensions of the environment.")}
neworgdat[(lastind+1):(amount+lastind),'x']=x
neworgdat[(lastind+1):(amount+lastind),'y']=y
if(is.numeric(biomass)) neworgdat[(lastind+1):(amount+lastind),'biomass'] = rep(biomass, amount)
Expand Down
2 changes: 1 addition & 1 deletion R/BacArena.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ NULL


.onAttach <- function(libname, pkgname) {
packageStartupMessage("BacArena paper: https://doi.org/10.1371/journal.pcbi.1005544\n Tutorial: https://CRAN.R-project.org/package=BacArena/vignettes/BacArena-Introduction.pdf\n Development and help: https://github.com/euba/bacarena")
packageStartupMessage("BacArena paper: https://doi.org/10.1371/journal.pcbi.1005544\n Tutorials: https://bacarena.github.io\n Model import from SBML: https://github.com/euba/BacArena/wiki/Model-import\n Development and help: https://github.com/euba/bacarena")
}
2 changes: 1 addition & 1 deletion R/Organism.R
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ setMethod("growth_par", "Bac", function(object, population, j, fbasol, tstep){
#' @param population An object of class Arena.
#' @param j The number of the iteration of interest.
#' @param chemo The vector that contains the prefered substrate.

#' @param occupyM A matrix indicating grid cells that are obstacles
#' @details Bacteria move to a position in the Moore neighbourhood which has the highest concentration of the prefered substrate, which is not occupied by other individuals. The prefered substance is given by slot \code{chem} in the \code{Bac} object. If there is no free space the individuals stays in the same position. If the concentration in the Moore neighbourhood has the same concentration in every position, then random movement is implemented.
#' @seealso \code{\link{Bac-class}} and \code{\link{emptyHood}}
#' @examples
Expand Down
2 changes: 1 addition & 1 deletion examples/dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ devtools::document()

devtools::check() # includes document()

install_local(path="~/uni/bacarena", quick=TRUE, threads=2, quiet=F)
install_local(path="~/uni/bacarena", quick=TRUE, threads=2, quiet=F, force=T)
#install_github(repo="euba/bacarena", quick=TRUE)


Expand Down
9 changes: 7 additions & 2 deletions examples/ecoli.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
library(BacArena)
data("Ec_core")

SYBIL_SETTINGS("SOLVER", "cplexAPI")
#SYBIL_SETTINGS("SOLVER", "glpkAPI")

bac <- Bac(Ec_core)
arena <- Arena(n=20, m=20)
arena <- addOrg(arena,bac,amount=20)
arena <- addSubs(arena, smax=0.005, mediac="EX_glc(e)", unit="mM")
arena <- addSubs(arena, smax=1, mediac=c("EX_pi(e)", "EX_h2o(e)",
"EX_o2(e)", "EX_nh4(e)"), unit="mM")
sim <- simEnv(arena, time=5, with_shadow = T, sec_obj = T)
sim <- simEnv(arena, time=5, with_shadow = T, sec_obj = F)

getSubHist(sim, "EX_glc(e)")

sim@shadowlist[[3]]
plotShadowCost(sim, 1)[[2]]
plotShadowCost(sim, 1)[[2]] # fru, glc -2

plotGrowthCurve(sim.old)
4 changes: 3 additions & 1 deletion examples/sihumi_test.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
library(BacArena)
SYBIL_SETTINGS("SOLVER", "cplexAPI")

#sihumi <- readRDS("~/uni/dat/mod/r/sihumi.RDS")
#latest_agora <- readRDS("~/uni/dat/mod/r/agora1.01.western.SWcorr.RDS")
Expand All @@ -16,7 +17,8 @@ for(i in seq_along(sihumi)){
}
sihumi_test <- simEnv(arena, time=7, sec_obj = "mtf", with_shadow = T)

save(sihumi_test, file = "~/uni/bacarena/data/sihumi_test.rda")
#save(sihumi_test, file = "~/uni/bacarena/data/sihumi_test.rda")
#load("~/uni/bacarena/data/sihumi_test.rda")

plotGrowthCurve(sihumi_test)[[1]]
plotSpecActivity(sihumi_test)[[2]]
Expand Down
2 changes: 2 additions & 0 deletions man/chemotaxis.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/findrBiomass.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/plotGrowthCurve.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/plotSpecActivity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5f1606c

Please sign in to comment.