csn-le / wave_clus

A fast and unsupervised algorithm for spike detection and sorting using wavelets and super-paramagnetic clustering
127 stars 66 forks source link

tips of overlapping spikes #181

Open MatteoVissani opened 4 years ago

MatteoVissani commented 4 years ago

Dear Fernando,

I am analyzing single-channel human electrophysiological data. I have two questions:

i) I always have high isolated and compact clusters but with a high percentage of ISI < 3 ms. This means that there may be multiple neurons firing together with a similar waveform shape but they are not distinguished, right?

How can I handle this situation?

  1. Is possible in wave_clus to disentangle them? Trying to find manually sub-optimal sub-clusters with percentage of ISI<3 ms around 0 could be a reasonable approach?
  2. Have I to give up and consider them as a "multi-unit activity" and perform a separate analysis on them?

ii) I have some non-stationary artifacts in some tracks. Have I to drop the tracks out or is possible to identify the artifacts and remove them? Does it yet make sense to perform spike sorting in cutted data?

Thank you. I am really struggled on it since weeks. Regards,

Matteo

ferchaure commented 4 years ago

Hi Matteo,

i) I always have high isolated and compact clusters but with a high percentage of ISI < 3 ms. This means that there may be multiple neurons firing together with a similar waveform shape but they are not distinguished, right?

Yes, that could happen. I don't understand one thing, are they compact how? in the 2D projection plots? It's totally normal that one of the clusters merge all the low amplitude detections (enough SNR to be detected but not to be separated). If you want to be sure that is not a timing error check that the sampling rate (saved as par.sr in the _times__ file) is fine.

How can I handle this situation?

Both approaches are fine, if you have a lot of data and manually curating the results is not possible I would prefer number 2. The GUI in waveclus is there for manually curate results and have been quite useful before but usually is hard to separate those troublesome clusters. If they are the low amplitude spikes, don't lose time with them.

ii) I have some non-stationary artifacts in some tracks. Have I to drop the tracks out or is possible to identify the artifacts and remove them?

Sometimes, artefacts generate a few clusters than you can manually remove latter.... the best criterion is to try and see. If the results are totally a mess you still have the next option/question.

Does it yet make sense to perform spike sorting in cutted data?

That depends on the stability of the recording if the artefact is related to movement that usually changes a bit the waveforms I do not recommend to concatenate data. On the other hand, if the artefact is for example just electromagnetic interference, you can cut the nice segments and call Get_spikes for each of them. Add the start time of each nice segment to the variable index of its spikes_, then you can concatenate the variables of all the _spikes, save them with one of the par variables in a new spikes_ file and finally call Do_clustering.

Cheers

MatteoVissani commented 4 years ago

Hi Fernando,

Thanks for the fast reply. Yes they are isolated and compact in the 2d projections. I also calculated an isolation score and it's above 0.95. So when the amplitude of the waveform is low (can you quantify this "low"?) it is better to discard it directly, right?

Thank you really much. Cheers, Matteo

ferchaure commented 4 years ago

Low is close to the threshold, you can see this more or less when the mean waveform (black line) is close to the minimum value of the spikes in this cluster in sample 20 (for positive spikes). Maybe a clear way is to plot the histogram of amplitudes of sample 20 of the spikes. Usually, you will see that the multiunit cluster doesn't have a symmetric distribution because a big par of the spikes have not been detected. See the fig 2.G of https://www.jneurosci.org/content/31/24/8699

it is better to discard it directly, right?

It depends on the application, in general, is not recommended report results using them but I have seen a few. They are tricky because they represent multiple neurons is like the signal pre-sorting. They are useful, for example for studying concept cells if you find that a multiunit respond to a concept, You can try that concept later and with a bit of luck, the electrode moved and now is a clear unit or maybe doing more repetitions help the clustering to find some pattern in the waveform and discriminate it better.

MatteoVissani commented 4 years ago

Thank you very much for your patience and this paper. Cheers,

Matteo