The AllenSDK is a software package meant to process and analyze data in the Allen Brain Atlas. This project specifically handles the data from the Neuropixels project. The AllenSDK package provides powerful tools to navigate the data, but does not have tools to detect burst events in spike trains. Therefore, this package provides tools to
- Detect burst events in spike trains
- Separate the detected "burst-train" from the whole spike train
- Assess the information held in burst-trains and non-burst-trains compared to the whole spike train
The package is organized around the SessionProcessor
object. SessionProcessor
is the primary tool for training and assessing Scikit-learn compatible decoders (using whole spike trains, burst-trains, and non-burst-trains) and assessing correlations between neuronal activity and decoder weights.
SessionNavigator
provides tools for finding Neuropixels sessions with specific experiment criteria.
SessionProcessor
does not find or isolate activity bursts itself. To isolate burst-trains, use the burst detection script provided. The outputs of the script are direct inputs for SessionProcessor
.
Script controlling tutorial file paths
Tutorial for using the package without incorperating burst analysis
Tutorial for using the package with burst trains
Example showing detected bursts
Example comparison between decoding accuracy of burst-trains and whole-trains
Example of noise correlation analysis between burst-trains and whole-trains
Installing and running the .py (burst analysis) components of this package should be as simple as downloading the package and creating an anaconda environment from the provided .yml file.
To integrate the burst detection code, you need R with some pretty specific packages, and rpy2 (2.9.5). This can be finicky, and it may take some work to get rpy2 to function properly with R.
-
Download R and Rstudio using anaconda. DO NOT INSTALL ANY R PACKAGES YET
-
In python, run:
>>> import rpy2.rinterface
>>> from rpy2.robjects.packages import importr
>>> base = importr('base')
>>> print(base._libPaths())
Only one path should show up, note it. I will refer to this path as PATH
- Open Rstudio as an administrator and run the commands in r_admin_setup_instructions.txt.
The first command is .libPaths(). That should return multiple paths, including
PATH
. Then run the command .libPaths(PATH
). That will set the package installation library to the same library that python is looking in, allowing you to install the packages needed in R to run the burst detection algorithms.
Useful links for additional help:
Get and set directory path of installed packages in r
R documentation on package installation
Finally, the package refered to as "sjemea" is found here
Ellese Cotterill, Paul Charlesworth, Christopher W. Thomas, Ole
Paulsen, Stephen J. Eglen
J. Neurophysiol. (2016).
rpy2 Burst detection script written by Peter Ledochowitsch
Marcus Blackburn, advised by Gabriel K. Ocker, PhD