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

How can I convert data generated by Kilosort into a file readable by NeuroExplorer? #855

Open
AmaliaLambertRinguet opened this issue Jan 21, 2025 · 2 comments

Comments

@AmaliaLambertRinguet
Copy link

AmaliaLambertRinguet commented Jan 21, 2025

Hi everyone,

We recently installed Kilosort4 and Phy2, respectively, to automate and manually refine the spike sorting.

Until now, we've been using Offline Sorter and directly exporting the sorted files as .nex to read them with NeuroExplorer.
We tried converting the .npy files generated by Kilosort to a .mat, but error messages appeared when attempting to open it with NeuroExplorer. We already solved the "Unable to get"... "TIME_UNITS", "Absolute time" but now we have "Unable to get Data matrix"...

Has anyone successfully converted Kilosort-generated data into a format compatible with NeuroExplorer? If so, could you please share the steps or recommend any tools or scripts that might help?

Thanks!

@jacobpennington
Copy link
Collaborator

jacobpennington commented Jan 21, 2025

Hello,

I'll just mention briefly that we do not have any plans to add support for this to Kilosort4 and our development team does not have experience using that software. However, I will leave the issue open for a while in case other users have some answers for you.

If you need more information about the formats the results are saved in, refer to the documentation for kilosort.io.save_to_phy here: https://github.com/MouseLand/Kilosort/blob/main/kilosort/io.py

@nikhilchandra
Copy link

Hi, one solution you may consider is to use the NeuroExplorer NEX5 API in conjunction with phylib, the Python library that undergirds Phy.

https://www.neuroexplorer.com/docs/python_packages/nex5file_package.html
https://github.com/cortex-lab/phylib

Both packages are installable using pip.

Phylib makes it easy to load Kilosort's .npy output into a Python object that has several functions you might find useful (see phylib.io.model.load_model to get started). Once you have extracted the data you need, the nex5file package should make exporting it to an NEX5 file compatible with NeuroExplorer fairly straightforward.

If you have further questions, please do not hesitate to email me at (nikhilplexoncom). I would be happy to help!

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

No branches or pull requests

3 participants