Current prototyping activities towards NeuroML version 2.0
Developments towards NeuroML version 2.0 are well under way, but version 1.8.x should be considered the stable version for now, especially for application/model developers who want maximum compatibility with other tools.
For details of the meetings which have taken place to date where NeuroML v2.0 has been discussed see here.
Draft NeuroML v2alpha Schema
A draft specification for NeuroML v2alpha has been created. The working structure of NeuroML v2alpha is defined by a single XML Schema file: NeuroML_v2alpha.xsd.
Most of the work listed below aims to handle XML files valid according to this schema. This should be the target structure for anyone wishing to implement NeuroML 2 support at this stage.

This image shows some of the elements currently defined in NeuroML v2alpha. The overall structure is similar to NeuroML version 1.x Level 3 (see figures 4-6 here). Note that there are a greater range of cell models supported (e.g. Izhikevich spiking cell, adaptive exponential integrate & fire) in addition to the multicompartmental conductance based models which were a focus of version 1.x.
Examples of NeuroML 2 files using this schema are available here:
- A simple cell with morphology & segment groups
- A cell with biophysical properties (channel densities, passive electrical properties, etc.)
- A simple HH Na+ channel
- Some of the simplified spiking neuron models which are supported
- Some synapse models (single/double exponential conductances, NMDA-R synapse)
- A network of populations of cells in 3D
- A full NeuroML v2alpha network model description with cells, channels, populations and networks
| NeuroML v2.0 is being developed here. To obtain the
latest Schema document, all of the examples, Component definitions and libNeuroML check out the latest code from the
Subversion repository with: svn co https://neuroml.svn.sourceforge.net/svnroot/neuroml/NeuroML2 |
Development of LEMS & mapping to NeuroML 2
LEMS (Low Entropy Model Specification) is a new XML based language with interpreter developed by Robert Cannon for specifying generic models of dynamical systems. ComponentClass (ComponentType has also been used as a name for these, see below) elements which specify Parameters, StateVariables and their dynamical Behaviours can be defined as templates for model elements (e.g. HH ion channels, abstract cells, etc.). Components are instances of these with specific values of Parameters (e.g. HH squid axon Na+ channel, I&F cell with threshold -60mV, etc.).
A Java package, the LEMS Reference Implementation (LRI) which includes examples of LEMS files together with the interpreter for executing them is available here.
The current plans for usage of LEMS to specify NeuroML 2 models is as follows. A core set of ComponentClasses will be defined in LEMS (e.g. for networks, cells, channels, synapses and the dimensions/units allowed) which can serve as the basis for Component definitions in NeuroML 2 files, e.g. iafTauCell, izhikevichCell, ionChannelHH, etc. The behaviour of the model element (e.g. the behaviour of v in terms of threshold, reset, tau in a simple I&F cell) is specified in the ComponentClass, and the user only has to supply the name of the ComponentClass and give parameter values to create a Component in their NeuroML file.

This image shows the usage of LEMS ComponentClasses & Components in NeuroML
Note that specifying a Component does not imply that an instance of the model is created. Instances will only be instantiated when the cells are created in a population which is present in a network.
Using LEMS to specify the core of NeuroML version 2 has the following significant advantages:
|
NeuroML 2 XML files can be used standalone by applications in the same way as NeuroML v1.x, without using LEMS, easing the transition for v1.x compliant applications
Any NeuroML 2 ComponentClass can be extended and will be usable by any application (e.g. the LEMS Reference Implementation) which understands LEMS |
The first point above means that a parsing application does not have to natively read the LEMS type definition for, e.g. an izhikevichCell element, it just has to map the NeuroML element parameters onto its own object implementing that entity. The behaviour should be the same and should be tested against the reference LEMS implementation.
The second point above means that if an application does support LEMS, it can automatically parse (and generate code for) a wide range of NeuroML 2 cells, channels and synapses, including any new ComponentClass derived from these, without having to natively know anything about channels, cell models, etc.
libNeuroML
| libNeuroML = LEMS Reference Implementation + NeuroML 2 ComponentClass definitions + Import & export functionality |
libNeuroML is a package in Java which extends the basic LEMS Reference Implementation with a number of neuroscience specific features, most notably, it includes the core NeuroML 2 ComponentClass definitions. libNeuroML also features pluggable extensions for importing various model description formats into equivalent LEMS descriptions, and export modules for generating native scripts in various formats which can be used for more efficient simulations than the LRI.
Note: libNeuroML is currently different in scope to other libraries for programmatic access to modelling languages (e.g. libSBML, CellML API) as it is not intended just as an API to facilitate reading, validating, editing and writing models in a structured format. Integrated ability to execute of the models is a key feature of libNeuroML, and the API for editing is more aimed at manipulating LEMS entities (e.g. creating Component instances) rather than NeuroML entities (such as izhikevichCell). An integrated package for building, testing and executing models is essential at this stage of the development of NeuroML v2.0. Over time, as the core class names become stabilised, libNeuroML will develop into a true multi language API for manipulating these model classes, allowing also access to the underlying definitions.

libNeuroML and its relationship to the LEMS Reference Implementation, the NeuroML 2 ComponentClass definitions and the various import & export formats. Dashed line represent features in early stages of development.
Installing libNeuroML
The latest version of libNeuroML can be obtained from the Subversion repository:
svn co https://neuroml.svn.sourceforge.net/svnroot/neuroml/NeuroML2
cd NeuroML2
This can be compiled/executed (assuming you have Java installed) using the included make and nml2 utilities, e.g. (on Windows):
make.bat
nml2.bat examples\LEMS_NML2_Ex0_IaF.xml
Similarly on Mac/Linux:
./make.sh
./nml2 examples/LEMS_NML2_Ex0_IaF.xml
To allow the nml2 utility to be used from any directory, add an environment variable NML2_HOME, set to the install directory, and add this value also to your PATH.
If Apache Ant is installed, the options for compiling/running examples with this include:
ant (build the main jar file)
ant nml2_0, ant nml2_1, ... (run the main NeuroML 2/LEMS examples)
ant test (perform a number of tests including running all examples)
ant -p (list all ant options)
A number of examples are available showing the usage of NeuroML 2 elements, and these can all be loaded and executed by libNeuroML. Most of these examples mix LEMS elements and NeuroML 2 elements in a single file, but there is also an example of a LEMS simulation where a "pure" NeuroML 2 file is included for simulation by the LEMS interpreter.

This shows the behaviour of 2 instances of Izhikevich simple spiking neurons which were specified as Components in NeuroML v2alpha. The behaviour of the ComponentClass for the cell model is described in LEMS. See here for more details.
Installing Python API for LEMS/NeuroML 2
In addition to the Java package described above, an initial Python API for creating models in LEMS/NeuroML 2 has been developed. This is integrated with libNeuroML, allowing scripts to be written in Python to create a model, save it in XML and run it with the libNeuroML jar file.
To install Python API for LEMS/NeuroML 2, install libNeuroML as outlined above, followed by:
cd python
python setup.py install
On Linux/Mac the second command might need to be run as root. Scripts such as the example below can then be executed:
from libneuroml.lems import *
from libneuroml import *
lemsDocument = Lems()
comp = Component(NML2StdCompTypes.adExIaFCell, "burster", C="281pF", gL="30nS",
EL="-70.6mV", reset="-47.2mV", VT = "-50.4mV",
thresh = "-20.4mV", delT="2mV", tauw="40ms",
a ="4nS", b = "0.08nA", Iamp="0.8nA",
Idel="0ms", Idur="2000ms")
lemsDocument.addComponent(comp)
net = Network("Network1")
net.addPopulation(Population("pop1", comp.id, 1))
lemsDocument.addNetwork(net)
lemsDocument.genSimWithDefaultPlots(net.id, 250, 0.01)
lemsDocument.writeLemsAndRun("AdEx.xml")
This example is included (along with a number of others) and can be run (assuming the NML2_HOME environment variable pointing to the location of nml2 is set, and is added to PATH) using:
cd examples
python run_adex.py
to produce:

There is clearly a great deal of overlap with PyNN and this Python package will be updated for greater compatibility with that initiative. A Python API for handling v1.x NeuroML will also be produced, to facilitate interaction with that version, and to enable automatic conversion between versions.
Interaction with neuroConstruct
libNeuroML is incorporated into the latest version of neuroConstruct, allowing cell model in NeuroML v2alpha to be used in 3D network simulations. Get the latest version of the application from its Subversion repository, run the nCupdate script to pull the latest code from the NeuroML repository and open the project nCexamples/Ex10_NeuroML2/Ex10_NeuroML2.ncx for some working NeuroML v2.0 examples.
Compatability with other MLs: SBML, CellML, NineML & mappings to simulators
There are a number of other modelling language initiatives which have overlapping aims to NeuroML. One of the goals of NeuroML 2 is to avoid the temptation to be "one modelling language to build them all", but to acknowledge that these other languages exist with active communities, there are large model repositories of SBML & CellML models and corresponding tools available, and that many researchers will want to use these as components in computational neuroscience simulations with the minimum of effort.
SBML
There is a preliminary SBML export function from libNeuroML which generates an SBML file containing the model as defined in LEMS/NeuroML 2 Components/ComponentClasses. Try downloading libNeuroML and running:
ant testSBML
This export function requires more work, particularly related to the unit handling, but see here for a working example.
It should be possible to import a large class of SBML models into the LEMS framework to allow seamless use of SBML model elements beside NeuroML 2 elements for any simulator which understands LEMS. This is a work in progress using JSBML. To test this try:
ant testSBMLRead
CellML
Similar export/import options should be possible for CellML as SBML. Work is also in progress towards this.
NineML
NineML is being developed as part of the INCF Multiscale Modelling Program, and developments in LEMS and NeuroML 2 have benefitted from discussions within that forum.
libNeuroML can export files containing the equivalent NineML Abstraction Layer & User Layer entities (component/node/network) for a model read in in LEMS (with ComponentClass, Component, network, etc.). A limited number of LEMS examples can be exported in this format, try downloading the application and running:
ant testNineML
This export will be updated as the NineML language evolves.
| ComponentType was the original name for ComponentClass in LEMS (and the former is still used natively in the Java based LEMS Reference Implementation).
ComponentClass was adopted by both LEMS & NineML in early 2010, as an object with similar scope was being used in the NineML Abstraction Layer. This was with a view towards
low level compatibility between these parts of the two languages. Other element names were harmonised (e.g. Dynamics, TimeDerivative, and NineML adopted the LEMS Unit/Dimension conventions; see example here), but some inconsistencies remain. Many of these are due to NineML's current lack of support for extension and differences in handling the composition of components. These differences and future work towards greater compatibility between these formats will be discussed at the fourth NeuroML Development Workshop. |
NEURON
There is a basic export function implemented for many LEMS based abstract cell models to NEURON. Try downloading the application and running:
ant testNEURON
This shows 3 adaptive exponential integrate-and-fire model cells which have been specified in NeuroML 2 and run with the libNeuroML (left plots). The NEURON export function uses the LEMS ComponentClass definition to generate NMODL files for the cell behaviour and NEURON Python files to execute the network (right plots). See here for more details.
Object model for 3D hierarchical network generation
A package has been developed for prototyping ideas about specification of hierarchical network structures in NeuroML 2.
A network containing a 3x3 grid, each element of which is a subnetwork of 3 populations (2 laid out on regular 3D grids, and one randomly placed in a rectangular box above the others)
A Java package has been produced which can generate network descriptions in this form. The NeuroML 2 files produced are valid according to the NeuroML v2alpha Schema mentioned above.
This package does not yet interact with LEMS, but it is planned to harmonise the network descriptions used here with those LEMS uses to create networks
What's missing?
A summary of the holes & areas of current work in the current specifications...
- Network connection templates: more advanced options for defining connectivity between populations of cells is required. This is being worked on in LEMS and for NineML.
- Support for multi compartment modelling in LEMS: While the NeuroML v2alpha Schema supports description of multi compartmental conductance based neuronal models, the LEMS interpreter can only execute single compartment cell models at present.
- Better numerical integration in LEMS: At present the LEMS interpreter uses a simple forward Euler numerical integration method, limiting the size and speed of simulations.

