Skip to content

LiuLab-Bioelectronics-Harvard/SpikeStability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracking neural activity from the same cells during the entire adult life of mice

Overview

This repository contains a python package written along with the manuscript from Zhao, Tang, Tian, Partarrieu et al. "Tracking neural activity from the same cells during the entire adult life of mice". It was developped in order to make a standalone package being able to do the various steps of the neural signal analysis. The ultimate goal is to make consistency/stability analysis of long-term neural recordings easier and more accessible. As this is adapted to a specific type of BMI technology, there are necessarily functions and parts of the package that might not generalize so well to your data. This repository contains software, data and analysis scripts used in the article.

Installation

Before any of the following, make sure you have a working installation of python. If you're starting from scratch, the easiest will probably be to download the Anaconda toolkit which will also download what you need to be able to run the notebooks and the anaconda command prompt which may be useful in running some of the commands below.

Option 1

For use of the latest version deployed here on github, I highly recommend using a python virtual environment in which case you may run (make sure you've changed the .yml file appropriately):

git clone https://github.com/LiuLab-Bioelectronics-Harvard/SpikeStability
cd SpikeStability
conda env create -f environment.yml

If you want to be able to use this environment with the jupyter-notebooks you'll need to run the command (once you've activated the environment)

python -m ipykernel install --user --name=your_env_name_here

Option 2

You can always create your own environment, activate it and then run

pip install -r requirements.txt

Package structure

This package is divided into several main submodules, each performing some clear task: import, cluster, preprocessing and quality.

preprocessing

Contains a few preprocessing functions for basic quality control of the recordings: removing artifacts from the signal, ensuring spike alignment, ...

cluster

This has various clustering methods used to differentiate neurons (spike sorting) given the extracted waveforms, timestamps and dates of your neural recordings. The main algorithm featured here is wavemap (basically UMAP and leiden clustering on spike waveforms). Users may pass their own cluster labels obtained with their favorite spike sorting algorithm to the functions in the stability sub-module.

stability

The heart of this repository. This contains multiple methods allowing the user to perform consistency analysis given spikes, dates, timestamps and cluster labels.

The consistency analysis is composed of multiple different scripts and functions. These contain:

  • Dimensionality reduction over recording days
  • Features computed from spike waveforms analysed over time
  • ISI distribution profiles analyzed over time
  • Waveform auto and cross-correlation analysis
  • Cluster quality metrics such as L-ratio, silhouette score and others computed over time

util

Miscellaneous utility functions.

Other information

Citation

If SpikeStability has been useful for your work:

Siyuan Zhao, Xin Tang, Weiwen Tian, Sebastian Partarrieu, Shiqi Guo, Ren Liu, Jaeyong Lee, Zuwan Lin, Jia Liu bioRxiv 2021.10.29.466524; doi: https://doi.org/10.1101/2021.10.29.466524

Contact

Feel free to open an issue on the github and we'll respond as quickly as possible.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages