There are a number of repositories in active development under GitHub for handling NeuroML and LEMS with Java. To make it easier to access all of this functionality, we've created a single package, jNeuroML, which allows access to most of this functionality through a simple command line interface and requires minimal installation.
- Validate NeuroML v1.8.1 and v2.x files
- Simulate most NeuroML 2 models (simulation should be specified in Simulation element in LEMS file)
- Export NeuroML 2 and LEMS to many formats such as Neuron, Brian, Matlab, etc.
- Import other languages into LEMS (e.g. SBML)
To get a precompiled binary for jNeuroML, go to https://github.com/NeuroML/jNeuroML/releases, download the latest jNeuroML.zip file and you have everything you need. Unzip on your local machine and go into the jNeuroMLJar directory.
You can also check out the most recent verson of the jar file using:
svn checkout svn://svn.code.sf.net/p/neuroml/code/jNeuroMLJar cd jNeuroMLJar
Typing ./jnml (or jnml.bat on Windows) will list the options available. Some of the current options include:
./jnml -validate MyNeuroML.nml (validate NeuroML 2 document against the current schema) ./jnml -validatev1 MyNeuroML1.xml (validate NeuroML v1 document against the v1.8.1 schema) ./jnml MyLEMS.xml (parse & simulate a LEMS model using jLEMS) ./jnml MyLEMS.xml -graph (generate png of structure of LEMS model using GraphViz) ./jnml MyLEMS.xml -neuron (generate code to run on the NEURON simulator)
Adding the environment variable JNML_HOME, pointing to the jNeuroML folder, as well as adding this path to the PATH variable will let you use the jnml utility from any folder.
Getting the source for jNeuroML
If you prefer to clone all of the individual repositories and build the jNeuroML application yourself, use the getNeuroML.py utility in the jNeuroML repo:
git clone git://github.com/NeuroML/jNeuroML.git neuroml_dev/jNeuroML cd neuroml_dev/jNeuroML python getNeuroML.py
This will clone ~11 repos for NML2 & LEMS (including Python based libraries) into neuroml_dev/ and compile the Java based ones using Maven (download here or use package managers for Linux (e.g. apt-get install maven) or Mac (brew install maven)). The full process may take 5-10 mins on first installation, but subsequently running:
git pull python getNeuroML.py
in the jNeuroML folder will get the stable version of each repo & compile using Maven if necessary.
To access the very latest version (the development branches of the GitHub repos) use:
python getNeuroML.py clean python getNeuroML.py development
Use of Maven is a great way to manage versions of applications being developed in distributed repositories, and will make it easy to use selected parts of this for different Java applications. For example, these packages will be used in various ways to provide NeuroML/LEMS support in neuroConstruct and for handling NeuroML on the Open Source Brain website.
If you prefer using/installing/coding in Python, try out pyNeuroML. Much of the functionality of jNeuroML is bundled inside pyNeuroML and can be accessed with a command line utility (pynml) with similar usage as jnml.
This code is distributed under the terms of the GNU Lesser General Public License.