Skip to content

Other_analysis_methods

Nick Steinmetz edited this page Apr 28, 2018 · 21 revisions

Tutorial

This brief tutorial specifically covers Neuropixels Phase3A data in Matlab, and in some cases specifically for files recorded with SpikeGLX and/or processed with Kilosort. But it will hopefully be useful also as a guide for other situations.

The code here is also contained in the exampleScript.m file of the spikes repository.

Data preprocessing

Loading kilosort/phy data easily

Analyzing Drift

Because the Neuropixels probes sample densely of a long continuous span, movement of the brain relative to the electrode can be well detected and quantified. Methods to correct for it are under development. To observe whether there was drift in your recording, a useful type of plot is the “driftmap”. To make this plot, compute the amplitude and position on the probe of every spike, then make a scatter of position against time for all spikes, with points colored by their spike amplitude. The position can be reasonably well-estimated by taking a center of mass of principal components, and the amplitude can just be the mean amplitude of the cluster/template of the spike, or can be also derived from the PCs. When plotting this way, horizontal lines of a certain grey-level (i.e. amplitude) are immediately evident, presumably corresponding to individual neurons or small groups of similar neurons. Then the way the position of these neurons changes of time becomes clear. Methods for doing this in matlab from Kilosort-analyzed data are available in the spikes repository, see /analysis/ksDriftmap.m and /visualization/plotDriftmap.m.

[spikeTimes, spikeAmps, spikeDepths, spikeSites] = ksDriftmap(myKsDir);
figure; plotDriftmap(spikeTimes, spikeAmps, spikeDepths);

Quantification of spiking amplitudes

Basic LFP characterization

Computing some useful properties of the spikes and templates

Loading synchronization data

Looking at PSTHs aligned to some event

Loading raw waveforms (or spike-triggered LFP, e.g.)