-
Notifications
You must be signed in to change notification settings - Fork 61
Running AllenSDK models on Arbor
This is a very quick summary of the steps taken which can be skipped for the technical details below.
In the beginning, all .mod files were cleaned and ported to arbor, for
details see below. In the running setup, arbor and allesdk produced
completely different results. We then stripped the model down to a
single CV soma and tested all mechanisms individually and in
combination. After some trivial fixes it became apparent that the
nernst
mechanism for concentration equilibria was needed. Neuron
automatically enables it following some opaque logic.
From there, the morphology was extended until it achieved the original complexity. At this stage different outputs were observed still. After reviewing the allensdk source, we decided to remove its handling of the axon and hard code its effect --- as we understand it --- into the morphology (see below under allensdk/patching).
Finally, identical outputs were obtained, although they differ from the allen DB references. The geometry of the axon has significant impact on the observed dynamics.
Concurrently with this effort spherical somata were removed from arbor and replaced by cylindrical segments with the same surface area (actually tubes, caps do not contribute to area here) which is close to neuron's behaviour.
The morphology is divided into 4 non-overlapping regions that are
derived from the swc structure identifier field. Not all mechanisms are
available on every region. The distribution of mechanisms over the
regions in the table below is implicitly derived from the
(region,mechanism,parameter)
tuples specified in the JSON fit inputs.
soma axon apic dend
pas X X X X
CaDynamics X X
CaHVA X X
CaLVA X X
Ih X X X
Imv2 X X
KT X
Kd X
Kv2like X
Kv31 X X X X
NaV X X X X
SK X X
- added support for
FROM ... TO ...
- added support for units in argument lists
- allow 'magic' variables, eg
v
to be accessed inLINEAR
- remove errors, ie writing to
v
,ica
, etc - remove mistaken declarations, eg
RANGE v
- adjust to
modcc
- pass
v
,celsius
, ... toPROCEDURES
- pass
- replace
vtrap
withexprelr
- inline
PROCEDURES
and convert variables toLOCAL
- saves signigicant amounts of memory traffic
- exposes more optimisation opportunities to the backend (C++) compiler
- extract common sub-expressions and invariants
- best of three wallclock time
- MacBook pro 13" 2018 i5
- Neuron: 117-128s
Version Runtime/s
Baseline 70
Vectorised 21
CaLVA 21
CaHVA 20
Ih 19
NaV 15
SK 15
CaDynamics 14
Kv31 14
Imv2 14
Kd 14
KT 14
Kv2like 13
This is obsolete abd the naster branch can be used.
git clone <https://github.com/thorstenhater/arbor.git> --branch
nmodl/allen cd arbor mkdir build cd build ccmake ..
make install
pip install neuron
pip install allensdk
- Remove axon manipulation
- seems wrong / different from the docs/comments, AllenSDK does
one of two things to axon[0]:
- 'truncated' truncates the axon[0] found in the swx morphology file to 60um length.
- 'stub' replaces axon[0] with 60um diameter and 1um radius (cylindrical) axon.
- Option 1.
- Edit
allensdk/model/biophysical/utils.py
- Comment out ll. 363--383
- Edit
- Option 2.
- Edit
model-nrn.py
- Change 'truncated' to 'stub' on ll. 122
- Edit
- seems wrong / different from the docs/comments, AllenSDK does
one of two things to axon[0]:
git clone <https://github.com/thorstenhater/allen-models.git> cd
allen-models cd model-491766131 nrnivmodl modfiles python model-nrn.py
manifest.json
-
dynamics and geometry can be swapped via symbolic links
dynamics :
491766131_fit.json
all mechanisms : `full-dyn.json` only passive : `pas-only.json`
geometry :
Rbp4-Cre_KL100_Ai14-203503.04.01.01_527109145_m.swc
original w/ stub axon : `full.swc` original w/o axon : `full-no-axon.swc` spherical soma : `single-cv.swc` cylindrical soma : `single-section.swc` test geometry : `simple.swc`
Does not correspond (4 spikes vs. 5), due to modified axon in NRN but not Arbor.
Corresponds (nearly), due to unmodified axon in both NRN and Arbor.
These comparisons are meant to corroborate the AllenSDK axon modifications.
Agrees nearly, AllenSDK truncated to 60um but that should not matter because the axon is already 60um long. Contrary to what the comments in the AllenSDK code claim, it seems in trunctation mode it actually replaces the axon as well, and replaces it with a cone with diameters equal to the first and last diameter encountered in the original axon.
Agreement due to AllenSDK not truncating.
Disagreement due to AllenSDK replacing with a 1um radius axon. The radius seems to have a great effect.
Agreement.
Agreement.
Near agreement.