csn-le / wave_clus

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

How to run batch? #197

Closed dcgggg closed 3 years ago

dcgggg commented 3 years ago

Dear author, I'd like to know if there is a tutorial on batching data? Because I have a lot of problems on this. When I run Get_spikes('01.mat'), output: Wave_clus didn't find a sampling rate in file. It will use the input parameter or set_parameters.m 0 of 1 'spikes' files done. When I run : par.stdmin = 4; par.sr = 24000;
Get_spikes('01.mat','par',par); It dosen't work.The output is the same as above.

Hope to get your reply,Thank you.

ferchaure commented 3 years ago

The message: 0 of 1 'spikes' files done. Could be just a synchronization issue when OS check if the file exist. Look in the folder for a file 01_spikes.mat

dcgggg commented 3 years ago

Sorry. My file format is .mat,There is a variable named 'data' under the file.It doesn't work.

I wonder if it's because batch processing has specific requirements for file formats?Whether the name of matfile should be like 'xx_spikes.mat',the variable under the file shoule be 'spikes' or 'data'?

Another question: The output:Wave_clus didn't find a sampling rate in file. It will use the input parameter or set_parameters.m. I don't have a sampling rate in my matfile,but I've added the set_parameters.m in my subfolder.

When I change the filename to '01_spikes.mat',and change the variable name to 'spikes',run: param.stdmin = 4; param.sr = 24000; param.detection = 'pos'; Get_spikes('01_spikes.mat','par',param); Output: report errors readInData/load_spikes (line 170) index_ts = index;

Get_spikes>get_spikes_single (line 170) [spikes, index] = data_handler.load_spikes();

Get_spikes (line 134) get_spikes_single(filename, par_input);


Sorry to disturb you,Thank you.

ferchaure commented 3 years ago

For continuous data the file should be: A .mat file with a data variable and optionally a sr variable with the sampling rate.

The files 'xx_spikes.mat' are the output of Get_spikes (I asked for it because Get_spikes maybe works and create it).

Another question: The output:Wave_clus didn't find a sampling rate in file. It will use the input parameter or set_parameters.m. I don't have a sampling rate in my matfile,but I've added the set_parameters.m in my subfolder.

That is fine, always is more secure to have the sampling rate as a variable sr in the raw data file.

dcgggg commented 3 years ago

When I tried many times,I found that there can't be a decimal point in the file name.Any way ,I got it! Thank you again for your contribution in this Tool Box.