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

scale parameter in kilosort4 #3561

Open
YangLin916 opened this issue Dec 2, 2024 · 2 comments
Open

scale parameter in kilosort4 #3561

YangLin916 opened this issue Dec 2, 2024 · 2 comments
Labels
question General question regarding SI

Comments

@YangLin916
Copy link

Hi! I am using kilosort4 in spikeinterface to do spike sorting. I notice the scale parameter in kilosort4. Should I set it to the same as gain_to_uV property in my recording data, or just leave it to None? My recording data is in binary format, and acquired from our lab's own system. And I manually set the gain_to_uV property to the data.

Another question: I found running kilosort4 in spikeinterface is slower than running it separately through KS4 GUI. I am curious why it is.

Thanks a lot!

@zm711
Copy link
Collaborator

zm711 commented Dec 3, 2024

Hi! I am using kilosort4 in spikeinterface to do spike sorting. I notice the scale parameter in kilosort4. Should I set it to the same as gain_to_uV property in my recording data, or just leave it to None? My recording data is in binary format, and acquired from our lab's own system. And I manually set the gain_to_uV property to the dat

Could you explain this a bit more. You are just doing si.read_binary from your proprietary format? Is there a header? I think I need at least need more info to understand this. :)

Another question: I found running kilosort4 in spikeinterface is slower than running it separately through KS4 GUI. I am curious why it is.

We have a wrapper around KS4. Adding extra layers of python will always slow things down. Could you quantify how much slower? We often find the biggest slow-down for people who want to use shank isolation in SpikeInterface. KS4 will try to automatically do this for the templates with dminx, which allows it to pass through the data less, then if you actually isolate the data with our wrapper which would then go through the data 1 time per shank. We think the hit in speed is worth the increase in accuracy. But small slowdowns are absolutely expected when wrapping other code. :)

@zm711 zm711 added the question General question regarding SI label Dec 3, 2024
@YangLin916
Copy link
Author

Thank you for your reply!

For the first point: I load the data by recording = se.read_binary(file_paths = base_folder / 'NPElectrophysiology_2_2.bin', sampling_frequency=30000, num_channels=385, dtype = "int16", gain_to_uV=2.3438, offset_to_uV=0)
And I want to know if I need to change this'scale': 'Scaling factor to apply to data before all other operations. Default None.' params in KS4 sorter.

For the second one, I ran a 3-hour recording collected with Neuropixels NHP in the Kilosort4 GUI, and it took 5.5 hours. However, running it through the KS4 wrapper in SpikeInterface took 7 hours. I used the default params in both of them.

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

No branches or pull requests

2 participants