Walk-Through: Build a Compartmental Model

You can build simple compartmental models of neurons using the Network module in Neurosim. Such models can form part of a circuit that interacts with other neurons. As an example, we will build a compartmental model consisting of a cell body with a branching dendrite receiving synaptic inputs, and an axon for output. The soma and axon will carry HH-type spikes, but the dendrites will be passive. We will then connect it to some single-compartment integrate-and-fire neurons, to show the interoperability possibilities.

But first, here are some activities to familiarize yourself with the general commands and procedures used in constructing compartmental models.

Warm-Up

If you have not already done the Network Walk-Through Warm-Up, I suggest you do that before proceeding.

There are 6 stand-alone non-spiking neurons in the Setup view (panel a in the figure below). N1 receives an excitatory stimulus pulse which depolarizes it, but since there are no connections between the neurons and each neuron is independent, none of the others shows any response.

Linking and Unlinking Compartments

This links all the selected neurons into a linear chain in ID order, such that each neuron is now a compartment within a single 6-compartment neuron. Note that the "neurons" are now connected by straight lines, indicating intracellular continuity between connected compartments (panel b in the figure below). The zig-zag in the connection line is simply due to the layout order of the 6 compartments in the view - you could re-arrange the compartments into a straight line by dragging them if you wished.

So we now have a compartmental model. How does it behave?

A Detour on Integration Time Step and Stability

Failure! When the simulation run reaches the time of the start of the stimulus, a message pops up saying that the calculation has generated an impossibleIntegration failure can sometimes just result in chaotic output, without generating an impossible number. This is usually obvious in the Results view, when the traces oscillate wildly between extreme values. number, and the run terminates. There are two related underlying problems. First, with this model the default integration time step (0.5 ms) is far too long for the numerical integration method (exponential Euler) used in Neurosim.

The simulation now runs to completion, but it is very slow for such a simple model.

This takes us to the second problem. The 6 compartments are each 50 µm in diameter and only 50 µm in length (the diameter of the original neurons - see Implementation details). This means that there is a very low axial resistance between compartments, and hence even a tiny voltage difference between compartments generates a relatively large axial current flow, causing a very steep rate of change in voltage. That is why the integration time step has to be so short. The issue is apparent when you look at the Results view. There is very little attenuation of the depolarization between N1 at the top of the view, and N6 at the bottom (about 0.06 mV drop). So the entire model is almost isopotential. We could generate almost equally accurate results with a considerably larger step size (and hence a faster simulation run) by making the compartments longer relative to their diameter. We will see how to do that later.

Now we return to editing the model.

N3 and N4 are now once again stand-alone neurons, while N1 + N2 and N5 + N6 form two independent 2-compartment neurons (panel c in the figure below). N3 and N4 should still be selected.

Now we have three 2-compartment neurons!

The connecting line goes through N4, but does not connect to it (panel d in the figure below).

The Setup view is now quite confusing, but the anatomy can be clarified by rearranging the layout of the compartments. Drag each compartment until it matches the layout in panel e in the figure below. It should now be obvious that we have a 6-comparment model of a branching structure, such as a part of a dendritic arbor.

 

a
compartment warm-up
b
compartment warm-up
c
compartment warm-up
d
compartment warm-up
e
compartment warm-up
Building a 6 compartment branching neural structure. a-e. The stages of construction as described in the text.

Note: now that the model has a branching structure, we would have to reduce the integration time step even further to run it successfully! The simulation would probably then be too slow to be useful.

Anatomy

At the moment the model has 6 nominally spherical compartments. A spherical compartment is suitable for a cell body, but not for a dendrite or axon - these should be cylindrical.

Note in the Setup view that N1 now displays as a horizontal rectangle, representing the cylinder.

All 6 compartments now show as horizontal rectangles. However, they are a bit small (and soon some will be smaller still), so it would be nice to enlarge the view.

The rectangles are now considerably larger in the Setup view. This is purely cosmetic - there is no change in the underlying model, just in the size at which structures are drawn in the view.

At this point the model could look like panel a in the figure below.

Compartments 5 and 6 are now drawn as vertical rectangles. They appear to be "dangling" from the compartmental connection drawn across their upper ends (panel b in the figure belowN5 and N6 were dragged slightly to activate snap-to-grid.). However, this is just a result of the way they are drawn - connections between adjacent compartments are always drawn between the ends of the respective rectangles that are geometrically closest in the Setup view. It is up to the model constructor to arrange the Setup view layout so that it gives an intuitive representation of the anatomy. (However, note that in terms of the calculation driving the simulation itself, the connection is from centre-to-centre of the linked compartments and the layout does not matter; see Implementation details.)

The layout now makes more sense (panel c in the layout below).

a
compartment warm-up
b
compartment warm-up
c
compartment warm-up
d
compartment warm-up
Converting spherical compartments into cylindrical compartments suitable for simulating a dendritic tree. a-d. The stages of conversion as described in the text.

At the moment the compartments in our dendritic tree model are all the same size (15 x 200 µm). However, in real neurons, more distal dendrites tend to taper as branching progresses, so let's introduce that into the model.

At this point the Setup view should look like panel d in the figure above.

A note on Setup view scaling: In compartmental models in Neurosim, dimensions in the Setup view scale with the square root of dimensions in the real (virtual) neuron. Thus a compartment with 20 µm diameter is actually 4x wider than one with 5 µm diameter, but will only appear 2x wider in the Setup view. This means that if one compartment is anatomically larger than another in the real neuron, it will always appear larger in the Setup view too, but not in direct proportion. This is a design decision taken in order to keep small objects visible and clickable in the same Setup view as large objects.

Also note that in the current version of Neurosim, cylindrical compartments can only be orientated vertically or horizontally, not obliquely.

The model is now anatomically more realistic than the previous version with spherical compartments. How does it run?

The simulation now runs more quickly (a result of the larger integration step size), and is still stable. You can experiment with even larger step sizes, to see what happens ...

For your convenience, compart warm-up finish is a pre-built version of the warm-up model at this stage.

Intracellular Resistivity (Ri)

With data showing in the Results view:

The increased internal resistance increases the voltage response in N1 (the compartment receiving the stimulus) because less of the injected current spreads internally into the adjacent compartment. In N2, the response is virtually unchanged because the reduced inflow of current from N1 is more-or-less balanced by a reduced outflow to N3 and N5. However, for the distal compartments N3-6 the voltage response is reduced because they receive less overall current. Effectively, the length constant of the dendritic tree has been reduced by the increased internal resistance, just as it would be for a linear uniform cable.

Compartment Size? Integration Step Size?

The simplifying assumption underlying all compartmental models is that individual compartments are isopotential - i.e. there is no voltage difference between different regions within a compartment. Obviously, this is never actually true, but the shorter the compartment, the closer it gets to being true. However, as we have seen, short compartments require small integration time steps for the calculation to remain stable, and, of course, they also require more compartments to represent a given anatomy, which means more calculations and slower simulations. So the aim is to make both the compartments and the integration time steps as large as possible without sacrificing too much accuracy. The question is, how large is that?

Sadly, the answer is largely heuristic. For integration step size, it is easy to reduce the step size and run the simulation again. If there is no significantI don't mean statistically significant, I just mean within an acceptable error range. difference in the output, then the original step size was suitable. If there is a significant difference, then repeatedly reduce the size until the difference becomes insignificant!

For compartment size, a commonly used rule-of-thumb is that they should be no longer than 10% of the space constant of an infinitely-long length of passive dendrite with the same the properties as the compartment. Thus if we assume a space constant of 5 mm (a fairly typicalBut be aware that the nominal space constant applies to DC signals, and that the effective space constant is shorter for high-frequency signals due to the low-pass filter characteristics due to membrane capacitance. value), then compartments should be shorter than 500 µm. Again, if you are concerned about the accuracy of the model, then the best that I can suggest is to reduce the compartmental size (thus increasing the number of compartments), and see if the output changes.

Finally, bear in mind that most models will contain at least some numerical parameters that are "guesstimates" rather than accurate values derived from experimental data. Small changes in these parameters may affect the model output at least as much as micro-fine-tuning the compartment sizes to increase apparent accuracy.

A Compartmental Model with Active and Passive Components

The second part of the walk-through is to build a model containing both active (i.e. spiking) and passive components. The spikes will be simple HH spikes, based on the squid giant axon.

Soma

First we need to get a neuron with HH spikes into a Network model. The easiest way is to copy one from the Advanced HH model.

You have now placed a single spherical neuron with 20 µm diameter and HH spike channels onto the clipboardIn this case the clipboard format is bespoke for Neurosim - the neuron can only be pasted into the Network or Advanced HH model in an instance of Neurosim itself.. This will form the soma in our new compartmental model.

We now have a neuron with HH channels in a Network model. This will become the soma in our compartmental model, but it is probably a good idea to test it to make sure everything works as expected.

You should see a single spike-like waveform in the N1 trace of the Results. This is encouraging, but the waveform looks very "chunky".

The spike waveform now looks more respectable! But the neuron in the Setup view is a bit too small for comfort.

These changes are cosmetic - they affect the layout in the Setup view, but do not affect the model itself. The changes will make things easier later.

If you want to check your progress, the parameter file compart 1 contains the model so far.

Now we will add an axon to the soma.

Axon

At this stage we have 7 separate neurons, each carrying HH channelsWhen you add new neurons in this way, they inherit the properties of the most recent neuron previously added to the circuit.. However, we want these to be compartments within a single neuron.

A connecting line is now drawn between the 7 yellow circles, indicating that they are now compartments within a single neuron. However, at the moment we have a neuron with 7 somata and no axon!

Note that the Compartment option box at the top-centre of the dialog is now checkedIt is checked automatically because the program detects that this "neuron" is actually linked as a compartment to other "neurons" (compartments)., which makes compartment-relevant options visible within the dialog. As it happens, the default values are all appropriate for the soma compartment (N1), but not for the putative axon (N2-7).

Now let's check whether our axon conducts.

The stimulus, which previously generated a spike in the soma when it was isolated, is now subthreshold. This is because the extra load of the axon acts as a current sink on the soma.

The soma should now generate a spike, which propagates along the axon.

At the stage the Setup and Results view should look like this:

a
compartment setup 1
b
compartment results 1
A compartmental model with soma and axon. a. The Setup view shows the soma at the top, and an axon extending downwards. b. The Results view with two sweeps superimposed. In sweep 1 a subthreshold stimulus applied to the soma (N1) fails to generates a spike. In sweep 2 a suprathreshold stimulus generates a spike which propagates along the axon to its terminal compartment (N7).

The parameter file compart 2 contains the model so far.

Dendrites

This duplicates the axonal N7 compartment as N8, but N8 is not linked into the compartmental structure, so it is not (yet) part of the neuron.

You should now have 6 new isolated cylindrical compartments, N9 - N14.

At the moment, the dendrites are all aligned vertically, and they appear to be linked at their top ends. In fact, compartments are always functionally linked centre-to-centre in terms of the calculation, but the links are drawn between the closest ends in the Setup view display.

We will need an even bigger stimulus than before, because the new passive dendrites increase the load on the soma.

At this point the Setup and Results display should look something like this (your Setup arrangement may differ from mine, but the Results should be the same):

a
compartment setup 2
b
compartment results 2
A compartmental model with active soma and axon, plus a passive two-branch dendritic arbor. a. The Setup view shows the spiking soma (N1) attached to a spiking axon (N2-N7) below, and a branching pair of non-spiking dendrites (N8-N11, N8-N14) above. b. A suprathreshold stimulus is applied to the soma.

Note that a spike is initiated in the soma (N1) and spreads by active conduction along the axon to its terminal (N7), but also back-propagates into the dendritic arbor through passive conduction, to produce a depolarizing potential at the distal dendrite tips (N11, N14).

The parameter file compart 3 contains the model so far.

Build Into a Circuit

We have now completed the compartmental model. It is very simple, but hopefully this walk-through demonstrates most of what is needed for building more complex models, if desired.

How can this model be incorporated into a circuit with other neurons?

The new neuron (N15) inherits the dendritic properties of the last compartment added, but we want it to be a standard single-compartment integrate-and-fire neuron.

We now have 3 stand-alone single-compartment integrate-and-fire neurons, N15, N16 and N17.

You should see slightly offset spikes in N15 and N16. These are integrate-and-fire neurons, so the spikes are actually just digital events with minimal duration - their appearance is basically cosmetic. However, these spikes will activate synapses, once we set them up.

This sets up excitatory (nicotinic ACh) synaptic input from N15 to the distal tip of one of the dendrites of the compartmental neuron.

N7 is a spiking compartment, where the spike is modelled with HH kinetics (it is not an integrate-and-fire type). By default, synaptic output from N7 is triggered when the membrane potential crosses a threshold value in the positive direction.

There is a barely-perceptible depolarization in the dendrite tip compartments (N11 and N14), and the compartmental neuron certainly does not spike. Clearly the synaptic input does not generate enough current to have a significant effect. We need a stronger synapse!

The two pre-synaptic neurons (N15, N16) spike, and produce EPSPs in the distal dendrite tips of the compartmental neuron (N14, N11). The depolarization spreads by passive conduction to the soma (N1), and there is sufficient temporal and spatial summation to depolarize the soma above threshold. The soma consequently spikes. The spike propagates to the end of the axon (N7), where it triggers synaptic output onto N17, which also spikes in response to the EPSP it receives from the axon output.

The spike in the soma also propagates by passive conduction out into the dendrites, where it produces a late depolarizing "backwash" on the falling phase of the EPSPs.

At this point the Setup and Results display should look something like this:

a
compartment setup 3
b
compartment results 3
Building a compartmental model into a network circuit. a. The Setup view shows the T-shape of the compartmental model neuron, plus 3 independent single-compartment neurons. Two neurons (N15 and N16) make excitatory synaptic input onto the distal tips of the two dendrites of the compartmental neuron (N11, N14), while the distal axon tip of the axon of the compartmental neuron (N7) makes excitatory synaptic output to the third neuron (N17). b. Depolarizing current pulse stimuli applied to the pre-synaptic neurons N15 and N16 induce them to spike. The consequent EPSPs in the post-synaptic compartmental neuron show both temporal and spatial summation, and induce a spike at the soma. The spike propagates to the tip of the axon, where it mediates synaptic input onto N17, which also spikes in response to its EPSP.

The parameter file compart 4 contains the finished model.

The importance of the post-synaptic summation can be demonstrated by removing one of the pre-synaptic inputs.

The stimulus to N16 is now subthreshold and the neuron does not spike. Consequently there is no EPSP in one of the dendrites and no summation. The remaining EPSP generated by N15 does not take the compartmental neuron above threshold, and consequently there is no spike in its axon, and no output to N17.

 

NEXT