Multi-compartmental and multi-scale modeling in MOOSE via Python - - PowerPoint PPT Presentation

multi compartmental and multi scale modeling in moose via
SMART_READER_LITE
LIVE PREVIEW

Multi-compartmental and multi-scale modeling in MOOSE via Python - - PowerPoint PPT Presentation

Multi-compartmental and multi-scale modeling in MOOSE via Python Subhasis Ray National Centre for Biological Sciences Tata Institue of Fundamental Research Bangalore, INDIA BrainScaleS CodeJam 5, Edinburgh 2012 Outline Walk through:


slide-1
SLIDE 1

Multi-compartmental and multi-scale modeling in MOOSE via Python

Subhasis Ray National Centre for Biological Sciences Tata Institue of Fundamental Research Bangalore, INDIA BrainScaleS CodeJam 5, Edinburgh 2012

slide-2
SLIDE 2

Outline

  • Walk through: simple compartmental model
  • Multiscale modeling outline
  • Architecture of MOOSE
  • Extensions
  • Preview of upcoming version
  • Future directions
slide-3
SLIDE 3

3

the Multiscale Object- Oriented Simulation Environment

  • A general purpose simulator framework
  • Draws from experience with GENESIS

Logo credit: Upi Bhalla

slide-4
SLIDE 4

4

What is MOOSE?

Depends on what you are and where you look.

slide-5
SLIDE 5

5

A single passive compartment

Cm Rm Em Cell membrane Cytoplasm Extracellular medium Vm

import moose soma = moose.Compartment('soma') soma.Rm = 7 .6e6 soma.Cm = 7e-9 soma.Em = -70e-3 soma.inject = 1e-6

  • Getting help:

moose.doc('Compartment') moose.doc('HHChannel.chann el')

slide-6
SLIDE 6

6

Recording data vm_table = moose.Table('/vm') vm_table.stepMode = 3 vm_table.connect('inputRequest', soma, 'Vm')

slide-7
SLIDE 7

7

Scheduling moose.context.setClock(0, sim_dt) moose.context.setClock(1, sim_dt) moose.context.setClock(2, plot_dt) moose.context.useClock(0, '/soma', 'init') moose.context.useClock(1, '/##[TYPE=Compartment]', 'process') moose.context.useClock(2, '/vm')

slide-8
SLIDE 8

8

Running the simulation moose.context.reset() moose.context.step(50e-3) vm_table.dumpFile('soma_vm.txt')

slide-9
SLIDE 9

9

Adding another compartment

Cm Rm Rm' Ra' Cm' Ra Em Em' Vm Vm' soma axon Vm, Ra Vm'

slide-10
SLIDE 10

10

soma.Ra = 1e6 axon = moose.Compartment('axon') … soma.connect('raxial', axon, 'axial')

Cm Rm Rm' Ra' Cm' Ra Em Em' Vm Vm'

slide-11
SLIDE 11

11

Inserting Hodgkin-Huxley-type ion channels

Cm Rm Em Ra Cell membrane Cytoplasm Extracellular medium Vm Gk Ek Ik

slide-12
SLIDE 12

12

Setting up the channel

na_chan = moose.HHChannel('/soma/Na') na_chan.Gbar = 1e-9 na_chan.Xpower = 3 na_chan.Ypower = 1 na_chan.connect('channel', soma, 'channel')

Gk=Gbar∗m

3∗h

slide-13
SLIDE 13

13

Setting up the gates

na_chan.setupAlpha('xGate', alphaA,alphaB,alphaC,alphaD,alphaF , betaA,betaB,betaC,betaD,betaF , divs,vmin,vmax)

alpha= A+B∗Vm C+exp( D+Vm F )

dm dt =alpha∗(1−m)−beta∗m

Equation for beta has same form as alpha

slide-14
SLIDE 14

14

Or simply ... from moose import neuroml reader = neuroml.NeuroML() reader.readNeuroMLFromFile( 'GranuleGenerated.net.xml') cell = moose.Cell('/Gran_0')

slide-15
SLIDE 15

15

Even simpler: use MOOSE GUI

slide-16
SLIDE 16

16

Multiscale modeling

  • Ticks with different time-steps run different

components of a model at different rates.

Enzyme Substrate Product Tick2 dt=1s Chemical compartment

slide-17
SLIDE 17

17

Multiscale modeling

  • Ticks with different time-steps run different

components of a model at different rates.

Soma K_AHP channel Tick 0 dt=0.1ms [Ca2+] Electrical model

slide-18
SLIDE 18

18

Multiscale modeling

  • Ticks with different time-steps run different

components of a model at different rates.

Enzyme Substrate Product Tick 2 dt=1s Chemical compartment Soma K_AHP channel Tick 0 dt=0.1ms Electrical model

slide-19
SLIDE 19

19

Multiscale modeling

  • Ticks with different time-steps run different

components of a model at different rates.

Enzyme Substrate Product Tick 2 dt=1s Chemical compartment Soma K_AHP channel Tick 0 dt=0.1ms concentration Electrical model

slide-20
SLIDE 20

20

A more realistic system

Chemical Compartment Electrical Compartment (spine) NMDA Channel Ca Channel Ca Pool

slide-21
SLIDE 21

21

Multiscale modeling: networks

  • You can connect neuronal compartments via

synapse to create a network.

soma_0 axon_0 soma_1 axon_1 SpikeGen_0 SynChan_0 Vm Spike event Gk/Ek

slide-22
SLIDE 22

22

Multiscale modeling: networks

  • You can connect neuronal compartments via

synapse to create a network.

soma_0 axon_0 SpikeGen_0 Vm soma_1 axon_1

slide-23
SLIDE 23

23

Multiscale modeling: networks

  • You can connect neuronal compartments via

synapse to create a network.

soma_0 axon_0 SpikeGen_0 Vm Spike event soma_1 axon_1

slide-24
SLIDE 24

24

Multiscale modeling: networks

  • You can connect neuronal compartments via

synapse to create a network.

soma_0 axon_0 soma_1 axon_1 SpikeGen_0 SynChan_0 Vm Spike event

slide-25
SLIDE 25

25

Multiscale modeling: networks

  • You can connect neuronal compartments via

synapse to create a network.

soma_0 axon_0 soma_1 axon_1 SpikeGen_0 SynChan_0 Vm Spike event Gk/Ek

slide-26
SLIDE 26

26

Multiscale modeling: Olfactory bulb

By Aditya Gilra Aditya Gilra

slide-27
SLIDE 27

27

Multiscale modeling: Cortical column

  • Detailed biophysical

model of single thalamocortical column (based on Traub et al 2005) of rat barrel cortex: 14 cell types 50-120 compartments 11 ion channel types ~3500 cells

thalamus

slide-28
SLIDE 28

28

MOOSE Architecture

Figure: Upi Bhalla

slide-29
SLIDE 29

29

MOOSE Architecture: scripting interface

file database SBW/

  • ther model

system

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

Command line/scripting interface

The command line / scripting interface is where modeler interacts with MOOSE.

user

slide-30
SLIDE 30

30

MOOSE Architecture: Shell

shell file database SBW/

  • ther model

system

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

Command line/scripting interface

The user interface talks to Shell - the single point of access to all functionalities available to the user

user

slide-31
SLIDE 31

31

MOOSE Architecture

shell file database SBW/

  • ther model

system

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

Command line/scripting interface

Shell creates, deletes and queries other MOOSE

  • bjects.

It also executes some of the built-in functionalities reinit, start.

user

Simulation entities

slide-32
SLIDE 32

32

soma

MOOSE Architecture: Messaging

Objects communicate state variables during simulation. Destination fields give handle to functions for callback. na_channel.connect('channel', soma, 'channel')

na_channel Gk/Ek Vm handleChannel() handleVm()

slide-33
SLIDE 33

33

MOOSE Architecture: scheduling

shell file database SBW/

  • ther model

system

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

Command line/scripting interface

At start-up, the scheduling system is initialized

user

Simulation entities

scheduler

slide-34
SLIDE 34

34

MOOSE Architecture: scheduling

database

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

shell file SBW/

  • ther model

system Command line/scripting interface user

Simulation entities

Clock

slide-35
SLIDE 35

35

MOOSE Architecture: scheduling

database

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

shell file SBW/

  • ther model

system Command line/scripting interface user

Simulation entities

Tick 0: dt0 Tick 1: dt1 Clock

slide-36
SLIDE 36

36

MOOSE Architecture: scheduling

database

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

shell file SBW/

  • ther model

system Command line/scripting interface user

Simulation entities

Tick 0: dt0 Tick 1: dt1 Clock init() process() Compartment

slide-37
SLIDE 37

37

MOOSE Architecture: solvers

shell file database SBW/

  • ther model

system

Derived from: http://moose.sourceforge.net/images/stories/architecture_65.jpg

Command line/scripting interface

Solvers can take over the calculation from simulation entities

user

Simulation entities

scheduler solvers

slide-38
SLIDE 38

38

Solvers: Avoid the penalty of object orientation

Compartment 1 Compartment 2 Compartment 3 Compartment 4 Tick0

slide-39
SLIDE 39

39

Solvers: Avoid the penalty of object orientation

Compartment 1 Compartment 2 Compartment 3 Compartment 4 Tick0 Solver

slide-40
SLIDE 40

40

Solvers: Avoid the penalty of object orientation

Compartment 1 Compartment 2 Compartment 3 Compartment 4 Tick0 Solver

Hsolve – neuronal (Niraj) Ksolve – biochemical (Upi) Gillespie – biochemical (Upi)

slide-41
SLIDE 41

41

Extensions

  • NeuroML and SBML support (9ml partially) (Aditya

Gilra, Siji George).

  • MUSIC API for runtime interaction with other

simulators (Niraj Dudani, Johannes Hjorth)

  • Smoldyn engine for reaction diffusion systems at

cellular scale (Steve Andrews, Upi Bhalla).

  • Markov models of ion channels (Vishaka Datta)
  • Generally, MOOSE C++ API allows incorporation of
  • ther specialized simulation engines as solvers.
slide-42
SLIDE 42

42

New MOOSE: sneak preview

  • Complete rewrite applying lessons learned from

previous releases.

  • Facilities for dynamic class information.
  • Focus on utilizing multi-core CPUs and multi-

node clusters.

slide-43
SLIDE 43

43

New MOOSE: sneak preview

  • Complete switch to Python interface (kinetikit and GENESIS

prototype files still supported).

  • Computation cleanly separated from user interaction (runs in

separate thread). No more blocking during long running simulation.

  • Automatic distribution of load among different threads/nodes.
  • Most of biophysics and biochemistry classes have been ported.

Porting of Hsolve, NeuroML-reader, SBML-reader and the GUI are under development.

  • Native support for saving data in HDF5 format.
slide-44
SLIDE 44

44

New MOOSE: sneak preview

  • Python interface rewritten using Python/C API
  • Much slimmer and more efficient than SWIG-based

interface.

  • C++ programmer need not worry about Python – it

dynamically queries the MOOSE core and generates the class hierarchy using metaprogramming.

slide-45
SLIDE 45

45

Future developments

  • Smoldyn support being ported.
  • SigNeur – a specialized solver combining signaling models

with neuronal models.

  • Solvers to utilize GPU for computation in plan.
  • Scope for many other solvers at/between various scales.

Join us at: moose.sourceforge.net moose.ncbs.res.in

slide-46
SLIDE 46

46

Trying out new moose:

  • To check out:

svn checkout \ http://moose.svn.sourceforge.net/svnroot/moose/moose/branches/dh_branch/ \ new_moose

  • To compile (needs g++, make, python-dev, gsl-dev [optional HDF5-dev])

cd new_moose make pymoose [optional USE_HDF5=1]

  • To try squid axon demo (requires numpy, PyQt4 and matplotlib):

export PYTHONPATH={path to new_moose}/python:$PYTHONPATH cd {path to new_moose}/Demos/squid python squid_demo.py

slide-47
SLIDE 47

47

Thank you!

  • Upi, Niraj Dudani, Harsharani, Chaitanya,

Aditya Gilra and many other contributors to the MOOSE project.

  • NCBS/TIFR, DAE/SRC, INCF, SBCNY