Skip to main content

thorns and waves

__|________|_____|_|_|___|_____|____||_____|_____|_____|____|_____|___||______
_|_______________________|______|_________|_______|_____|____|__|________|_|__
_____|___|__|_____|_______|____|_________________________|__|_________|_______
___|_______|_____|______|_____|_______|__|___|________|______|___|____________
__|__|_______|_____|__|___|______|________|______|______|_____|_______THORNS__

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.

Usage

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:

th.plot_raster(spike_trains)
th.show()

Generate and plot AM tone:

import thorns.waves as wv

sound = wv.amplitude_modulated_tone(
    fs=48e3,
    fm=100,
    fc=1e3,
    m=0.7,
    duration=0.1,
)

wv.plot_signal(sound, fs=48e3)

wv.show()

You can also browse the API documentation at https://pythonhosted.org/thorns/

Features

  • 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: thorns.util.map()

  • Dumpdb: quickly dump map()’s results in one script and load from another one: thorns.util.dumpdb(), thorns.util.loaddb()

  • Pure Python

Installation

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

Contribute

License

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

Metadata

Release files for thorns 1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thorns 1
File Size Uploaded
thorns-1.tar.gz 129.2 kB Details

Release files / thorns-1.tar.gz

Download URL thorns-1.tar.gz
Size 129.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1d89ab36408a7f3787ce6b785952cfb76860e53512d69244b450811c0e217a4a
BLAKE2b-256 checksum
How to use checksums
2d707e5b08c69840340a2f90c6d983d8acee5335696958b7a4fbcef152135a4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

Release history Release notifications | RSS feed

This release

1 This release

1 release file

0.10

1 release file

0.9

1 release file

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3.1

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page