morphforge Biophysical simulation in Python Mike Hull - - PowerPoint PPT Presentation

morphforge
SMART_READER_LITE
LIVE PREVIEW

morphforge Biophysical simulation in Python Mike Hull - - PowerPoint PPT Presentation

morphforge Biophysical simulation in Python Mike Hull (s0897465@sms.ed.ac.uk) University of Edinburgh University of Bristol FACETS Code Jam #4 Marseille 22-24 June 2010 Outline My research Introduction Motivation What is


slide-1
SLIDE 1

morphforge

Biophysical simulation in Python Mike Hull (s0897465@sms.ed.ac.uk) University of Edinburgh University of Bristol FACETS Code Jam #4 Marseille 22-24 June 2010

slide-2
SLIDE 2

Outline

Introduction

◮ My research ◮ Motivation ◮ What is morphforge?

Morphforge

◮ Morphologies ◮ Simulations ◮ Sweeps

From Here

◮ Wishlist ◮ Collaborations

slide-3
SLIDE 3

About Me & My Work

◮ Collaboration with Alan Robert’s experimental lab

slide-4
SLIDE 4

About Me & My Work

◮ Collaboration with Alan Robert’s experimental lab ◮ Locomotive networks in Xenopus laevis tadpoles

slide-5
SLIDE 5

About Me & My Work

◮ Collaboration with Alan Robert’s experimental lab ◮ Locomotive networks in Xenopus laevis tadpoles ◮ Modelling:

◮ Small Networks ( 2000 neurons)

slide-6
SLIDE 6

About Me & My Work

◮ Collaboration with Alan Robert’s experimental lab ◮ Locomotive networks in Xenopus laevis tadpoles ◮ Modelling:

◮ Small Networks ( 2000 neurons) ◮ Hodgekin-Huxley type models of different neuron classes

slide-7
SLIDE 7

About Me & My Work

◮ Collaboration with Alan Robert’s experimental lab ◮ Locomotive networks in Xenopus laevis tadpoles ◮ Modelling:

◮ Small Networks ( 2000 neurons) ◮ Hodgekin-Huxley type models of different neuron classes ◮ Morphology of neurons important due to electrical coupling

slide-8
SLIDE 8

Previous Workflow (MSc Project)

◮ Initial channel modelling

Handwritten .hoc & .mod files (NEURON)

slide-9
SLIDE 9

Previous Workflow (MSc Project)

◮ Effects of changing parameters

Cheetah generated .hoc & .mod files, scripts for building, re-import data as CSV for plotting

slide-10
SLIDE 10

Previous Workflow (MSc Project)

◮ · · ·

months passed · · ·

slide-11
SLIDE 11

Previous Workflow (MSc Project)

◮ Network modelling

2 x YAML + XML files converted into another XML neuron containing network & output specification = ⇒ cheetah generated .hoc & .mod files, Makefiles for building, re-import data from csv as for plotting, caching of results in a directory.

slide-12
SLIDE 12

Previous Workflow (MSc Project)

◮ Time for a rethink ?!?!?

slide-13
SLIDE 13

Motivation

Morphology

◮ FACETS Code Jam ’09 - Phillip Rautenberg ◮ Morphology Reconstructions in Bristol ◮ DIADEM Project

Simulation

◮ Large Parameter Sweeps

slide-14
SLIDE 14

What is morphforge?

Python Libraries for:

◮ Handling neural morphologies

slide-15
SLIDE 15

What is morphforge?

Python Libraries for:

◮ Handling neural morphologies ◮ Defining & running biophysical simulations

slide-16
SLIDE 16

What is morphforge?

Python Libraries for:

◮ Handling neural morphologies ◮ Defining & running biophysical simulations ◮ Analysing & storing simulation results

slide-17
SLIDE 17

What is morphforge?

Python Libraries for:

◮ Handling neural morphologies ◮ Defining & running biophysical simulations ◮ Analysing & storing simulation results ◮ Simplifying parameter sweeps

slide-18
SLIDE 18

Morphologies

slide-19
SLIDE 19

Morphologies

◮ Represent morphologies as a tree of cylinders ◮ Cylinders can be assigned regions and/or id’s.

slide-20
SLIDE 20

Import/Export & Visualisation

◮ Create morphologies in Python ◮ Load and save .swc files. ◮ Load MorphML files

slide-21
SLIDE 21

Import/Export & Visualisation

◮ Create morphologies in Python ◮ Load and save .swc files. ◮ Load MorphML files ◮ Morphologies can be visualised using:

◮ 2D projections in matplotlib ◮ 3D visualisation in MayaVi

slide-22
SLIDE 22

Analysis & Manipulation

◮ General purpose data structure ◮ Minimal classes + loose coupling =

⇒ Visitor pattern

◮ (Example of straightening tadpole)

slide-23
SLIDE 23

Examples

slide-24
SLIDE 24

Simulations

slide-25
SLIDE 25

Simulation Overview

◮ Simulator Agnostic Description of:

◮ Neurons ◮ Active membrane channels (HH-style) ◮ Passive membrane properties ◮ Voltage & current clamps ◮ Recording electrodes (voltages, currents & membrane

properties)

slide-26
SLIDE 26

Simulation Overview

◮ Simulator Agnostic Description of:

◮ Neurons ◮ Active membrane channels (HH-style) ◮ Passive membrane properties ◮ Voltage & current clamps ◮ Recording electrodes (voltages, currents & membrane

properties)

◮ Handles units

slide-27
SLIDE 27

Simulation Overview

◮ Simulator Agnostic Description of:

◮ Neurons ◮ Active membrane channels (HH-style) ◮ Passive membrane properties ◮ Voltage & current clamps ◮ Recording electrodes (voltages, currents & membrane

properties)

◮ Handles units ◮ Simplification of plotting

slide-28
SLIDE 28

Simulation Overview

◮ Simulator Agnostic Description of:

◮ Neurons ◮ Active membrane channels (HH-style) ◮ Passive membrane properties ◮ Voltage & current clamps ◮ Recording electrodes (voltages, currents & membrane

properties)

◮ Handles units ◮ Simplification of plotting ◮ Basic trace analysis

slide-29
SLIDE 29

Simulation Overview

◮ Simulator Agnostic Description of:

◮ Neurons ◮ Active membrane channels (HH-style) ◮ Passive membrane properties ◮ Voltage & current clamps ◮ Recording electrodes (voltages, currents & membrane

properties)

◮ Handles units ◮ Simplification of plotting ◮ Basic trace analysis ◮ Caching simulation results

slide-30
SLIDE 30

Neuron Specific

◮ Uses python-neuron interface ◮ Use existing .mod files directly ◮ Behind the scenes:

◮ Generate .hoc and .mod files ◮ Compiles .mod files ◮ Registers .mod files into neuron-instance

slide-31
SLIDE 31

Simulation Examples

slide-32
SLIDE 32

Sweeps & Bundles

slide-33
SLIDE 33

Bundles

A wrapper around Simulation objects, in order to:

◮ Attach pre/post-simulation functors ◮ Encapsulate serialisation

slide-34
SLIDE 34

Execute Pre-Sim Actions Run Simulation::Simulate() Execute Post-Sim Actions

Bundle::execute()

Bundle

def load(...): def save(...): def addPreFunctor(...): def addPostSimFunctor(...): def execute(...):

Simulation

def addNeuron(...): def addCurrentClamp(...): def addVoltageClamp(...): def recordVoltage(...): def recordCurrent(...): def Simulate(...): A 'Bundle' wraps a 'Simulation'

slide-35
SLIDE 35

Parameter Sweeps

A simple mechanism for distributing simulations over XML-RPC has been written; comprising a BundleServer and BundleClient;

◮ the user needs to write a function returning a list of

simulation-bundles to run, for the BundleServer.

slide-36
SLIDE 36

Parameter Sweeps

A simple mechanism for distributing simulations over XML-RPC has been written; comprising a BundleServer and BundleClient;

◮ the user needs to write a function returning a list of

simulation-bundles to run, for the BundleServer.

◮ for example, this could have a post-sim functor that analyses

the output voltage traces and writes a row to a DB somewhere.

slide-37
SLIDE 37

Parameter Sweeps

A simple mechanism for distributing simulations over XML-RPC has been written; comprising a BundleServer and BundleClient;

◮ the user needs to write a function returning a list of

simulation-bundles to run, for the BundleServer.

◮ for example, this could have a post-sim functor that analyses

the output voltage traces and writes a row to a DB somewhere.

◮ The BundleServer is started on a single machine and acts as a

daemon, keeping a track of which bundles have been handed

  • ut to which clients.
slide-38
SLIDE 38

Parameter Sweeps

A simple mechanism for distributing simulations over XML-RPC has been written; comprising a BundleServer and BundleClient;

◮ the user needs to write a function returning a list of

simulation-bundles to run, for the BundleServer.

◮ for example, this could have a post-sim functor that analyses

the output voltage traces and writes a row to a DB somewhere.

◮ The BundleServer is started on a single machine and acts as a

daemon, keeping a track of which bundles have been handed

  • ut to which clients.

◮ The BundleClient can be started on many clients. Each client

contacts the server, requests n Bundles, runs them, notifies the server about whether bundles ran successfully or not, then requests more bundles....

slide-39
SLIDE 39

Parameter Sweeps Results Examples

◮ Modelling the effects of conductances on firing behaviour ◮ Na, Ca, Kf, Ks, Lk channels + injected current ◮ 110,000 simulations run in a night over 30 computers

slide-40
SLIDE 40

Parameter Sweeps Results Examples

Single Spiking Neurons Multiple Spiking Neurons Ambiguous Neurons Non-Repolarising Neurons Overly Excitable Neurons

Kf Conductance Density Multiplier Ks Conductance Density Multiplier

1.0 2.0 0.0 1.0 0.0 2.0

slide-41
SLIDE 41

From Here

slide-42
SLIDE 42

WishList

High Priority

◮ Interface for neural connectivity ◮ Documentation & testing

Low Priority

◮ Summary pdfs/tex output ◮ Loading *ML formats

slide-43
SLIDE 43

Collaboration

◮ Code is in a mercurial repository - email

s0897465@sms.ed.ac.uk

◮ To be made public (advice on open licenses) ◮ Is this useful to other people? ◮ Integration with other open-source tools ◮ Keen to find collaboration.....

slide-44
SLIDE 44

Acknowledgements

◮ Juan Reyero (Magnitude Units Package) ◮ Enthought (MayaVi Package) ◮ Everyone working on scientific python libraries! ◮ NEURON & Python Interface ◮ Organisers of Code Jams ◮ Supervisors: Alan Roberts & David Willshaw

Thankyou!