Title: Simulation: Software Methods and Biological Processes
1SimulationSoftware Methods and Biological
Processes
- Marco AntoniottiNYU Courant Bioinformatics Group
2Outline
- Simulation fundamentals
- Modeling
- Modeling Tools
- Mathematical Tools (Differential Equations, Timed
Systems) - Languages
- Software infrastructure and implementations
- Models of computations
- Numerics
3Outline (continued)
- Tools
- General
- Matlab, Mathematica, Maple, Macsyma
- Specialized
- Discrete Event with Extensions
- Hybrid System Simulators
- Biological Simulations
- E-CELL, VirtualCell
4Modeling
- There are several frameworks that can be used for
modeling - Differential Equations (continuous)
- Discrete Systems
- Finite State Automata
- Petri Nets
- Dataflow Diagrams
5Time
- The main issue behind all of these modeling
frameworks is Time - Consequences
- What constitues progress
- How do we implement simulators for systems that
assume a different notion of time'
6Differential Equations
- Ordinary Differential Equations (ODE's) are a
standard tool used to model physical, biological
and engineering systems y'(t) F(y(t),
t) y(0) k - Time t is continuous'
7Discrete Models
- Finite State Machines
- Petri Nets
- Discrete Event Systems
- A queue of events' generated by some sources'
and processed by components' - Time is a usually a derived notion (e.g. by
observing the sequence of events or a Wall Clock)
8ODE Repressilator System
- The repressilator system (Elowizt, Leibler 2000)
comprises three proteins, LacI, CI, and TetR
controlling each other.
TetR
CI
LacI
9ODE Repressilator System
- The repressilator system (Elowizt, Leibler 2000)
is simply described as an ODE system
(deterministic version)(i,j) (lacI,cI) or
(tetR,lacI) or (cI,tetR)
10Stem Cell Population Model
- There are different kinds of (Adult) Stem Cells
- Hematopoietic, Neuronal, Muscle, Epithelial
- A Stem Cell differentiates into Committed
Progenitor Cells, which in turn differentiate
into Regular Cells (T-cells, Red Blood Cells,
Skin Cells)
11Stem Cell Differentiation and Proliferation
- Stem Cell Division/Proliferation
- Asymmetric
- Symmetric
- Environmentally Asymmetric
12Stem Cell FSA
Asymmetric Division
Ns n. of Stem Cells Np n. of Progenitor Cells
Np Np 1
Ns Ns -1
Symmetric Division 2S
die
quiescent
Ns Ns 1
Np Np 2 Ns Ns -1
SymmetricDivision 2P
13Stem Cells Population ODE Model
14Simulation Traces
- Running a simulation (numerically solving a set
of differential equations) produces a trace - A trace is a sequence of vectors of values,
possibly symbolic - E.g. for the FSA Stem Cell Model we havelt(100,
1e5), (101, 1e5), ... (98, 1e5)gt
15Discrete Event Systems
- The notion of trace gives rise to a more low
level notion of system. - Discrete Event Simulators are defined in terms of
the underlying timed traces and of their
generators
16Simulator Template Architecture
System Specification
Simulation Results (Traces)
Trace Inspection Synchronous GUI Plotter Math
Analysis
Simulation Engine
17Implementing a Simulator
- The engine of a simulator is essentially a
loop loop for i from start to finish do
(evaluate next(i)) - The nature of (evaluate next(i)) determines the
type of simulator we are using
18Simulator Runtime
- The simulator runtime can be
- stopped
- when stopped, one or more individual components
can be instantiated (or retrieved) and activated - restarted
- when restarted, the simulation will proceed with
the individual components behaving as if part of
the overall simulation (this may be considered as
a lens effect)
19Implementing a Discrete Event Simulator
- SpecificationSources, Computing Units and Sinks
- Sources square wave generators
- Units down samplers, logical operation
- Engine
- A queue of pairs lttime, valuegt
- Evaluators for the units
- Each unit can sense if it has inputs
20Implementing a FSA Simulator
- Specification
- A set of Finite Automata
- Two possibilities
- Construct a product automata and then simulate
- Keep Automata separate and make simulation
slightly more complex - Engine
- check the set of all enabled transitions from the
current state and produce the next state
21Implementing an ODE Simulator/Solver
- Specification
- A set of ODE's
- Engine
- Evaluate at discrete time steps the value of the
function and of its derivative - Several different methods are available
- Euler
- Runke-Kutta
22Implementing an ODE Simulator/Solver (contd)
- Euler Method (unrecommended)
- Runge-Kutta 4
23Implementing an ODE Simulator (contd.)
- Complete formulation of midpoint computations in
Runge-Kutta 4
24Stem Cell Population Octave (Matlab) Code
- The ODE formulation isfunction dn f(N,
t) alphap 0.01 alphas 0.01 beta 5
gamma 0.2 theta 0.2 kappa 0.5 Ks
1000 Kp 10000 dn(1) (beta (Ks -
N(1))/Ks - theta (Kp - N(2))/Kp - alphas)
N(1) dn(2) (Kp - N(2))/Kp ((gamma 2
theta) N(1) kappa N(2))
- alphap N(2)endfunctionN0
50 1000 t linspace(0, 15, 100)'N
lsode("f", N0, t)
25Running the code
26A Finite Automata LanguageEsterel
- Consider the following example
?B
?A
?R
?R
?A?B!O
?R
?B!O
?A!O
27Esterel Rendition
- The previous automata is rendered as module
ABRO input A, B output O loop await A
await B emit O each R end - Each transition happens at each tick
28Putting it all together
- How do we reconcile a high level modeling view
with a low level continuous time based
simulation? - Hybrid Systems are one of the latest developments
mixing Finite State Automata and Continuous
Systems
29Hybrid Systems
- A Hybrid System is a computational tool that
switches among different sets of ODE's accoding
to a some conditions
k1 gt k2
y gt k1
dy/dt 3
dy/dt -1.5
y lt k2
30A Hybrid System Implementation
- The main loop of a Hybrid System simulation
engine becomeslet h ltsome valuegtloop for i
from start to finish do evaluate the current set
of ODE's for one step h if (any transition
becomes enabled) do switch ODE set
31Stem Cells PopulationHybrid System Formulation
- The Stem Cell ODE formulation is a deterministic
and continuous approximation of the real (?!?)
model - An Hybrid System formulation can be made closer
to the discrete and stochastic counting nature of
the model
32Stem Cells PopulationHybrid System (contd)
- We model the Stem Cell Population as a Hybrid
System with only one differential (continuous)
variable time (time) - Our system will therefore integrate d time / dt
1
33Stem Cells PopulationHybrid System (contd)
- We associate to each transition an exponential
decay rate - The exponential decay rate represents the rate'
of an event in the population model (asymmetric
division, apoptosis)
quiescent
Ns Ns -1
d(time)/dt 1r(die) random()
die
- ln(r(die)) lt alpha Ns time
34Stem Cells PopulationHybrid System (contd)
- One language that can be used to this end is
l-Shift (Simsek 2000, UC Berkeley)(defhybrid
SC-behavior () ... (discrete
('quiescent flow ((d/dt time)
(random 1.0)))) (transitions ('quiescent 'die
when (lt (- (log r) ( alpha n_s time)))
do ((time 0)
(n_s
(decf n_s)))) ))
35Problems with HS
- There are several Numerical problems
- Guard Crossings
36Conclusions
- Simulations are a good tool for Modeling several
systems, hence Biological Systems as well - We saw different kinds of simulation paradigms
- continous
- discrete
- hybrid
37Conclusions (2)
- A simulation tool must be fitted to the problem
at hand - Proper modeling is always a prerequisite to
produce data that can be analyzed by matching it
with laboratory experimental results
38The ModelCell Differentiation
- Cell Differention (e.g. multipotent HSCs,
Metcalfe et al. 1997)
M
V
G2
G1
R
C
S
G0
Apoptosis
39The ModelCell Differentiation
- Cell Differention (e.g. multipotent HSCs,
Metcalfe et al. 1997)
Macrophages
GM-Progenitors
Granulocytes