Skip to main content

PYthon Neural Analysis Package Pour Laboratoires d’Excellence

Project description

pic1

image GitHub contributors GitHub issues Twitter Follow

PYthon Neural Analysis Package.

pynapple is a light-weight python library for neurophysiological data analysis. The goal is to offer a versatile set of tools to study typical data in the field, i.e. time series (spike times, behavioral events, etc.) and time intervals (trials, brain states, etc.). It also provides users with generic functions for neuroscience such as tuning curves and cross-correlograms.


Getting Started

Installation

pynapple can be installed with pip:

$ pip install pynapple

or directly from the source code:

$ # clone the repository
$ git clone https://github.com/PeyracheLab/pynapple.git
$ cd pynapple
$ # Install in editable mode with `-e` or, equivalently, `--editable`
$ pip install -e .

This procedure will install all the dependencies including

  • Python 3.6+
  • Pandas
  • numpy
  • scipy
  • numba
  • pynwb 2.0
  • tabulate
  • pyqt5
  • pyqtgraph
  • h5py

Basic Usage

After installation, the package can imported:

$ python
>>> import pynapple as nap

An example of the package can be seen below. The exemple data can be found here.

import numpy as np
import pandas as pd
import pynapple as nap
from matplotlib.pyplot import *

data_directory = '/your/path/to/A2929-200711'

# LOADING DATA
data = nap.load_session(data_directory, 'neurosuite')


spikes = data.spikes
position = data.position
wake_ep = data.epochs['wake']

# COMPUTING TUNING CURVES
tuning_curves = nap.compute_1d_tuning_curves(group = spikes, 
                                            feature = position['ry'], 
                                            ep = position['ry'].time_support, 
                                            nb_bins = 120,  
                                            minmax=(0, 2*np.pi) )
                                                

        
# PLOT
figure()
for i in spikes:
    subplot(6,7,i+1, projection = 'polar')
    plot(tuning_curves[i])
    

show()

Credits

Special thanks to Francesco P. Battaglia (https://github.com/fpbattaglia) for the development of the original TSToolbox (https://github.com/PeyracheLab/TStoolbox) and neuroseries (https://github.com/NeuroNetMem/neuroseries) packages, the latter constituting the core of pynapple.

This package was developped by Guillaume Viejo (https://github.com/gviejo) and other members of the Peyrache Lab.

Logo: Sofia Skromne Carrasco, 2021.

Project details


Download files

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

Source Distribution

pynapple-0.2.2.tar.gz (14.4 MB view hashes)

Uploaded Source

Built Distribution

pynapple-0.2.2-py2.py3-none-any.whl (86.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page