csn-le / wave_clus

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

Get_spikes #200

Closed Jay-Shiralkar closed 3 years ago

Jay-Shiralkar commented 3 years ago

Hi, I have my data in "data.mat" format.When I provided my data as an input for Get spikes as Get_spikes('data.mat'), I received a file as an output with empty index and spikes field and 1x1 struct parameter. With all the files I input, I get the an empty spikes and index matrix. Not sure what is wrong as I clearly see the spikes in my data but get empty results. Please advise. Thanks.

Jay-Shiralkar commented 3 years ago

There was no change even after setting stdmin to 1.

Jay-Shiralkar commented 3 years ago

Screen Shot 2021-09-28 at 1 15 11 AM

ferchaure commented 3 years ago

check the detection parameter, it has to match the sign of the spikes. maybe you have a really good SNR and the stdmax threshold is detecting as artifacts the spikes? If the signal is already filtered you can disable the additional filters setting their order as 0.

Jay-Shiralkar commented 3 years ago

I tried detection parameter as 'pos' as well as 'both'; but no change in the results. Disabled the filter by setting par.detect_order=0 ; but no change in the results. My data is already averaged and filtered with decently good SNR. Any other suggestions ? Thanks in advance.

Jay-Shiralkar commented 3 years ago

Also, I see that even if I provide the wrong file name (i.e. file that doesn't even exist), I get an output "NAME_SPIKES.MAT" file with empty field. How should i input the data in correct way ? Thanks

Jay-Shiralkar commented 3 years ago

Hi, I tried to input as "files list.txt" file but couldn't get any results. Where can i find the right format for data files to be enlisted in .txt file ? Thanks.

ferchaure commented 3 years ago

Hi, the list.txt format have to be one filename per line. And that files should have one of the supported formats Try adding the inputs: 'parallel',false to the Get_spikes call. Maybe you are getting errors but not seeing them in the output. If you have a quite good SNR try with: par.stdmax=1000 Another test you could do is using the amp_detect.m function. The first argument should be your data and the second one the parameters (par=set_parameters()) . If that function detects spikes then something is wrong in the file format.

Jay-Shiralkar commented 3 years ago

Hi Fernando, Thank you for the reply. Get_spikes worked. My data variable had different name ; but it worked after changing var name to "data" in my mat file. Just a follow up concern, do you have a similar page where I can find all the rules and regulations for data inputs for "Do clustering" as I wish to cluster my spikes. Thanks again. Really appreciate your help.

Jay-Shiralkar commented 3 years ago

Also, I'm not sure how can I find the actual number of quantified spikes, number of clusters created and number of spikes assigned to each cluster after clustering for each data set. Thanks.

Jay-Shiralkar commented 3 years ago

Screen Shot 2021-09-29 at 4 12 15 AM

ferchaure commented 3 years ago

do you have a similar page where I can find all the rules and regulations for data inputs for "Do clustering" as I wish to cluster my spikes.

Not really, If you have already detected spikes you could copy the output of Get_spikes. It's possible to give get_spikes a file with just index and spikes variables. But remember to add more samples in the borders of your spikes to do interpolation, because your sampling rate is quite low.

I'm not sure how can I find the actual number of quantified spikes, number of clusters created and number of spikes assigned to each cluster after clustering for each data set.

After doing Do_clustering the created times will have a variable with the labels (wiki) from where you can calculate that metrics.

About that "bad cpu" error, is related to macOS breaking its retrocompatibility. I don't have the source code or the OS to recompile for the new macOS and fix it.

Jay-Shiralkar commented 3 years ago

I'm not worried about the bad CPU error. But despite I input the "_spikes.mat" file generated by Get_spikes to Do_clustering, I'm getting an error in Do_clustering. There are several spikes in "spikes variable". Also, I couldn't get the "_times.mat" file which will be the final o/p. There's an error in 177 line of do_clustering (similar to the above picture). How can I get rid of that to get "_times.mat" file ? Thanks.

ferchaure commented 3 years ago

With the bad CPU error you won't be able to sort the spikes.

Jay-Shiralkar commented 3 years ago

Hi Fernando, The issue was due to mac systems. wave_clus works fine with windows. Thanks for the help.