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

Made 3 important hidden parameters visible to the user #809

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

naterenegar
Copy link

Summary

Hello!

In my experience using kilosort, I've had to dig into the code to understand the output I was getting. I found and documented three parameters that impacted the performance of the algorithm: loc_range, long_range, and max_peels. I've tested that these work with the GUI and with the API. Also, I've added a warning at the DEBUG level of the logger during matching pursuit.

Universal Template Parameters

loc_range and long_range control how far to look in channels and time around a spike to determine (1) if it is a maximum (loc_range) and (2) if it is isolated (long_range). These were hard coded to loc_range = [4,5] and long_range = [6,30], but the user should be able to adjust these if (1) their sampling rate demands different ranges of samples and (2) if the organization of channels in their binary is non topographic. That is, adjacent channels in the binary may not be adjacent in the probe, but the peak detection and isolation treats them that way. This is the case for my data, so I've been running the algorithm with the channel range set to 0 to improve the construction of universal templates.

Matching Pursuit: max_peels

The number of required iterations of matching-pursuit to detect all spikes varies depending on the network properties of the recording. In my data, the network oscillates between quiet and high frequency states. During the high frequency states, there are many overlapping spikes that required more than the hard coded 100 iterations of matching pursuit. For my particular data, I increased the iterations to 500 to detect most spikes during these network bursts.

To make this more transparent to other users, I've added this as a parameter and added a warning using logger.debug to warn the user when spikes are detected on the last iteration of matching pursuit.

Modified Files

parameters.py: Added entries for the three parameters
gui/settings_box.py: Added handling for the list format of loc_range and long_range
spikedetect.py: Added code to fetch the loc_range and long_range parameters
template_matching.py: Added code to fetch the max_peels parameter and emit a warning

… when the last iteration of matching pursuit is reached but spikes are still detected, along with a parameter to increase the number of matching pursuit iterations.
…ault parameter settings for loc range and long range
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 this pull request may close these issues.

1 participant