Author Archives: Svenn-Arne Dragly

Svenn-Arne Dragly

About Svenn-Arne Dragly

PhD student in computational neuroscience. My thesis working title is Predicting electrical potentials (EEG) and magnetic fields (MEG) in humans from reconstructed human nerve cells. In addition, I simulate microscopy images and develop data management and visualization tools for our lab. My supervisors are Gaute Einevoll and Anders Malthe-Sørenssen. I hold a master’s degree in physics and a bachelor’s in materials science and nanotechnology.

Getting started with HybridLFPy

This is a current* guide to getting HybridLFPy up and running on Ubuntu 14.04.

HybridLFPy combines some research-grade packages that are in active development. We therefore have to apply a combination of techniques to install compatible versions of each package. The packages that needs to be installed are

  • NEST
  • Neuron
  • LFPy
  • NeuroTools

Some of these will be installed using pip, some using setup.py and some using .deb packages. For the pip and setup.py packages, it will be a good idea to contain these in virtual environment to avoid contaminating the entire Python installation. To do this, we start out by installing virtualenvwrapper:

sudo apt-get install virtualenvwrapper

Restart your terminal and run the following command to create a virtual environment for our LFPy installation. It will use the system’s Python packages for anything else, for instance matplotlib, numpy, etc.:

mkvirtualenv lfpy --system-site-packages

To start using the new virtual environment, use the workon command:

workon lfpy

Installing NEST

We will install NEST from source. Go to the NEST website and download the most recent stable version. As of this writing, version 2.6.0 is the most recent.

After downloading, unpack NEST and while still in the lfpy virtual environment, run

./configure --prefix=$HOME/opt/nest

Then make and make install:

make -j 4
make install

NEST does not add its Python packages to PYTHONPATH. Do this manually by adding the following to your ~/.bashrc file (~ means your home folder, i.e. /home/yourusername/.bashrc):

export PYTHONPATH=$HOME/opt/nest/lib/python2.7/site-packages/:$PYTHONPATH

You now need to reload the .bashrc file by running the following command:

source ~/.bashrc

To test that the installation works, open a python interpreter, still in the lfpy virtual environment, and try to import nest:

python
import nest

If you don’t receive any error messages, NEST has been installed. Note that NEST now is installed only in the lfpy virtual environment. This means that you won’t have access to it if you don’t run workon lfpy  first.

Installing Neuron

Neuron can be installed from the NEURON website. However, as of this writing, we need to use the alpha version of NEURON 7.3. This can be found from the alpha packages listing on NEURONs website.

Download the file nrn-7.3.rel-1173+.x86_64.deb.

Double click the file to open Ubuntu Software Center and install the package. Note that you will be receiving an error message about the package being broken. Ignore this and continue the installation.

NEURON does not add its Python packages to PYTHONPATH. Do this manually by adding the following to your ~/.bashrc file:

export PYTHONPATH=/usr/local/nrn/lib/python/:$PYTHONPATH

You now need to reload the .bashrc file by running the following command:

source ~/.bashrc

To test that the installation works, open a python interpreter and try to import neuron:

python
import neuron

If you don’t receive any error messages, NEURON has been installed.

Installing LFPy

LFPy most easily installed through pip. Open the lfpy virtual environment if you have not done so already:

workon lfpy

Once in the lfpy shell, run pip to install the lfpy package:

pip install lfpy

To test that the installation works, open a python interpreter and try to import LFPy (remember that the package name is case-sensitive):

python
import LFPy

If you don’t receive any error messages, LFPy has been installed.

Installing NeuroTools

Again, we will use pip for installation. Run the following command to install NeuroTools:

pip install neurotools

To test that the installation works, open a python interpreter and try to import NeuroTools (remember that the package name is case-sensitive):

python
import NeuroTools

If you don’t receive any error messages, NeuroTools has been installed.

Installing mpi4py

mpi4py is easily installed using apt-get:

sudo apt-get install python-mpi4py

Installing HybridLFPy

HybridLFPy is not yet in any package repository. We therefore need to clone HybridLFPy from GitHub directly:

git clone https://github.com/espenhgn/hybridLFPy.git

Once cloned. Try running the basic example:

export PYTHONPATH=..:$PYTHONPATH
cd hybridLFPy/examples
python examples/example_brunel.py

This will take a long time to run, but once finished a few windows with plots showing the results of the simulation will show.

Troubleshooting

Segmentation faults

If you get a segmentation fault, similar to the one below, you are likely using the wrong version of Neuron for LFPy:

[stan:17420] *** Process received signal ***
[stan:17420] Signal: Segmentation fault (11)
[stan:17420] Signal code: Address not mapped (1)
[stan:17420] Failing at address: 0x44000098
[stan:17420] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f8bd78bc340]
[stan:17420] [ 1] /usr/lib/libmpi.so.1(PMPI_Comm_dup+0x4e) [0x7f8bcc04477e]
[stan:17420] [ 2] /usr/local/nrn/x86_64/lib/libnrnmpi.so(f_nrnmpi_init+0xe9) [0x7f8bb72dba49]
[stan:17420] [ 3] /usr/local/nrn/lib/python/neuron/hoc.so(inithoc+0x1a0) [0x7f8bb96d8ec0]
[stan:17420] [ 4] python(_PyImport_LoadDynamicModule+0x9b) [0x4268bc]
...

Try to install a different version of NEURON. As of this writing, the needed version gives the following output upon importing the neuron package in Python:

NEURON -- Release 7.3 (1173+:c2415b59f252+) 2014-10-07

*This guide may be obsolete if you’re reading it some time after it was posted.

Koen awarded ERC starting grant

Our very own Koen Vervaeke was awarded an ERC starting grant today. This is fantastic news and will open up for establishing a whole team of researchers.

Congratulations!

The title of the project is “The role of 5HT3a inhibitory interneurons in sensory processing”.

About the starting grants from the ERC website: “ERC Starting Grants aim to support up-and-coming research leaders who are about to establish a proper research team and to start conducting independent research in Europe. The scheme targets promising researchers who have the proven potential of becoming independent research leaders. It will support the creation of excellent new research teams.”

National education price awarded to CINPLA member

Professor Anders-Malthe Sørenssen was awarded the annual Olav Thon Foundation price for outstanding education. The price was awarded for his work on modernizing the physics education at the University of Oslo. He has increased the use of computational methods and challenged undergraduate students with current research problems.

Read the announcment from the Olav Thon Foundation. More information from the Department of Physics and the dean’s blog.