Modular Mathematical Modelling of Biological Systems


Published on

Presentation at the 2nd International Workshop on Model-driven Approaches for Simulation Engineering

(held within the SCS/IEEE Symposium on Theory of Modeling and Simulation part of SpringSim 2012)

Please see: for further details

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Modular Mathematical Modelling of Biological Systems

  1. 1. Modular Mathematical Modelling of Biological Systems Mandeep Gill
  2. 2. 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
  3. 3. 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
  4. 4. 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
  5. 5. Cardiac Model Example −I stim +∑ I ionδV = Cm
  6. 6. 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...
  7. 7. 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++
  8. 8. 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 were interested in
  9. 9. 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
  10. 10. 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
  11. 11. Example : Hodgkin-Huxley Modelcomponent calc_i_K (V, E_R) => i_K where { val i_K = g_K * pow(n, 4) * (V - E_K) Components similar to functions val n = potassium_channel_n_gate(V) val g_K = 36 val E_K = E_R - 12} Constant values can be set to the results of expressions
  12. 12. Example : Hodgkin-Huxley Modelcomponent 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
  13. 13. 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
  14. 14. 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 dimensioncomponent 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)} Infers that V is of unit milliV
  15. 15. 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 module HHModel { import HH.LeakagePotassium Sodium Leakage Channel Channel Current import HH.KChannel import HH.NaChannel component membrane _ => V where { // calc dV here... Hodgkin-Huxley model } }
  16. 16. 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 module HHModel(KChannel) {Potassium Hodgkin-Huxley // as before... Channel model } } Alt. Can switch between implementations soPotassium long as modules exhibit same interface, calc_I_K :: (Float : milliV, Float : milliV) Channel -> Float : microA/cm^2
  17. 17. Current Status Define Ode Language● Base language is defined, including syntax and Language type semantics and unit system● Can develop models using all DSL features Language Module system Complete – Just cant simulate them yet! To do High-Performance Simulation Stochastic Support
  18. 18. Current Status – High Performance Sim Define Ode Language ● Use partial evaluation and run-time code generation Language type ● Generate model-specific and unit system simulation code Language ● Target multi-core CPUs and Complete Module system GPUs To do High-Performance Simulation Stochastic Support
  19. 19. Current Status – Stochastic Modelling● Biological systems inherently Define Ode stochastic Language● In certain cases we should Language type model stochastically and unit system – e.g. Effects of drugs Language – model continuously using Module system Complete SDEs – model discretely using To do High-Performance Markov-chains and the Simulation Stochastic Simulation Algorithm (SSA) Stochastic Support● Increases CPU requirements
  20. 20. 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
  21. 21. Acknowledgements● Supervisors – Prof. David Gavaghan, University of Oxford, UK – Dr. Steve McKeever, University of Oxford, UK● Thank you for listening● Questions?