Skip to content

Roadmap

Adrien Peyrache edited this page Nov 5, 2021 · 9 revisions

Spirit

The Pynapple: a minimalist and versatile package for neuronal data analysis.

Analyzing data should be like telling a story. It should be easy to write and easy to read for anyone else. There shouldn't be any complicated piece of code to do standard and common things. We believe that the number of operations that are actually needed in neuronal data analysis is quite limited, and that any "high-level" processing can be built from a core of low-level functions.

First and foremost, we need object oriented programming.

The package is built around a "core" level of objects that represent time series, associated or not with data points (e.g. spike times or EEG) and time intervals (e.g. trials, brain states, time bins. It does not matter)

The package contains a set of wrappers to easily load and write data.

Last, the package contains a "process" (i.e. 2nd) analysis level: functions that are most commonly used, such as tuning curves and cross-correlation. But generic, and not project-specific.

History

It seems that everything started with A David Redish, during his postdoc time in Bruce McNaughton Lab (at the time In Tucson, Arizona). The TSToolbox was written in Matlab and the spirit was close to what it is today. Then, Francesco P. Battaglia greatly expanded the toolbox, still in Matlab. I (Adrien Peyrache) inherited the toolbox and have used it for more than a decade. It was somehow used by others at the Buzsaki Lab. Luke Sjulson made some big improvements and released the v2 of TSToolbox around 2017.

In parallel, Francesco P Battaglia developped neuroseries, a Python package that adopted the same formalism as the original TSToolbox, built on Pandas. Guillaume Viejo in the Peyrache Lab quickly adopted it, as well as all PhD students in the lab. It became clear that yet another development was needed. After several discussions, we decided to fork from the original neuroseries - which is still the core of the package - and create Pynapple.

The "core" level

Time series and intervals need to have a limited set of methods and attributes, such as rate, restrict (to an interval), realign (to times from another time series).

Specifically, here is a list of existing and planned attributes to the core objects:

Tsd class (for time stamped data)

This object contains data and associated times. Typically: EEG, position, etc.

Tsd.times(): return times

Tsd.data(): return data

Tsd.realign(tsd2): align times of Tsd to the times of Tsd2

Tsd.timeInterval() (TODO): the time interval support of the tsd.

Ts class

A children of the Tsd class, with no data. Think: spike times.

IntervalSet (is)

One or several non-overlapping time intervals. Think: trials, brain states, boundaries of particular physiological events (e.g. hippocampal ripples), etc.

is.tot_length(): return the total duration of the interval.

is.intersect(is2): restrict the intervalset to the intersection with is2 (an intervalset of a tuple of intervalsets)

is.union(is2): the union of is and is2.

The process level

The core level is, in fact, quite universal and could be used for many things outside neuroscience. What we need is a second level of analyzing functions that are commonly used in systems neuroscience: tuning curves, cross-correlations, etc. These functions are generic, and are called by user=defined functions. For example, someone who wants to compute place fields will create a script that will call the process level tuning2D with project-specific parameters (bin size, etc.) and will then apply various post-processing filters, such as smoothing.

tuning1D (TODO)

tc, occ = ap.tuning1D(ts,signal,is,bin)

returns the tuning curve tc and the occupancy map occ of the timeseries ts relative to 1-d feature signal, on intervalset is with binsize bin.

tuning2D (TODO)

tc, occ = ap.tuning2D(ts,signal,is,bin)

returns the tuning curve tc and the occupancy map occ of the timeseries ts relative to 2-d feature signal, on intervalset is with binsize bin.

CrossCorr (TODO)

MakeQfromS (TODO,do we keep this name??)

Returns the binned spike train matrix

The wrappers