Input and output files

Replace “mysession”, “myprobe”, and “myrecording” as appropriate.

Input files

Filename Content Format
mysession.prm Config file Plain text (MATLAB eval-uable)
myprobe.prb Probe file Plain text (MATLAB eval-uable)
myrecording.bin Raw recording files Binary (16-bit signed integer)
myrecording.meta Meta file for your recording (see Raw recording files) Binary file
mysession_trial.mat Trial file MATLAB data or CSV

Config file

A MATLAB eval-uable file containing your parameters. See, e.g., Bootstrapping and JRCLUST parameters.

Probe file

A MATLAB eval-uable file containing parameters for your probe. (Probe files for various configurations are stored in JRCLUST/probes/.)

Note

Probe files are now optional. Probe file support is for backwards compatibility. Going forward, you can specify your probe parameters in your config file directly.

Your probe may be visualized with the probe command.

Example probe file

% Order of the probe sites in the recording file
channels = 1 + [40  103 39  104 41  102 38  105 42  101 37  106 43  100 36  107 44  99  35  108 45  98  34  109 46  97  33  110 47  96  32  111 48  127 63  112 49  126 62  113 50  125 61  114 51  124 60  115 52  116 59  123 53  117 58  122 54  118 57  121 55  119 56  120 8   71  7   72  9   70  6   73  10  74  5   69  11  75  4   68 12   76  3   67  13  77  2   66  14  78  1   65  15  79  0   64 16   80  31  95  17  81  30  94  18  82  29  93  19  83  28  92     20   84  27  91  21  85  26  90  22  86  25  89  23  87  24  88];

% Site location in micrometers (x and y)
geometry = zeros(128, 2);    % Create a 128 x 2 matrix filled with zero
geometry(1:2:end,1) = 0;     % Set the x-coordinates of the left-edge sites
geometry(2:2:end,1) = 28;    % Set the x-coordinates of the right-edge sites
geometry(1:2:end,2) = 20*(0:63);    % Set the y-coordinates of the left-edge sites
geometry(2:2:end,2) = geometry(1:2:end,2); % Set the y-coordinates of the right edge sites by copying the left-edge site values

% Reference sites are being excluded
ref_sites = [1 18 33 50 65 82 97 114]; % Specify the site numbers to exclude
channels(ref_sites) = [];  % Delete reference sites from the channels vector
geometry(ref_sites,:) = []; % Delete reference sites from the geometry matrix

% Recording contact pad size in micrometers. Height x width
pad = [12 12];

% Default prm
maxSite = 4.5;    % Used to calculate the number of sites to group spikes (nSites_spk = 1 + maxSite*2)
um_per_pix = 20;  % Vertical site center-to-center spacing (used for display)

% Shank information
shank = ones(size(channels));  % All sites belong to shank 1 (single shank recording)

Tags (variable names)

  • channels: (1 x nSites), where nSites is the number of sites to load. The \(i\) th entry in channels denotes the channel (the row in the \(n_{\text{channels}} \times n_{\text{samples}}\) matrix) in the raw recording containing data from site \(i\). In the example above, channel 41 in the raw recording corresponds to site 1. This corresponds to the siteMap parameter.
  • geometry: (nSites x 2). The location of each site, in μm. The first column corresponds to the horizontal or x dimension, and the second column corresponds to the vertical or y dimension (parallel to the probe shank). This corresponds to the siteLoc parameter.
  • pad: (1 x 2). Dimensions (height, width) of the rectangular recording site, in μm. This corresponds to the probePad parameter.
  • ref_sites (optional): (1 x k), where k is the number of reference sites. Indices of reference or disconnected sites to ignore. Alternatively, you can leave these sites out of your siteMap entry.
  • shank (optional for single-shank probes): dimension: (1 x nSites). Shank ID for each site. For example, shank = [1, 1, 1, 1, 2, 2, 2, 2] will assign sites 1-4 to shank 1 and sites 5-8 to shank 2. This corresponds to the shankMap parameter.
  • maxSite (optional): scalar. Number of neighboring sites in each direction over which to extract spike waveforms. This corresponds to the nSiteDir parameter.
  • nSites_ref (optional): scalar. Total number of reference sites to exclude for feature extraction. This corresponds to the nSitesExcl parameter.
  • um_per_pix (optional): scalar. Micrometers per center-to-center vertical site spacing. This corresponds to the umPerPix parameter.

Raw recording files

JRCLUST primarily supports the SpikeGLX recording format, namely a flat binary file containing 16-bit signed integers with a corresponding metadata file. ADC samples from channels 1 to \(n\) sampled at time \(k\) are stored together in series. For example, let \(s_{i,j}\) denote the sample from the \(i\) th channel at time step \(j\). Then the samples are ordered like so:

\(s_{1,1}\), \(s_{2,1}\), …, \(s_{n,1}\), \(s_{1,2}\), \(s_{2,2}\), …, \(s_{n,2}\), … \(s_{n,k}\)

For more information, see the SpikeGLX documention on GitHub.

JRCLUST will ask for a path to your meta file when bootstrapping and use this to infer a path to your raw recording. If you don’t have a meta file, don’t panic! You will be able to select your raw recording, at which point you may specify the relevant information before you begin sorting.

Trial file

This can be either a MAT-file or a CSV. If a MAT-file, it should contain an array called times. If a CSV file, it should contain a single column. In either case, the array or the column should contain trial start times (in seconds). These can be used to plot the peristimulus time histogram (PSTH).

Output files

Filename Content Format
mysession_res.mat Detection and clustering results MATLAB data
mysession_filt.jrc Filtered spike traces from a subset of channels Binary (16-bit signed integer)
mysession_raw.jrc Raw spike traces from a subset of channels Binary (16-bit signed integer)
mysession_features.jrc Spike features Binary (single-precision float)
mysession_hist.jrc Operation history from user curation Binary (32-bit signed integer)
mysession.csv Cluster data CSV

Detection and clustering results

The following data are stored in mysession_res.mat:

Variable name Content Data format
centerSites Sites with peak spike amplitudes for each of nPeaksFeatures nSpikes x nPeaksFeatures: int32
clusterCenters Indices of cluster site centers as determined in Spike clustering
nClusters x 1:
double
clusterCentroids Feature-weighted center x-y positions on the probe for each cluster nClusters x 2: double
clusterNotes Text annotations for each cluster nClusters x 1: cell array of char
clusterSites Mode of spikeSites for spikes in each cluster nClusters x 1: double
curatedOn Timestamp of last saved curation scalar double
detectTime Time spent (in seconds) in detection step scalar double
detectedOn Timestamp of last spike detection scalar double
featuresShape Dimensions of Spike features 1 x 3: double
filtShape Dimensions of Filtered spike traces 1 x 3: double
history Key-value store of curation operations with commit messages (see Operation history) containers.Map
initialClustering Initial spike table nSpikes x 1: int32
meanSiteThresh Mean (over chunks) detection threshold per site 1 x nSites: single
meanWfGlobal Mean (over spikes/cluster) waveform over all sites (all zeros outside siteNeighbors for Reasons) nSamples x nSites x nClusters: single
meanWfGlobalRaw Mean (over spikes/cluster) raw waveform over all sites (all zeros outside siteNeighbors for Reasons) nSamplesRaw x nSites x nClusters: single
meanWfLocal Mean (over spikes/cluster) waveform over sites specified in siteNeighbors nSamples x 2* nSiteDir + 1 x nClusters: single
meanWfLocalRaw Mean (over spikes/cluster) raw waveform over sites specified in siteNeighbors nSamplesRaw x 2* nSiteDir + 1 x nClusters: single
meanWfRawHigh Mean (over spikes/cluster) raw waveform on high positions on the probe nSamplesRaw x 2* nSiteDir + 1 x nClusters: single
meanWfRawLow Mean (over spikes/cluster) raw waveform on low positions on the probe nSamplesRaw x 2* nSiteDir + 1 x nClusters: single
rawShape Dimensions of Raw spike traces 1 x 3: double
siteThresh Detection threshold per site per chunk (see Chunking) nSites x nChunks: single
sortTime Time spent (in seconds) in clustering step scalar double
sortedOn Timestamp of last spike clustering scalar double
spikeAmps Spike amplitudes in ADC sample unit nSpikes x 1: int32
spikeClusters The spike table: cluster assignment for each spike nSpikes x 1: int32
spikePositions Feature-weighted center x-y positions on the probe for each spike nSpikes x 2: double
spikeSites Site with the peak spike amplitude (center site) nSpikes x 1: int32
spikeSites2 Site with the second peak spike amplitude nSpikes x 1: int32
spikeSites3 Site with the third peak spike amplitude nSpikes x 1: int32
spikesByCluster Cell of the spike indices per cluster
nClusters x 1: cell
array of double
spikesBySite Cell of the spike indices per site nSites x 1: cell array of int32
spikesBySite2 Cell of the spike indices per secondary site nSites x 1: cell array of int32
spikesBySite3 Cell of the spike indices per tertiary site nSites x 1: cell array of int32
spikeTimes Spike timing in ADC sample unit nSpikes x 1: int32
unitCount Count of spikes in each cluster nClusters x 1: double
waveformSim Waveform-based pairwise cluster sim scores nClusters x nClusters: double

Filtered spike traces

A binary file containing filtered spike traces, extracted in a spatiotemporal window around the spiking event. These are stored as an \(n_{\text{samples}} \times n_{\text{sites}} \times n_{\text{spikes}}\) array of signed (16-bit) integers.

\(n_{\text{samples}}\) is determined from evtWindow and \(n_{\text{sites}}\) is determined from nSiteDir.

Raw spike traces

A binary file containing raw spike traces, extracted in a spatiotemporal window around the spiking event. These are stored as an \(n_{\text{samples}} \times n_{\text{sites}} \times n_{\text{spikes}}\) array of signed (16-bit) integers.

\(n_{\text{samples}}\) is determined from evtWindowRaw and \(n_{\text{sites}}\) is determined from nSiteDir.

Spike features

A binary file containing spike features. For each spike, JRCLUST computes some number of features at one or more positions in a spatiotemporal window. Consequently, the spike features data is stored as an \(n_{\text{features}} \times n_{\text{positions}} \times n_{\text{spikes}}\) array of single-precision (32-bit) floating point values.

Operation history

A binary file containing a copy of the spike table for each operation performed during Cluster curation. For each operation, JRCLUST writes an operation ID (a 32-bit signed integer), followed by the spike table, at the end of this file. The operation ID is kept in sync with a key-value map (hClust.history), allowing users to revert operations.

Cluster data

A CSV export of spike-cluster data. For each spike, a row is written containing: - spike time - cluster ID - center site ID