Skip to content

mwblackburn/correlations_and_bursts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

correlations_and_bursts

Code style: black

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

  1. Detect burst events in spike trains
  2. Separate the detected "burst-train" from the whole spike train
  3. Assess the information held in burst-trains and non-burst-trains compared to the whole spike train

Organization

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.

Burst detection

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.

Tutorials

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

Installation

Spike train (and burst-train) analyisis

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.

Burst-train detection and separation

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.

  1. Download R and Rstudio using anaconda. DO NOT INSTALL ANY R PACKAGES YET

  2. Download rpy2 using anaconda

  3. 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

  1. 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:

RPY2 not finding package

Get and set directory path of installed packages in r

R documentation on package installation

Running R as an administrator

Import errors with robjects

Finally, the package refered to as "sjemea" is found here

Citations and References

Ellese Cotterill, Paul Charlesworth, Christopher W. Thomas, Ole
Paulsen, Stephen J. Eglen
J. Neurophysiol. (2016).

Link to Cotterill et al.

rpy2 Burst detection script written by Peter Ledochowitsch

Authors

Marcus Blackburn, advised by Gabriel K. Ocker, PhD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published