Skip to content

SpikeGLX DataExport Guide

Li Alex Zhang edited this page Nov 30, 2021 · 31 revisions

Electrophysiology data can be recorded from Neuropixels by SpikeGLX. Essentially voltage traces would be amplified, filtered, digitized and saved in binary files. SpikeGLX saves two filtered data streams, one for spikes and the other for local filed potentials. Each stream will be saved in one binary file with an accompany meta file.

Usually, the experimental data will be saved in a separate file. For example, the Experica Command will save all experiment related data in a Yaml file. In DataExport, choosing Yaml files and SpikeGLX format will collect all data from Yaml file and corresponding binary and meta files.

DataExport also performs data cleaning and preprocessing, so that all the relevant information has been well organized for further data analysis. The customizable metadata are also collected and inserted in a metadata table where it usually located at the root directory for exported data.

Checking bad channels

Deficiency of some electrodes would generate invalid data, finding these channels would be helpful for data cleaning and preprocessing. The bad channels can be examined and its IDs saved in a NeuropixelsProbeInfo.yaml file which will be looked for in the exporting process. Note that channel badness may be different for AP and LF streams, e.g. electrodes out of brain tissues may not be considered bad for local field potentials, but may introduce noise or false signal for spike sorting.

Spike Sorting

Spikes can be extracted when exporting, and for all the experimental tests from a stable probe site, spiking unit ids would be better assigned consistently. For Kilosort, it could be achieved by concatenate binary files in timely order to one file, do spike sorting on it, and split spikes back to each tests. In DataExport, select multiple tests and enable concat will do all the steps above. Global Demuxed CAR will also be applied before writing to the concatenated file. Sorting result will also be saved in a folder for Phy manual checking.

Finalize Sorting Result

For now, no algorithms are good enough for fully automatic spike sorting, so we have to manually check the sorting result. Mostly, low firing rate, e.g. ~0.5 spikes/s, low spike amplitude, impossible spike shape, abnormal spatial spread and double counted unit would be regarded as noise. Unit with refractory period > 1ms will be considered as single-unit, otherwise as multi-unit. When final result is saved in Phy folder, we could select the Phy folder as the data source, Phy as the data format to export. The Phy result will be loaded, split and merged back to each tests' dataset.

Clone this wiki locally