Skip to main content

Spike analysis software

Project description


With thorns you can analyze and display spike trains generated by neurons. It can be useful for the analysis of experimental and simulation data using Python. For example, you can easily calculate peristimulus time histogram (PSTH), interspike time histogram (ISIH), vector strength (VS), entrainment and visualize action potentials with raster plot.

waves is a submodule with some useful signal processing and generation functions, e.g. generate ramped tone, amplitude modulation tone, FFT filter, set level (dB_SPL).

The software was originally developed during my PhD in the group of Werner Hemmert at the TUM. It is oriented towards auditory research, but it could be easily extended.


Don’t forget to check our IPython Notebook DEMO and scripts in the examples directory!

Initialize and load spike trains:

import thorns as th
from thorns.datasets import load_anf_zilany2014

spike_trains = load_anf_zilany2014()

Calculate vector strength:

th.vector_strength(spike_trains, freq=1000)

Raster plot:


Generate and plot AM tone:

import thorns.waves as wv

sound = wv.amplitude_modulated_tone(

wv.plot_signal(sound, fs=48e3)

You can also browse the API documentation at


  • Analyzes and displays spike trains
  • Uses pandas.DataFrame as the main data container (spike trains, results)
  • Handy signal processing and generating functions: thorns.waves
  • Map implementation with various backend (also parallel) and caching:
  • Dumpdb: quickly dump map()’s results in one script and load from another one: thorns.util.dumpdb(), thorns.util.loaddb()
  • Pure Python


In order to use thorns, you’ll need to install the following dependencies first:

  • Python (2.7)
  • Numpy
  • Scipy
  • Pandas
  • PyTables / tables
  • Matplotlib
  • py-notify (optional, enables notifications)

Next, type in your command line:

pip install thorns



The project is licensed under the GNU General Public License v3 or later (GPLv3+).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for thorns, version 1
Filename, size File type Python version Upload date Hashes
Filename, size thorns-1.tar.gz (129.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page