Tuesday, April 01, 2008

Stochastic Reactions and Agent-Cells

I have decided to branch back (off... can't think of the right preposition) to spatial pattern formation with agents. I had previously worked with an Agent Toolkit- RePast- Recursive Porous Agent Simulation Toolkit. At that point I had implemented a Network and Compartment class in the general agent simulator to model mass balance kinetics with an ODE (Athale et al. 2005). The original multi-agent model to model tumor expansion was work done by Yuri Mansury (Mansury et al. 2002). However the Network implementation was rather crude- Euler finite time stepping forward integration scheme. About the time I moved back to single-cell and possibly experimentally tractable, however phenomenologically less rich systems, a library of agent based simulations Agent-Cell was released (Emonet et al. 2005). Michael North, one of the co-authors on this paper, is also one of the developers of RePast. The big leap from RePast was an integration with numerical ODE solver libraries and bindings to a real stochastic reaction simulator- StochSim. The tool was used to examine bacterial chemotaxis models- for a single bacterium and allow for bacterial swimming behaviour to be simulated.

I am now trying to compile the package (2008-04-01, 20:15:00) and see if I can modify it to my purposes. My goal is to levarage my experience (and joy) in working with agent based systems and model eukaryotic cellular processes with it. Possibly the stochastic simulator might be the right tool to address issues of stochasticity and multi-stability in reaction networks while at the same time studying spatial patterns!

The initial part is done. StochSim compiles with some flags changed in the makefile for CYGWIN under win32. Here are the modifications:

######################################################
# Options to build the release version with
# cygwin on windows assuming that C:\cygwin\BIN is on
# the path.
# If you are using eclipse, make sure to append
# C:\cygwin\BIN to the PATH in
# project->Properties->C/C++ Make->Environment
######################################################
# ### Shell
SHELL = /bin/sh

# ### Copy
CP = cp

# ### Remove
RM = rm -f

# ### Java
#JAVA_HOME = /cygdrive/c/Program\ Files/Java/j2sdk1.4.2_10
#JAVA_HOME = /cygdrive/c/Program\ Files/Java/jdk1.5.0_06
JAVA_HOME = /cygdrive/c/Java/jdk1.6.0_05
# ### Compiler
CXX = g++
OPTS = -D_STD_CPP -D_UNIX -D_DYNAMIC_UPDATE
CXXFLAGS = -mno-cygwin -O3 -Wall -Wno-deprecated \
-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32
OPTS = -D_DEBUG -D_STD_CPP -D_UNIX
CXXFLAGS = -g -mno-cygwin -Wall -Wno-deprecated \
-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32



# ### Linker
LD = g++
LDFLAGS = $(CXXFLAGS) -L$(JAVA_HOME)/lib -ljvm
#LDFLAGS = $(CXXFLAGS)
STOCHSIM_EXE = stochsim.exe

# ### Library
MKLIB = g++
LIBFLAGS = $(CXXFLAGS) -Wl,--add-stdcall-alias -shared
STOCHSIM_LIB = stochsim.dll

# ### Installation
BINDIR = ../bin/
LIBDIR = ../lib/


=============================================================

The agent-cell compile still doesn't work! But maybe the answer lies in the post from the AgentCell website for Win32 instructions:

Hi Iqbal,

AgentCell is written in Java so it will work on any platform. However it
includes StochSim that is written in C++ and therefore must be
compiled for the platform you are using.
I have never used AgentCell on windows. The way I would go about it is
as follows:
1) Install cygwin (http://www.cygwin.com/) on windows. Cygwin will
provide a "Linux" under windows. When you install cygwin make sure to
include the development tools. In particular the compilker gcc (or
g++)
(but not the java extensions to gcc: you want to use the native java
compiler from the Java SDK instead).

2) Open a cygwin prompt window and install the Linux version of Java
SDK
1.4 (http://java.sun.com/j2se/1.4.2/downloads/index.html) under Cygwin

3) Open a cygwin prompt window and install AgentCell following the
instructions we give for Linux.

Thierry

================= Maybe there be hope? ===============
We shall see.

I already have the latest java compiler from Sun, but its a Win32 install- therefore it understands only win32 native paths eg: C:\Java\etc. However Cygwin is Unix based and understands UNIX paths eg: C:/Java/etc. Further complicating the matter is a call from under Cygwin to the Windows javac.

The solution appears to be to use

cygpath -u for UNIX
cygpath -w for WIN

and to criss-cross as necessary. Lets see if this works.

The javacompile file is fairly mutilated by now!









References


  1. Athale C, Mansury Y, Deisboeck TS. (2005) Simulating the impact of a molecular 'decision-process' on cellular phenotype and multicellular patterns in brain tumors. J Theor Biol. 2005 Apr 21;233(4):469-81. Erratum in: J Theor Biol. 2006 Apr 21;239(4):516-7.


  2. Mansury Y, Kimura M, Lobo J, Deisboeck TS. (2002) Emerging patterns in tumor systems: simulating the dynamics of multicellular clusters with an agent-based spatial agglomeration model. J Theor Biol. 2002 Dec 7;219(3):343-70.


  3. Thierry Emonet 1,*, Charles M. Macal 2, Michael J. North 2, Charles E. Wickersham 1 and Philippe Cluzel (2005) "AgentCell: a digital single-cell assay for bacterial chemotaxis", Bioinformatics 21(11), 2714-2721 (online)



No comments: