Spike waveforms in IBL BWM dataset

Hi,

I just noticed that some waveforms provided in clusters.waveforms.npy are quite noisy though their quality label from clusters.metrics.pqt is good.

Here is an example in julia if you load session ibl_witten_19/2020-07-23/001:

using NPZ
using Plots

w = npzread("ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_19/2020-07-23/001/alf/probe00/pykilosort/clusters.waveforms.npy")

p = plot(w[15,:,1],color=:black)
[plot!(w[15,:,i], legend=false) for i in 2:32]
display(p)

You get this plot (panel A)

The quality label of this unit is 1. You can find multiple occurrences of these problematic waveforms. This happens to me if I do not manually check my waveforms after spike sorting in Kilosort. I would be happy to hear your take on this.

Another related question regards the 21 sample-blank period. Why is this implemented? Also it appears that some filtering might have been performed on the waveforms. Is this true and what are the filtering parameters (panel B)?

(example wavefrom number 4 (3 in 0-based index) form seesion session ibl_witten_19/2020-07-23/001)

One potential issue with filtering, is to affect sharp peak voltage values by artificially boosting them. If one would try to measure the ab ratio (see image form cell explorer, panel C) that could be an issue (quick comparison with our and Steinmetz 2019 dataset, panel D-E).

Any details on this?

Thanks a lot for your time and help.

Pierre

Hello Pierre,

This is a feature of kilosort (this was already in kilosort 2 matlab and carried over to pykilosort).
I think this had to do with Phy.

You indeed will have to remove the zero samples strip before performing filtering, and I would even advise to do some mirroring at the edges to avoid side effects.

Another solution that we sometimes pursue, that is much more computationally involved, is to re-extract the spikes from the raw data itself.

Best
Olivier

Hi Olivier,

Thank you for the quick reply. I guess I still need some clarifications:

  • What are the waveforms we find in clusters.waveforms.npy exaclty then?
  • I am not performing any filtering on the waveforms, but it looks like some filtering has already been done (panel B). I was wondering if this was true, and if yes what are the filter parameters?

I guess I could re-extract all the waveforms myself but this might take a while (loading the raw data + performing the extraction…).

Best,

Pierre