Modular Mathematical Modelling of Biological Systems
-
Upload
dgianni -
Category
Technology
-
view
494 -
download
2
description
Transcript of Modular Mathematical Modelling of Biological Systems
Modular Mathematical Modelling of Biological Systems
Mandeep Gill
Introduction● DSLs can aid modellers to both develop and
simulate models● We are developing a DSL to describe biological
models that are comprised of ODEs● Core DSL can be extended to include many
features, include model reuse, validation and high-performance simulation
● We introduce the domain, our motivation, and present the current and future features of the DSL
Biological Modelling● Overall aim to model entire human body, from
genomic level upto whole organ and body level in an integrative manner
● Several major aims, including,– Increased understanding of biological processes
– Personalised medicine and treatment
– In-silico experiments into disease and drug function
● Models are painstakingly derived from multiple sets of experimental data, from multiple disciplines, even across multiple species
Biological Modelling
● Typically model from a continuous, deterministic perspective, using ODEs and PDEs
– i.e. Cell cycles, signalling pathways, cardiac electrophysiology
● Cardiac cell models typically investigate electrophysiological changes during an action potential
– these are governed by the function of ion channels within the cell
– Flow of charged ions within capacitative membrane causes changes in cellular potential
Cardiac Model Example
δV =−I stim+∑ I ion
Cm
Cardiac Modelling● Modern cardiac models can contain over 60 ODEs,
this can take a significant time to simulate– more so when considering multi-cellular, tissue and
whole-organ models
– Sensitivity analysis, and parameter fitting and estimation can require many simulation iterations
– other biological areas, e.g. cell-cycle models, can contain significantly more ODEs
● Need to simulate such models fast...
Cardiac Modelling
● Cardiac models are typically,– tested and created in Matlab,
– published as a set of equations,
– finally reimplemented in C/Fortran for speed.
– hinders understanding, alteration and reuse of models
● Such models are tailored to their implementation language, i.e. Matlab/C, preventing potential optimisations
● Several high-performance simulation environments exist - i.e. Chaste
– However requires models developed in C++
Biological DSLs● Need to create our own DSL to combine easy
model development with high performance● For cell modelling two DSLs exist, SBML and
CellML– XML-based and declarative, rather than operational
– Intended for model curation purposes, with extensive support for metadata
– Not designed for rapid model development and simulation
– Does not support features such as model validation or reuse we're interested in
Model Reuse● Models are continuously developed and improved
from,– newer experimental research and data
– previous models and simulations
● More complex, integrative models derived from the composition of existing, smaller models, e.g.
– Cardiac models derived from multiple ion channel models
– 2D and 3D tissue and whole organ models derived from finite element method and single cell models
● Require a mechanism to reuse models within DSL
Ode DSL
● DSL developed to describe mathematical (cardiac) biological models from deterministic and stochastic viewpoints
– Influenced by CellML
– With syntax similar to Python and Matlab
– Based on sound, computational foundation
– Features to support model validation and model reuse
Example : Hodgkin-Huxley Model
component calc_i_K (V, E_R) => i_K where {
val i_K = g_K * pow(n, 4) * (V - E_K)
val n = potassium_channel_n_gate(V)
val g_K = 36
val E_K = E_R - 12
}
Components similar to functions
Constant values can be set to the results of expressions
Example : Hodgkin-Huxley Model
component potassium_channel_n_gate V => n where {
val alpha_n = (-0.01 * (V + 65)) / (exp(-(V + 65) / 10) – 1)
val beta_n = 0.125 * exp((V+75) / 80)
val n, dn = ode(0.325, alpha_n*(1-n) - (beta_n*n))
}
ODE can be defined by setting the initial value and delta expression
Model Validation - Type System
● Ode is type checked statically during compilation to enforce correctness of model equations
– i.e. checks nonsensical statements,– 5 + True // error
● This ensures that a valid model may always be simulated successfully
– although makes no guarantees regarding the correctness of the results
● Type information is used to guide optimisations during implementation
Model Validation - Units System● Type system extended to support static checking of
units-of-measure● Units can be created within the model and assigned
to values– used to check that all equations are dimensionally
consistent
● Algorithm can infer the correct units and safely convert between units of the same dimension
Infers that V is of unit milliV
component membrane (i_Na : milliA, i_K : milliA) => V where {
val Cm : microF = 0.075
val V, dv = ode(-87, -i_Stim + i_Na + i_K / C_m)
}
Modules
● Cardiac models often contain similar or repeated components
● Idea encapsulated with a module system– enables sharing/reuse within and between models
– leads to repository of reusable model components
Hodgkin-Huxleymodel
SodiumChannel
PotassiumChannel
LeakageCurrent
module HHModel {
import HH.Leakage
import HH.KChannel
import HH.NaChannel
component membrane _ => V where {
// calc dV here...
} }
Parameterised Modules● Allows a module to take user-defined modules as
parameters● Increases module flexibility, useful for
– modifying parameters and separating experimentally derived parameters from model definitions
– sensitivity analysis
– modelling experimental procedures such as clamping
Hodgkin-Huxleymodel
PotassiumChannel
Alt.PotassiumChannel
Can switch between implementations so long as modules exhibit same interface,
calc_I_K :: (Float : milliV, Float : milliV) -> Float : microA/cm^2
module HHModel(KChannel) {
// as before...
} }
Current Status
● Base language is defined, including syntax and semantics
● Can develop models using all DSL features
– Just can't simulate them yet!
Define OdeLanguage
Language type and unit system
Language Module system
High-PerformanceSimulation
Stochastic Support
Complete
To do
Current Status – High Performance Sim
● Use partial evaluation and run-time code generation
● Generate model-specific simulation code
● Target multi-core CPUs and GPUs
Define OdeLanguage
Language type and unit system
Language Module system
High-PerformanceSimulation
Stochastic Support
Complete
To do
Current Status – Stochastic Modelling● Biological systems inherently
stochastic● In certain cases we should
model stochastically– e.g. Effects of drugs
– model continuously using SDEs
– model discretely using Markov-chains and the Stochastic Simulation Algorithm (SSA)
● Increases CPU requirements
Define OdeLanguage
Language type and unit system
Language Module system
High-PerformanceSimulation
Stochastic Support
Complete
To do
Summary
● Cardiac modelling is computationally expensive and can be hard to program efficiently
● DSLs allow concise expression of models and may enable higher performance simulations
● The Ode DSL provides several novel features for cardiac simulations
● Language (almost!) complete, work remains on the high-performance implementation
Acknowledgements● Supervisors
– Prof. David Gavaghan, University of Oxford, UK
– Dr. Steve McKeever, University of Oxford, UK
● Thank you for listening
● Questions?