-
Notifications
You must be signed in to change notification settings - Fork 15
Other_analysis_methods
The goal of this tutorial is to introduce basic aspects of working with neuropixels data and to point to some useful existing code, to help you get started quickly.
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. You will also need the npy-matlab repository to load kilosort/phy files.
Kilosort output files can be loaded directly:
spikeTimes = readNPY('spike_times.npy');
But more convenient will be to load many of the relevant files quickly with one command:
myKsDir = 'C:\...\data\myKilosortOutputDirectory';
sp = loadKSdir(myKsDir)
sp.st are spike times in seconds, and sp.clu are cluster identities.
Spikes from clusters labeled "noise" have already been omitted.
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”. Make sure to zoom in on the y-axis to look carefully. A drift of 20µm can move a neuron off your site, but the probe is 4mm long.
[spikeTimes, spikeAmps, spikeDepths, spikeSites] = ksDriftmap(myKsDir);
figure; plotDriftmap(spikeTimes, spikeAmps, spikeDepths);
Note that the channel map file used here has channel 1 at y-position=0, and since channel 1 is the site nearest the tip of the probe, this plot goes from the tip of the probe at the bottom to the most superficial part at the top.
To see where on the probe spikes of different amplitudes were recorded, we can plot a colormap of the distribution of spikes across depth and amplitude.
depthBins = 0:40:3840;
ampBins = 0:30:min(max(spikeAmps),800);
recordingDur = sp.st(end);
[pdfs, cdfs] = computeWFampsOverDepth(spikeAmps, spikeDepths, ampBins, depthBins, recordingDur);
plotWFampCDFs(pdfs, cdfs, ampBins, depthBins);
- About Neuropixels and probe types
- Configurations and selecting electrodes
- Equipment List and example setup
- Probe handling/mounting
- Chronic implants
- Probe sharpening
- Probe care
- Planning probe trajectories
- Acquisition software
- Referencing and Grounding
- Gain settings
- Filter settings
- Impedance testing
- Synchronization
- Multiple probes on one computer
- Light artifacts
- Troubleshooting
- Recommended preprocessing
- Spike sorting
- Spike sorting curation
- Other analysis methods, and tutorial for getting started with Neuropixels Phase3 data in matlab
- Identifying tracks in histology