Department of Mathematical Sciences B12412: Computational and

NEURON http://www.neuron.yale.edu/neuron/

NEURON is a simulation environment for modeling individual and networks of neurons. It provides tools for conveniently building, managing, and using models in a way that is numerically sound and computationally efficient. It is particularly well-suited to problems that are closely linked to experimental data, especially those that involve cells with complex anatomical and biophysical properties. Visit ModelDB1 for an archive of published models that are ready to run. In summary, NEURON • is a flexible and powerful simulator of neurons and networks

• has important advantages over general-purpose simulators

• helps users focus on important biological issues rather than purely computational concerns

• has a convenient user interface

• has a user-extendable library of biophysical mechanisms

• has many enhancements for efficient network modeling

• offers customizable initialization and simulation flow control

• is widely used in neuroscience research by experimentalists and theoreticians

• is well-documented and actively supported

• is free, open source, and runs on (almost) everything

A flexible and powerful simulator of neurons and networks.

Overview of NEURON

NEURON was initially designed to facilitate dealing with neuronal models in which complex membrane properties and extended geometry play important roles. Subsequently its domain of applicability has been increased by adding facilities for describing longitudinal ionic diffusion and computationally efficient representation of connections in a network. The fundamental principles behind the design and implementation of NEURON are detailed in the NEURON book2, but it is useful to summarize them briefly here. NEURON is formulated around the notion of continuous cable sections which can be connected together to form any kind of branched cable. A section can be assigned properties that vary continuously with position along its length. The aim is to completely separate the physical properties of the neuron from the numerical issue of size of spatial compartments, and thus to help the investigator focus on the biology rather than computational details. User-defined biophysical properties of membrane (e.g. ion channels, pumps) and cytoplasm (e.g. buffers and second messengers) are described in terms of differential equations, kinetic schemes, and sets of simultaneous equations. These model descriptions are

1http://senselab.med.yale.edu/senselab/modeldb/ 2The NEURON Book, Nicholas T. Carnevale, Michael L. Hines, Cambridge University Press, 2006

1 compiled, so that membrane voltage and gating states can be computed efficiently using an implicit integration method optimized for branched structures. NEURON derives its flexibility and convenience from two features. The first is a graphical interface (GUI) that can be used to create models, run initial exploratory simulations, set parameters, control common voltage and current stimuli, and graph variables as functions of time and position. The second is an object-oriented interpreter that provides a complete programming language which is useful for customization of the GUI, advanced data analysis, and optimization. Thus NEURON puts a great deal of computational power at the disposal of the user, especially for the study of models that have a close relationship to experimental data. Yet this facility as a vehicle for implementing empirically-based models immediately raises a new set of problems that are related to managing anatomical and biophysical complexity so as to achieve computational efficiency and accuracy while at the same time minimizing the effort required of the user.

Cell Builder

The CellBuilder is one of NEURONs latest enhancements. It is a very powerful and convenient graphical tool for constructing and managing models of individual neurons. The CellBuilder is actually a graphical code generator. In other words, you can use the CellBuilder to enter the specifications for your model cell without having to write any (hoc) code yourself. When youre satisfied with the specification you have created, the CellBuilder will write the necessary code for you. A snapshot from NEURON – CellBuilder

Building a simple Hodgkin-Huxley model

1. From Build, choose Cell Builder. This creates a basic model with just a .

2. You will see a radio-button list - About, Topology, Subsets, Geometry, Biophysics. For now we need only concern ourselves with setting the membrane properties of the soma - choose Biophysics.

3. To give the soma Hodgkin-Huxley kinetics (the ability to generate an ) click hh from the list on the right.

4. The model is complete! To generate the code that NEURON will use to render the computational model click Continuous Create in the top menu.

5. We may now test the model by driving it with a current. In the main NEURON menu choose Tools -- Point Processes - Managers -- Point Manager From SelectPoint

2 Process choose your gate (IClamp) at the top of the list. Set dur (duration of stimulus) to 100 ms and amp (amplitude of stimulus) to 20 nA.

6. To plot the voltage in the cell return the main NEURON window and choose Graph -- State axis. In the window right click to bring up a context dependent menu and select Plot what? then select soma and then v(0.5) (the voltage at the mid-point of the soma).

7. To run the model return to the main NEURON window and choose Tools -- RunControl and then click Init & Run.

8. By adjusting the plotting scale (using View ...) in the Graph window you will see output. This can be changed by modifying parameters in the PointProcess Manager window.

From the NEURON menu choose Tools -- Point Processes - Managers -- Point Manager and use other stimulation protocols from SelectPoint Process (such as synaptic ones: Al- phaSynapse, ExpSyn) to investigate the behaviour of the Hodgkin-Huxley model. Plot other variables of the model such as the Na current (use Plot What? -- soma -- ina(0.5)).

Channel Builder

The Channel Builder is a GUI tool for creating voltage- and ligand-gated channels whose state transitions are described by kinetic schemes and/or Hodgkin-Huxley-style differential equations. Channel gating can be deterministic or stochastic. Deterministic gating models are based on the (often tacit) assumption of a very large number of channels, each having a very small conductance. This is also called the ”continuous system approximation to a large population of channels with discrete states.” The result is a simulation in which gating variables, ionic conductances and ionic currents are continuous functions of time. The classical Hodgkin-Huxley model is a typical example of a deterministic gating model.

Ionic gates are embedded in the cell membrane and control the passage of ions.

Conductance based models are all written in the form of a current-balance nonlinear differential equation: dV = I + I , dt ion app

where C is the membrane capacitance, V the membrane voltage, Iion represents all ionic mem- brane currents and Iapp represents externally injected current. Ionic currents have the generic form p q Iion = gionm h (Vion − V),

3 where p and q are integers. Here gion is the conductance of the ionic current, m, h are (ac- tivating, inactivating) gating variables, and Vion is the reversal potential. The gating variables are dynamic, and evolve in time according to nonlinear differential equations. The art of ionic current modelling is in finding the best set of gating dynamics! The conductance variables m and h take values between 0 and 1 and approach the asymptotic values m (V), and h (V) with time constants τm(V) and τh(V) respectively. Summarizing, we have that ∞ ∞ dm dh τ (V) = m (V) − m, τ (V) = h (V) − h m dt h dt ∞ ∞ The functions τm(V), τh(V), m (V) and h (V) are obtained from fits with experimental data.

∞ ∞ Adding other ionic currents to NEURON

The Hodgkin-Huxley kinetics can be built from scratch (and also modified) from the main NEURON menu using Build, choosing Channel Builder -- Density, and then selecting Properties -- Gate Constructor. Clicking on Properties again one can then choose HH sodium channel or HH potassium channel. The functional forms for the gating variables (such as deined by m and τm, called inf and tau by NEURON) of these channels can be modified by clicking on the Properies radio button (in the Gate Constructor) and highlighting the gate name. ∞

An example: The slow T-type calcium current

Inclusion of the so-called IT current can result in a burst of spikes. This current is often found in thalamic relay (TC) cells (in the thalamus). It is thought to be involved in relaying sensory information from the brainstem and periphery to the cortex. These cells have at least two modes of operation.

• During wakefulness or REM , the cells resting potential is around −63 mV, and a small pulse of injected current does not evoke spikes. If the cell is depolarized to around −53 mV, then the same small pulse of injected current evokes a train of spikes. • During slow wave sleep, the cells resting potential is around −75 mV. In this mode (some- times called burst mode), the same small pulse of injected current initiates a low-threshold Ca spike (via the IT current), which results in a burst of spikes.

A movie of intracellular recordings from a thalamic relay cell can be found at the McCormick lab http://www.med.yale.edu/neurobio/mccormick/movies/rly exp.mpg

A simple model of this current is given by

3 IT = gTm h(VT − V), with 1 m (V) = , τ (V) = 0.1 1 + e−(V+72)/3) m 1 h∞(V) = , τ (V) = 7.66 + 0.02868e−0.1054V , 1 + e2(V+70) h

∞ −2 with gT = 0.00013 Scm and VT = 120 mV.

Run NEURON and then perform the following tasks

4 1. From Build, choose Channel Builder -- Density. 2. From Properties choose Channel Name and set this to IT. From Default gmax set gmax = 0.00013 and e = 120. 3. From Properties choose Gate Constructor. 4. Drag an open (O) state onto the canvas and rename it m (by clicking on it).

5. Click the Properties radio-button – here we will set the functions m (V) and τm(V).

6. Click the m variable and set Power to 3. Then click Display inf,tau and∞ from Equation Type choose alpha,beta -- inf,tau. Pick Equation Type -- infm -- A/(1+e−k(d−v)) and set A = 1, k = −0.33 and d = −72 and then in the box below (taum=A) set A = 0.1. 7. Click States. Drag an open (O) state onto the canvas and rename it h (by clicking on it). 8. Repeat the above for the h variable with Power set to 1. After choosing Equation Type -- infh -- A/(1 + e−k(d−v)) set A = 1, k = 2, and d = −70. To set the form of τh(V) we first create its functional shape using Tools -- Fitting -- Parameterized Function from the main NEURON menu. 9. In Y-expr type 7.66 + 0.02868 ∗ exp(−0.1054 ∗ t). Right-click on the graph window, and use View ... Set View to change the X size to -100 100 and the Y-size to 0 20. Click Plot in the main window to see the shape of the function. Then right-click on the graph and choose Pick Vector and then click on the shape of the curve. This loads the data into the clipboard so that we can export it into Channel Builder. 10. Back in Channel Builder choose Equation Type -- tauh -- KSChanTable and then click Fill -- from Clipboard. The model of IT is now complete. Click on run to create the code. 11. Create a basic cell using Cell Builder. You will now see that under Biophysics IT is available. Endow your model with both hh and IT properties and click Continuous Create. 12. Drive the model with an Alpha synapse with τ = 10 ms, gmax = 1 µS, e = −100 mV (inhibitory synapse) to see a rebound burst response (with Tstop=500ms in the Run Control).

40 v(.5)

0 0 100 200 300 400 500

-40

-80

Any detailed current model can be implemented in the above fashion. For a discussion of many standard current models (IT , Ih, IAHP, . . . ), see the book by John Huguenard and David A. McCormick, Electrophysiology of the Neuron, Oxford University Press, 1994.

5 An online Channel Builder tutorial can be found at http://www.neuron.yale.edu/neuron/static/docs/chanlbild/main.html

The Connor-Stevens model of the IA current

The Hodgkin-Huxley model of action potential generation was developed on the basis of data from the giant of the squid, and. The Connor-Stevens model (1971) provides an alternative description of action potential generation. Like the Hodgkin-Huxley model, it contains fast Na+, delayed-rectifier K+, and leakage conductances. The fast Na+ and delayed-rectifier K+ conductances have somewhat different properties from those of the Hodgkin-Huxley model, in particular faster kinetics, so the action potentials are briefer. In addition, the Connor-Stevens model contains an extra K+ conductance, called the A-current, that is transient.

The model of the IA current is 3 IA = gAm h(VA − V) with

0.0761 exp(0.0314(V + 94.22))1/3 m (V) = 1 + exp(0.0346(V + 1.17)) ∞ 1.158 τ = 0.3632 + , m 1 + exp(0.0497(V + 55.96))  1 4 h (V) = , 1 + exp(0.0688(V + 53.3)) ∞ 2.678 τ = 1.24 + h 1 + exp(0.0624(V + 50)) with VA = −75 mV. Use Channel Builder to construct this current and add it to a simple Hodgkin-Huxley model. Sow that (slowly!) increasing gA from zero can decrease the rate of firing (in response to a constant stimulus.)

Axons

To explore the behaviour of a Hodgkin-Huxley model distributed along a uniform fibre work through the NIA2 tutorials in Basic . This will show you how the spread of an action potential along an axon is mediated by voltage-sensitive ion channels in such a way that the shape and amplitude of the signal are maintained with high integrity. Time permitting you should also look at the Advanced Axons tutorials.

Dendrites

Dendrites (from Greek dendron, “tree”) are the branched projections of a neuron that act to conduct the electrical stimulation received from other cells to and from the cell body, or soma, of the neuron from which the dendrites project. Electrical stimulation is transmitted onto dendrites by upstream neurons via synapses which are located at various points throughout the dendritic arbor. Dendrites play a critical role in integrating these synaptic inputs and in determining the extent to which action potentials are produced by the neuron.

6 Morphology

Dendrites are made up of dendritic segments (which are often named according to their relative position to the soma). Many dendrites contain dendritic spines, small mushroom like protrusions that offer isolated computational compartments on which axon terminals can create synapses. In general, whereas axons may span the length of nearly a meter, dendrites are more localised around the cell body. Two examples are spinal motor neurons with dendritic arbors of a few millimetres in diameter, and retinal amacrine cells, with arbors of only few hundred micrometers in diameter. Dendrites account for the bulk of the surface area of neurons, with as much as 98% of the neuronal phospholipid bilayer membrane devoted to the dendritic arbor. Additionally, excitatory and inhibitory synapses distribute themselves on the dendritic arbor such that excitatory synapses usually occupy more distal locations while inhibitory synapses are typically located more proximally. Dendritic morphology, the structural and physical architecture of the dendritic arbor, varies greatly across neuronal type. Dendrites of Purkinje cells, a dominant cell type in the cerebellum, extend from the soma to form a nearly two dimensional arborization. Purkinje cells are stacked in the cerebellum much like dominoes (i.e., with their dendritic arbors parallel to each other) allowing the afferent connections of parallel fibers to run orthogonally through the dendrites. Pyramidal neurons, the most prevalent excitatory neuron in the cerebral cortex harbour two different classes of dendrites. The apical dendrites extend vertically from the apex of the pyramidally shaped soma and project toward the pial surface of the cerebral hemispheres. The basal dendrites of pyramidal neurons project laterally from the base of the soma. The distinction between different classes is particularly important for pyramidal neurons as apical dendrites typically receive afferent input from distant sources such as the thalamus while the basal dendrites receive inputs from nearby cortical areas.

7 Left: Drawing by Santiago Ram´ony Cajal of neurons in the pigeon cerebellum. (A) Denotes Purkinje cells, an example of a . (B) Denotes granule cells which are multipolar. Right: Dendritic spines.

Electrical properties of dendrites

The structure and branching of a neuron’s dendrites, as well as the availability and variation in voltage-gated ion conductances, strongly influences how it integrates the input from other neu- rons, particularly those that input only weakly. This integration is both “temporal” – involving the summation of stimuli that arrive in rapid succession – as well as “spatial” – entailing the aggregation of excitatory and inhibitory inputs from separate branches. Dendrites were once believed to merely convey stimulation passively, i.e. via diffusive spread of voltage and without the aid of voltage-gated ion channels. Passive cable theory describes how voltage changes at a particular location on a dendrite transmit this electrical signal through a system of converging dendrite segments of different diameters, lengths, and electrical properties. However, it is impor- tant to remember that dendrite membranes are host to a zoo of proteins some of which may help amplify or attenuate synaptic input (like those in the axon). One important feature of dendrites, endowed by their active voltage gated conductances, is their ability to send action potentials back into the dendritic arbor. Known as backpropagating action potentials, these signals depolarize the dendritic arbor and provide a crucial component toward synapse modulation and long-term potentiation.

Dendritic modelling3

The objective of realistic single cell modeling is to approximate the electrophysiological behavior of biological neurons as closely as possible. Since each type of neuron in the brain is characterized by distinct morphological features, as well as distinct electrophysiological features this requires a case-by-case study – within the overall famework of cable theory and compartmental modelling. The theoretical basis of compartmental modeling is given by cable theory, a set of well understood concepts originally introduced by Wilfried Rall. A basic dictum of cable theory is that in passive cylinders signals decay over space and time in a mathematically understood fashion. The concepts of time constant (τ) and space constant (λ) simplify the temporal and spatial description of signal decay.

3from the article by Dieter Jaeger: http://www.brains-minds-media.org/archive/222/

8 Because passive membrane is assumed, the spatio-temporal distribution of membrane potential along the cylinder must obey a partial differential equation, known as the cable equation; this can be expressed ∂V ∂2V = −V + ∂T ∂X2

where V = Vm−Vr represents the departure of the membrane potential V (which is the difference, intracellular Vi minus extracellular Ve), from its resting value, Vr. Also, x X = , λ = pr /r = p(R /R )(d/4), λ m i m i t T = , τm = rmcm = RmCm. τm

Here ri is the intracellular (core) resistance per unit length of the cylinder, while cm and 1/rm are the membrane capacity, and membrane conductance, respectively, per unit length of the membrane cylinder; d is the cylinder diameter, while Rm and Cm apply to unit membrane area, and Ri is the volume resistivity of the intracellular medium.

Membrane decay constant τ. Comparison of normalized charging curves for finite cables of different electronic lengths. A step of current is injected and the voltage is measured, at x = 0.

In practice, neurons have finite length processes with closed ends. Steady state voltage decays significantly when processes are of length > 1 space constant or so, which is typically the case in large neurons. Importantly, signal decay in cylinders is frequency dependent, and signals with fast rise and fall time (such as action potentials) decay over much shorter distances than steady state potentials. Signal decay can be depicted graphically by “morphoelectronic transforms”. Here it is demon- strated that signal decay is non-symmetrical and that voltage transients generated in the dendrites decay much more than voltage transients from the soma to the tip of the dendrites. This effect is due to the branching structure of the neuron and the increasing diameter of processes toward the soma.

9 Membrane space constant λ. Comparison of voltage decays along finite cables of different electronic lengths and with end terminations. Current is injected at x = 0. The solid lines are for finite cables with sealed ends (no current flows out of either end), the dashed lines are for finite cables with open ends, and the dotted line is for a semi-infinite cable.

Voltage attenuation along a finite-length cable (L = 1) for current injections (DC to 100 Hz) at 2 x = 0 (i.e., soma) (Rm=50,000 Ω cm ).

Another important feature of signal decay is its dependence on input resistance, which itself decreases dramatically during barrages with synaptic input. Thus the shown morphoelectronic transforms (Fig. 6) would show much more pronounced signal decay yet if the neuron was subjected to a synaptic input barrage. Beyond the passive structure of a neuron (process diameters, lengths, passive input resistance, membrane capacitance, and axial resistance) neural dynamics are crucially dependent on the presence of voltage-gated ion channels. The modeling of individual ion channels would be too computationally costly, however, and the Hodgkin-Huxley formalism of macroscopic currents (one for each species of ion channel) is typically employed. The overall structure of a compartmental model is depicted. The neuron is divided into isopoten- tial compartments (these need to be chosen small enough such that signal decay within the length of one compartment is expected to be negligible under all conditions), and each compartment is given passive properties: membrane capacitance (CM), membrane resistance (described by leak conductance and leak reversal potential). Lastly, active conductance properties are inserted, and are described by maximal conductance values (e.g. gK), voltage-dependence (denoted by the arrow), and reversal potential. The three steps to make a single neuron model are i) create an accurate morphological recon- struction, ii) create an accurate passive model, and iii) match active properties with physiological

10 “Morphoelectronic transforms”. A reconstructed CAI neuron is shown on the left, and the morphoelectronic transforms for the decay of potential fom the soma out the dendrites and from the dendrites toward the soma are illustrated on the right. The neuron diagrams on the right are drawn according to a scale that represents the ln of the voltage attenuation ratios (1 ln unit represents voltage attenuation of 1/e from the site of current injection). The top middle transform represents the ln (attenuation) of a DC dignal applied to the soma as it decays to different sites of dendrites. The top right transform represents the ln(attenuation) of a DC signal applied to different sites in the dendrites as it decays toward the soma. The two transforms at the bottom right represent the same measurement as those above but resulting from the application of a 40 Hz sine wave signal instead of 0 Hz. data.

Create an accurate morphological reconstruction

Creating a model starts with a morphological reconstruction of dye-filled neurons. Typically biocytin fills from slice recordings are used. The initial histological processing can already lead to distortions of the true neural morphology due to fixation shrinkage as well as mechanical stresses. Here, the same Purkinje cell is shown before and after cover-slipping. A little bit of squeeze on the cover slip significantly distorts the relative branch lengths. A certain amount of error in morphological reconstructions due to such distortions as well as incomplete fills of spines and distal processes should always be expected. Alternatively grab data from an existing database such as

• Hippocampal Neuronal Morphology Archive at http://www.compneuro.org/CDROM/nmorph/index/topindex.html.

• Cell Centered Database (CCDB) at http://ccdb.ucsd.edu/CCDBWebSite/index.html Virtual Neuromorphology electronic database at http://krasnow.gmu.edu/L-Neuron/L-Neuron/database/index.html

• Neocortical microcircuit cell database at http://microcircuit.epfl.ch/databases/dbCellSearch.asp

• NeuroMorpho database at http://neuromorpho.org

11 Structure of a compartmental model

Biocytin fills from slice recordings.

Also it is worth knowing about Cvapp – this is a cell viewing, editing and format converting program for morphology files. It can also be used to prepare structures digitized with Neurolucida software for modeling with NEURON. It is available from http://www.compneuro.org/CDROM/nmorph/cellArchive.html.

Create an accurate passive model

After the morphology description has been imported into the simulation software, the passive parameters of the cell need to be fit to data. If the morphological reconstruction is less than ideal, the fit parameters may show a shift with respect to the true values to offset erroneous measurements on cell surface area and process diameters. For example, if surface area is missing, the specific membrane capacitance may come out higher than the standard value of 1µF cm−2. Tasks:

• Set Rm, Cm, and Ri correctly for each compartment.

If the assumption that parameters are uniform holds, need to fit 3 values. Strategy:

• Obtain data from recordings, then optimize Rm, Cm, and Ri to fit data.

To fit passive parameters, recorded neural responses of the same cell type two current injection pulses need to be available. These recordings need to be undertaken after voltage-gated con- ductances are blocked. A complete block is often difficult, and the recorded passive responses may deviate from the true passive response due to several other potential problems as well (such

12 as due to the electrode serial resistance). Fitting passive responses is done by running current injections into the soma of the model cell and optimizing the match of the voltage response with that of recordings.

Match active properties with physiological data

This takes the bulk of the total time in making a good model. The construction of a biologically realistic model is a more hopeful prospect if the availability of voltage-clamp date for the various voltage-gated conductances of the cell type under study is good. If such data are not available, one can proceed with default channel kinetics determined in other cell types and fit current-clamp data as well as possible. However, this latter process is unlikely to generate an accurate model in the end. Tasks:

• Construct voltage-gated conductances with correct kinetics.

• Incorporate intracellular calcium handling.

• Find needed densities of channels in each compartment.

• Add realistic synaptic input conductances.

Once a model is complete, it can help the scientist to appreciate the 3-dimensional distribution of voltage and currents throughout different activity regimes. Movie files are one helpful tool to obtain this information.

Here, the membrane potential distribution of a Purkinje cell model is depicted shortly after the onset of current injection into the soma.

13 Some examples4

Run NEURON (nrngui). File - load .hoc

Simple geometry

.hoc file is simple cell.hoc. This demonstrates a simple 3-branch model (and by checking the hh button it can also model active Hodgkin-Huxley membrane), with a current clamp on one of the branches. The location of this current can be moved with a mouse click (see PointProcess- GroupManager window).

Realistic geometry

Passive: .hoc file is interneuron passive.hoc. This demonstrates a real interneuron geometry with a current clamp on one of the branches. In this example the tree is always passive and the soma has Hodgkin-Huxley dynamics. Active: .hoc file is interneuron active.hoc. In this example the tree is always active.

1. Now (on your own) go through the CellBuilder tutorial available at http://www.neuron.yale.edu/neuron/static/docs/cbtut/main.html

2. Visit http://neuromorpho.org/ and load a realistic cell morphology (pick browse all files from the left menu, then By Cell Type, then Pyramidal from the pie-chart, then 06a pyramidal11aACC). Click 3D Neuron Viewer, then save the file using Save in Neuron with the filename CorticalCell.hoc. Now run a fresh NEURON session and follow the steps above (in the CellBuilder tutorial) to create a cell. This time however use File -- load from the NEURON main menu and load the file CorticalCell.hoc. Click the Management radio button in the CellBuilder and then check the box import and then select the gray box Import -- Top Level -- Go ahead, and then click Turn off indexed name display. You will see the realistic morphology drawn in the left window. You can also plot (and rotate) this image from the main NEURON menu using Graph - Shape plot, and then from the mouse menu choose Shape Style -- Show Diam and Variable Scale -- Shape Plot. You may now endow this with biophysical properties (say with Hodgkin-Huxley membrane at the soma) in CellBuilder and test the response of the cell to different stimuli. Repeat this for a number of different cell types from the NeuroMorpho database (pyramidal, stellate, Tangential, Von Economo, motoneuron, Purkinje, etc.) and explore how geometry shapes the firing response of cells.

Get into the habit of saving your work by clicking File - save session from the main NEURON menu.

S Coombes 2010

4code available at http://www.maths.nott.ac.uk/personal/sc/cnn/

14