MouseLand/pykilosort

return the amplitude threshold per template

nsteinme opened this issue · 3 comments

KS2 has a method of finding an appropriate amplitude threshold for each neuron, which basically works great. But it would be helpful to have that value returned, and ideally some information about what happened in the stopping condition of that algorithm: did the amplitude threshold get chosen because lower values resulted in no more spikes? or because lower values resulted in a lot more spikes but introduced contamination? or you weren't getting contamination yet but were still getting more spikes? Not sure if this last one can happen. But in any case understanding the outcome of this would help to evaluate whether neurons are "at the noise floor" in which case false negative rates may be high even if a sufficiently high threshold is chosen so that false positive rates remain low. For some purposes we would like to reject such high-false-negative-rate neurons.

The latest update now stores the thresholds in the output folder which should vary between 4.5 and 10.5 and are the minimum explained variance a spike must have to be included. The way the algorithm works is it starts with a threshold of 10.5% and then keeps lowering this until it reaches 4.5% or contamination is introduced so no more spikes is not a stopping condition. If you reject all neurons with a threshold above 4.5% this should remove all neurons "at the noise floor" but I'm happy to make further changes if you want more information in the output.

Looks like this is OK so closing. LMK if I should re-open.