Spike sorting pipeline
Spykeline is only supported by Windows 64-bit, a good RAM is advised, and a GPU is required depending on the sorter chosen.
- Install Anaconda
- Open Anaconda prompt
- Create a new environment with
conda create --name spykeline python=3.9
. - Activate it
conda activate spykeline
. - Install Git, you can download it here, you can check the installation, by running
git --version
from Anaconda prompt, or any terminal. - Clone Spykeline repository locally, you can follow instructions here.
- From the terminal, access the location of the cloned repository
cd /path/to/Spykeline
. - Install it
pip install .
. - Exit the folder
cd ..
.
The next 2 steps are optional as they depend on the sorter you choose to use (GPU/GPU or Docker/Docker). You can find a list of available sorters on the spikeinterface website. depending on the sorter you choose, you should check its GitHub repository for specific requirements.
- Optional: Install Docker
- Optional: Install the GPU requirements
Docker is used to run most sorters in a Virtual environment. If you don't have it yet installed, download it, and follow the installation instructions.
If not installed yet, install the NVIDIA driver corresponding to your GPU (here). To access GPU information from the terminal, use nvidia-smi
. You may also need to install the CUDA library, CUDA 12.1 recommended.
Install pyTorch pip install torch --index-url https://download.pytorch.org/whl/cu121
(torchvision and torchaudio were removed as there are not used here). More information here.
All input files needs to be in a single folder. Before launching Spykeline, it is necessary to prepare it properly. Here are presented all the needed files, with their related information. These files are the output of the recording device (Intan) and the Neuroscope software.
Out of all the output from intan, only 2 files are of importance here :
- The concatenated recording (.dat), either named as the folder (i.e. folder is RatXXX_XXXXXX then the recording shall be RatXXX_XXXXXX.dat) either with its default name (amplifier.dat).
- info.rhd: information about the recording design. This file is the same as long as the recording devices (probes + intan) aren't modified. Most likely, all recordings will have this same file for the same animal.
Neurscope allows you to group your channels according to your will, and once done, the configuration is saved in a .xml file (and .nrs file but not relevant here), and can be used for any other recording, as long as it has the same number of channel as the original one.
Spykeline uses this configuration to create a virtual probe or a channel map, which is required by most if not all sorters. This is a crucial step, as a badly defined probe would lead to a sorting with poorly defined units.
To well define this configuration, it is needed to group channels in both panels (see picture, blue and gold panels)
The blue panel is called Anatomical groups and is where it is expected to group channel per probe.
The gold panel is called Channels groups and is where it is expected to group channels per shank.
Note
This is the definition of these panels, in the end, the only need is that one is grouped per probe and the other per shanks, doesn't matter which
To launch Spykeline, open Anaconda prompt, activate the Spykeline's environment, then run the following :
> run_spykeline
This will be launching the GUI, shown below.
This is where the Spykeline's parameters are set, more information about the parameters here