akcarsten / spike_sorting

Python implementation of signal processing techniques and K-means clustering to sort spikes.
https://towardsdatascience.com/whos-talking-using-k-means-clustering-to-sort-neural-events-in-python-e7a8a76f316
MIT License
78 stars 36 forks source link

Thank you for your code and very impressive explainaton #3

Open Jianfengliu0413 opened 3 weeks ago

Jianfengliu0413 commented 3 weeks ago

Thank you for your code and very impressive explanation, I am a spike-sorting beginner. I have a stupid question, the example shown used a single-channel ncs file. How to handle the multiple channel data. when the recording lasts a few hours or even more.

i have an idea(stupid again), e.g., 32 channels last 6 hours. cut the 6 hours into 1-minute epochs? then detect spikes for all 32 channels?

many thanks for considering my request. I am always confused about how to manage this.

akcarsten commented 2 weeks ago

Hi @Jianfengliu0413, sorry for my delayed response just saw your message. The approch that you outlined in your comment will most likely identify spikes within the each epoch but will define different clusters for every epoch. Therefore you will have a hard time monitoring the activity of the same cluster across your recording.

The code in this notebook is an outline of the common principle of spike sorting. However, it is not a state of the art method. I recommend for datasets like yours to use more advanced and peer-reviewed approaches like Kilo-Sort.

Paper is here: https://www.nature.com/articles/s41592-024-02232-7

Hope that helps, Carsten