Neuron

NEURON

NEURON simulation environment is used in classrooms and laboratories around the world for building and using computational models of neurons and networks of neurons. It is particularly well-suited to problems that are closely linked to experimental data, especially those that involve cells with complex anatomical and biophysical properties.

Important Notes

Installed Versions

All the available versions of Neuron for use can be viewed by issuing the following command. This applies for other applications as well.

module avail neuron

output:

---------------------- /usr/local/share/modulefiles -------------------------

neuron/7.4

The default version is identified by "(default)" behind the module name and can be loaded as:

module load neuron

The other versions of NEURON can be loaded as:

module load neuron/<version>

Running NEURON Jobs

Interactive Job

Request a compute node by typing:

srun --x11 --pty /bin/bash

This will assign you one of the compute nodes.

Load the Neuron module:

module load neuron

Copy the file sthA.hoc below in your home directory. You can also copy all sample files from /usr/local/doc/NEURON/sample and cd to it.

cp -r /usr/local/doc/NEURON/sample .

cp sample

stA.hoc:

create soma

access soma

soma nseg = 1

soma diam = 18.8

soma L = 18.8

soma Ra = 123.0

soma insert hh

objectvar stim

stim = new IClamp(0.5)

stim.del = 100

stim.dur = 100

stim.amp = 0.1

tstop = 300

 Run Neuron:

nrngui sthA.hoc

This will open the Menu bar with Menus like File, Edit, Build, Tools etc as shown in Fig below. If an error opening the *.hoc occurs, load the sthA.hoc manually from the File menu (load hoc). Follow the procedure below:

Batch Job

SERIAL BATCH JOB:

Submit the serial job:

sbatch job-serial.slurm

output: Neuron_Serial.o<jobid>

NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21

Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015

See http://www.neuron.yale.edu/neuron/credits

I am 0 of 1

PARALLEL BATCH JOB:

Submit the parallel job:

sbatch job-parallel.slurm

output: test.o<jobid>

numprocs=12

NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21

Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015

See http://www.neuron.yale.edu/neuron/credits

I am 0 of 12

I am 1 of 12

I am 2 of 12

I am 3 of 12

I am 4 of 12

I am 5 of 12

I am 6 of 12

I am 7 of 12

I am 8 of 12

I am 9 of 12

I am 10 of 12

I am 11 of 12

Neuron Python

Important Notes: 

If you are submitting as a batch job, you need to disable the display by using the command "unset DISPLAY" in your batch script. 

Also, if you are running MPI version of python code with "from neuron import h", please add the final line "h.quit()" to initiate a clean shutdown on MPI

Installation

We recommend you to use python virtual environment for which the details are here

Request a node (visual access with X-Forwarding)

srun --x11 --mem=8gb --pty bash

Load appropriate python module

module swap intel gcc

module load python/3.6.6

Create python virtual environment

python3 -m venv --system-site-packages p3venv

Source virtual environment

source p3venv/bin/activate

Install neuron package

pip3 install --upgrade pip

pip3 install neuron

Run


The example demonstrates interactive mode but batch job submission is recommended.


Execute python command

python3


Import neuron package and continue following the instructions at  Scripting Neuron Python Basics and we can plot the simulation results using matplotlib (see Fig. 1)

>>> import neuron

...

Fig. 1 Plotting the neuron simulation result using matplotlib package