Skip to content

Troubleshooting

Julie Fabre edited this page May 21, 2024 · 2 revisions

Help, my extracted raw waveforms look very flat and odd / I get errors on the raw waveform extraction step.

Check that the param.nChannels and param.nSyncChannels are correctly set in bc_qualityParamValues. param.nChannels must correspond to the total number of channels in your raw data, including any sync channels. For Neuropixels probes, this value should typically be either 384 or 385 channels. param.nSyncChannels must correspond to the number of sync channels you recorded. This value is typically 1 or 0.

Why do I have less units in Bombcell's outputs than in kilosort?

You have the same number of units (try to do length(qMetric) and length(unique(spike_templates)) to check), but they are stored in the Bombcell structure slightly differently. Because kilosort drops units at the last stages of algorithm but does not re-label them, you often end up with a larger maximum template label than there are templates. To store things more efficiently, Bombcell re-indexes all the units, giving them a label from 1 to the number of unique templates. But fear not, you can still get Kilosort's original label with qMetric.clusterID - 1 or with qMetric.phy_clusterID.

Why does qMetric.clusterID not correspond to kilosort's labels?

Kilosort's labels are 0-indexed (ie starts at 0). This isn't very practical in matlab, so we add a + 1 to 1-index them. To find the kilosort label, simply do qMetric.clusterID - 1 or use qMetric.phy_clusterID. Warning: the xth row of the qMetric structure does not necessarily give you the quality metrics pour unit x, kilosort drops units in the last stages of the algorithm but does not rename them, leading to some empty units, and we remove this in bombcell. To get for instance the number of spikes quality metric for the unit with phy/kilosort id 0, you can do the following:

original_id_we_want_to_load = 0;
id_we_want_to_load_1_indexed = original_id_we_want_to_load + 1; 
number_of_spikes_for_this_cluster = qMetric.nSpikes(qMetric.clusterID == id_we_want_to_load_1_indexed);

which is equivalent to:

original_id_we_want_to_load = 0;
number_of_spikes_for_this_cluster = qMetric.nSpikes(qMetric.phy_clusterID == original_id_we_want_to_load);

Something else

Please raise a github issue or alternatively email us.

Clone this wiki locally