yzhang511 / density_decoding

Density-based spike feature decoding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Density-Based Spike Sorting-Free Decoding

[Motivation] Neural decoding and its applications to brain computer interfaces (BCI) are essential for understanding the association between neural activity and behavior. A prerequisite for many decoding approaches is spike sorting, the assignment of action potentials (spikes) to individual neurons. Current spike sorting algorithms, however, can be inaccurate and do not properly model uncertainty of spike assignments, therefore discarding information that could potentially improve decoding performance.

[Spike-feature based decoding] Recent advances in high-density probes (e.g., Neuropixels) and computational methods now allow for extracting a rich set of spike features from unsorted data; these features can in turn be used to directly decode behavioral correlates:

[Method] We propose a spike sorting-free decoding method that directly models the distribution of extracted spike features using a mixture of Gaussians (MoG) encoding the uncertainty of spike assignments, without aiming to solve the spike clustering problem explicitly. We allow the mixing proportion of the MoG to change over time in response to the behavior and develop variational inference methods to fit the resulting model and to perform decoding:

[Full paper] Bypassing spike sorting: Density-based decoding using spike localization from dense multielectrode probes

(Back to top)

⏳ Installation

Create an environment and install this package and any other dependencies:

conda create --name density_decoding python=3.8
conda activate density_decoding
git clone https://github.com/yzhang511/density_decoding.git
cd density_decoding
pip install -e .

(Back to top)

⚡️ Quick Start

Example usage can be found in tutorials:

  1. data_preprocessing: Users can provide their own preprocessed spike features as decoder input. We also provide a tutorial for running the spike localization pipeline to extract high-resolution spatial features from Neuropixel probes. This notebook is under development ⚠️. For now, please refer to the legacy IBL pipeline or the current pipeline under development for documentation on spike feature extraction.

  2. decoding_pipeline: We demonstrate our decoding pipeline using custom datasets or IBL public datasets. For a custom dataset, user should provide their own spike features and behaviors as decoder inputs. For public IBL datasets, please download recordings directly through ONE API and follow the notebook data_preprocessing to obtain spike features.

  3. downstream_inference: We use IBL public datasets as demo to show how to perform standard analysis in the paper. This notebook is a break-down of our decoding pipeline.

(Back to top)

💻 CLI

density_decoding comes with a quick CLI decoding pipeline tool.

If you have preprocessed IBL spike features, here is an example usage:

python decode_ibl.py --pid dab512bd-a02d-4c1f-8dbc-9155a163efc0 
--ephys_path PATH_TO_SPIKE_FEATURES --out_path OUTPUT_PATH
--brain_region ca1 --behavior choice --align_time_type stimOn_times 
--t_before 0.5 --t_after 1.0 --n_t_bins 30

(Back to top)

🏛️ License

Distributed under the MIT License. See LICENSE.txt for more information.

(Back to top)

✏️ Cite Us

If you found the paper useful, please cite us:

@article{
  zhang2023bypassing,
  title={Bypassing spike sorting: Density-based decoding using spike localization from dense multielectrode probes},
  author={Zhang, Yizi and He, Tianxiao and Boussard, Julien and Windolf, Charlie and Winter, Olivier and Trautmann, Eric and Roth, Noam and Barrell, Hailey and Churchland, Mark M and Steinmetz, Nicholas A and others},
  journal={bioRxiv},
  year={2023},
}

(Back to top)

About

Density-based spike feature decoding

License:MIT License


Languages

Language:Jupyter Notebook 93.7%Language:Python 6.3%