Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Run wave_clus #3

Closed
mina65 opened this issue Feb 26, 2016 · 9 comments
Closed

Run wave_clus #3

mina65 opened this issue Feb 26, 2016 · 9 comments
Labels

Comments

@mina65
Copy link

mina65 commented Feb 26, 2016

Is there anyway I run wave_clus without GUI, i.e., I want to give wave_clus my data and set of parameters (e.g., temperature, min cluster size, threshold and so on ) and then get the clustered data as output.
Also how can I have the shape of each cluster that has been clustered as an out-put.
Thanks

@ferchaure
Copy link
Member

Use the files Batch_files/Get_spikes.m and Batch_files/Do_clustering.m to run Wave_clus without the Gui.
Are you asking about the shape in the features space? In that case you can use the spikes and the 'par' variable inside the output file to recalculate the features calling: Batch_files/wave_features.m. Then, using the clustering results is possible to get the N-dimensional shape of each cluster.

@mina65
Copy link
Author

mina65 commented Feb 28, 2016

Thanks for your answer. I was wondering how I should use wave_clust when each of my Tetrode has 4 electodes. Should do the clustering for each electrode separately, or is there any function which would do this job in some specific way?
Thanks

@ferchaure
Copy link
Member

You can use Batch_files/Get_spikes_pol.m and then Batch_files/Do_clustering.m like before.

@mina65
Copy link
Author

mina65 commented Feb 28, 2016

I am a bit confused with how I should give the input:
For Get_spikes.m I call it as follow
Get_spikes([{'TT1E1.ncs'; 'TT1E2.ncs'}]); and it gives me two output files.

However when I call Get_spikes_pol([{'TT1E1.ncs'; 'TT1E2.ncs'}]); it gives me an error. Do I need to convert TT1E1.ncs to TT1E1.txt and TT1E2.ncs to TT1E2.txt and give those two text files as an input to Get_spikes_pol?

@ferchaure
Copy link
Member

The polytrode support will be rewrite, but for now, you can follow the instructions from the old documentation:

First, write the name of the files you want to process as polytrode (in ascii format) in a text file named as polytrode1.txt. The spike detection is done by typing in the Matlab command window the batch file Get_spikes_pol(1) which will produce the output file polytrode1_spikes.mat containing the spike times and shapes. In case you may want to process for example 2 polytrodes you just have to type Get_spikes_pol(1:2)

@mina65
Copy link
Author

mina65 commented Feb 29, 2016

Thanks. It works now. I was trying to run the code on real data which is uploaded on the website. I have one problem though.
1- In amp_detect the thrmeax is defined as thrmax = stdmax * noise_std_sorted, however in Do_cluster we have thrmax = 15 * noise_std_detect; I was wondering if there is a reason you have two different formula for computing thrmax.

2- I have set both thrmax as thrmax = stdmax * noise_std_detect; par.stdmax = 15; and par.detection = 'neg'; and ran the code on CSC4. I have an example for a spike which I can't make sense out of it. based on the data and stdmax the thrmax would be 85.2812 (I also have changed the order of filter to 4th order and par.sr =32556;) and I have got a spike which has a maximum> 200. I thought that those spikes which are greater than 85.2812 would be considered as artifacts and excluded from spikes!?

Another question is when I ran Do_clustering on the data I always get 2 classes in cluster_class. How can I find out what is the temperature for these classes, and how can I get different clusters for different temperature. Do I need to run it separately for each temperature??

Thanks

@ferchaure
Copy link
Member

1- Inside that part of Do_clustering, thrmax is only an internal variable to define the limits of the plots.

2- As you said before: thrmax = stdmax * noise_std_sorted. Check the par.detect_fmax/fmin parameters, probably noise_std_sorted is bigger than noise_std_detect .

3- For analyse the results: open the raw data using the GUI, its will find the results and show them.

@mina65
Copy link
Author

mina65 commented Mar 2, 2016

Thank you. I have been trying to apply use the code for clustering my data and I came across tow problems:
1- With one Tetrode I don't get any errors for both detecting spikes and clustering (although I only get one cluster and the size of the other clusters are less than 10), do you have any suggestions on how I can get more clusters from my data

2- When I use the code for another Tetrode I can still detect spikes with (Get_spikes) but when I run Do_cluster I get an error, and I figured out that the number of classes are less than number of index by two. Which I am guessing it has to do with this part of the code but I might be wrong:

if par.permut == 'y'

    clu_aux = zeros(size(clu,1),size(spikes,1)) -1;% + 1000; %when update classes from clu, not selected go to cluster 1001  

    clu_aux(:,ipermut+2) = clu(:,(1:length(ipermut))+2);  

    clu_aux(:,1:2) = clu(:,1:2);  

    clu = clu_aux;  

    clear clu_aux  

end  

classes = clu(temp,3:end)+1;  

Could you please help me in these issues?

Thanks

@ferchaure
Copy link
Member

1- You can try with more inputs to improve the discrimination (par.inputs) or with a smaller par.min_clus to accept smaller clusters.

2- I'm not sure, what is exactly the error? Are you using the latests version of the code?
(https://github.com/csn-le/wave_clus)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants