Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about some KiloSort 2 parameters #156

Closed
hu-kun opened this issue Dec 11, 2019 · 6 comments · Fixed by #595
Closed

Questions about some KiloSort 2 parameters #156

hu-kun opened this issue Dec 11, 2019 · 6 comments · Fixed by #595

Comments

@hu-kun
Copy link

hu-kun commented Dec 11, 2019

Hi,

Currently we are moving to KiloSort 2 and trying to figure out the parameters. We read thought the wiki and the paper published with KiloSort 1 but couldn't find specific answers.

  1. For the following settings, how do they relate to each other and other settings in Kilosort? Also, what are some logical upper and lower bounds of each?

    Ops.momentum = [20 400]
    Ops.Th = [10 4] 
    Ops.lam = 10
    
  2. For Ops.sigmamask, I want to make sure we understand this parameter correctly. 30um in the example below is the standard deviation of the Gaussian mask placed over the max amplitude of a given unit? So increasing this by 2x electrode distance (20um distance) would increase the gaussian mask to include 1 additional channel on either side of the max amplitude?

    Ops.sigmamask = 30

  3. For the following parameters in Phy ClusterView, can I get some clarification / explanation on the calculations?

    • ContamPct – default 0.20, but 20% seems high for a percentage of allowed contamination, and many of our “good” units are showing “100%” as ContamPCT
    • What is the difference between “amp” and “Amplitude”?

Thank you in advance.

Kun

@marius10p
Copy link
Contributor

  1. Please see the main readme for Th and lam. The momentum is just an optimization parameter in units of spike detection counts. It shouldn't be necessary to adjust this.

  2. Again, not really meant to be changed. This is only used for proposing new units that have not been detected yet at each timestep in the optimization. 30um is a good range for detecting spikes based the summed power of its PCA projections over that spatial scale. It would probably work very similarly with 5um or 100um, and has no effect on the final template shapes.

  3. ContamPct is the estimated contamination, based on the number of refractory period violations. This is roughly the ratio of the event rate in the central 2ms bin of the histogram to the baseline of the auto-correlogram (the "shoulders"). Some people report the fraction of refractory violations to total number of spikes, which is a meaningless measure for assessing contamination. Everything above 20% will just show as 100% for now.

  4. I am not sure what Cyrille calls the different amplitude views, but one of them is the template amplitude (kind of arbitrary units after all the filtering and whitening and normalization) and the other one is the standard amplitude of the maximum negativity of the raw average waveform.

@hu-kun
Copy link
Author

hu-kun commented Dec 17, 2019

Thanks for your reply, it's very helpful. I just checked two amplitudes, and I suppose the "amp" indicates the template value while "amplitude" matches the other one. In this case, since this template amplitude seems to be less helpful, I'd suggest to make the headers of Similarity and Cluster Views adjustable, like the widths and which to show.

@JoseGuzman
Copy link
Contributor

I'd suggest to make the headers of Similarity and Cluster Views adjustable, like the widths and which to show.

I don't think you could adjust the width of the columns, but you could select which fields appear with a custom script in Python. This depends on Phy, not on KiloSort2.

@hu-kun
Copy link
Author

hu-kun commented Dec 17, 2019

I didn't realize I could do it with the scripts, thanks for pointing it out.

@marius10p
Copy link
Contributor

The template amplitude is a less noisy estimate of the size of a spike, because it measures the match of the spike to the entire spatiotemporal waveform of that neuron. This is also the quantity that Kilosort2 thresholds to find the spikes in the first place. In contrast, the classical spike amplitude only reports the single most negative time/channel sample.

@marius10p
Copy link
Contributor

Closing for lack of activity.

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

Successfully merging a pull request may close this issue.

3 participants