arbor-sim / arbor

The Arbor multi-compartment neural network simulation library.
https://arbor-sim.org
BSD 3-Clause "New" or "Revised" License
107 stars 60 forks source link

AEP: [NML2] Extend NeuroML Coverage #1621

Open thorstenhater opened 3 years ago

thorstenhater commented 3 years ago

Introduction

We are missing two major parts of the NeuroML (NML) specification that seems to be used heavily by our partners and would thus be a major selling point for Arbor

  1. Network descriptions
  2. Ion channel dynamics

As Arbor's way of describing network is still quite primitive, I propose to postpone 1. until we have a more solid understanding of the Arbor way.

However, 2. is a major pain point as the current route of getting NML mechanisms into Arbor is to use jNML to export the mechanisms to NMODL and compiling them through modcc into an Arbor catalogue. This neccessitates hand-editing of the output to adjust to Arbor-flavoured NMODL, which is also approximately an order of magnitude slower than hand-written NMODL. This further hindered by the readability of jNML's output and needs to be done every time an .nml file changes.

Therefore, we should have native support of NML mechanisms in Arbor. I propose to work in these stages:

  1. Parsing nml, selecting, and configuring mechanisms from a pre-built catalogue.
  2. Using jLEMS to compile LEMS to Arbor.
  3. Full LEMS support in Arbor.

This is made feasible due to the MechABI and might tie into ArbLang or its compiler in stage 3.

Update November 2021

After spending time with the NML2 specifications and building a prototype reader for .nml, we must discard option 1. from the list. It is simply not feasible due to the nature of NML. Example

    <ionChannelHH id="NaConductance" conductance="10pS" species="na">

        <gateHHrates id="m" instances="3">
            <forwardRate type="HHExpLinearRate" rate="1per_ms" midpoint="-40mV" scale="10mV"/>
            <reverseRate type="HHExpRate" rate="4per_ms" midpoint="-65mV" scale="-18mV"/>
        </gateHHrates>

        <gateHHrates id="h" instances="1">
            <forwardRate type="HHExpRate" rate="0.07per_ms" midpoint="-65mV" scale="-20mV"/>
            <reverseRate type="HHSigmoidRate" rate="1per_ms" midpoint="-35mV" scale="10mV"/>
        </gateHHrates>

    </ionChannelHH>

This ion channel can -- in principle -- have an arbitrary number of gateHHrates, each with a forward and a backward rate chosen from multiple implementations of baserate.

Traversing the implementation and building custom instantiations is the only viable path forward.

brenthuisman commented 2 years ago

Some sources for nml files:

brenthuisman commented 2 years ago

Invite users to use this by v0.8.

thorstenhater commented 1 year ago

This is not at the level of polish it needs for 0.8, @llandsmeer and me are still making nmlcc ready for release.