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

Implemented RT-Sort as an external sorter #3597

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

Conversation

max-c-lim
Copy link

No description provided.

@chrishalcrow
Copy link
Collaborator

Hello, this looks great! A few things:

  • It'd be great to add some details to the docs. You can add the sorter to the list of supported sorters in doc/modules/sorters.rst and add the reference to your paper in doc/references.rst.
  • Could you add the basic sorter test suite please? This does some very basic testing for sorters. It should be straightforward. For an example, see src/spikeinterface/sorters/external/tests/test_herdingspikes.py
  • I've had an issue running the sorter on my data (rt-sort doesn't allow for channel_ids with non-integer-convertible names braingeneers/braindance#2). This isn't really related to the implementation of the sorter in spikeinterface, but I'll be able to test the PR a bit better if I can run it on a dataset I know well :)

Thanks!

@samuelgarcia
Copy link
Member

Hi.
This is a super good news to have a new sorter here.
Welcome to RT-sort. Welcome in the game.
Thanks for the work.
I will have look also.

@max-c-lim
Copy link
Author

Thank you for your fast review!

In the first commit, RT-Sort was added to the "Supported Spike Sorters" section. Is there another section where I should add it?

In the most recent commit, I added a reference to my paper in doc/references.rst and created src/spikeinterface/sorters/external/tests/test_rtsort.py.

I'll resolve the error with your data next. Thanks for documenting the issue so well and providing example data.

@alejoe91
Copy link
Member

alejoe91 commented Jan 7, 2025

@max-c-lim

I think it would be great if you published RT-sort as a python package with all its dependencies. That would make installation instructions and the is_installed method much easier

@alejoe91 alejoe91 added the sorters Related to sorters module label Jan 7, 2025

rt_sort = detect_sequences(**params, delete_inter=False, return_spikes=False)
np_sorting = rt_sort.sort_offline(
rt_sort_inter / "scaled_traces.npy",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it means that rt-sort is making a full copy of the traces ?
is it necessary ?
The main idea of the spikeinterface recording API is to avoid copy.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, RT-Sort writes a full copy of the traces on disk. While not technically necessary, because RT-Sort needs to repeatedly access the traces, testing has shown that this makes RT-Sort extremely faster. I can have the detect_sequences method delete the copy if that would be useful.

RT-Sort utilizes the other main idea of the spikeinterface recording API well by being able to sort traces from any acquisition device with at least 50 micrometer pitch.

@max-c-lim
Copy link
Author

max-c-lim commented Jan 20, 2025

Thank you for all your comments! I simplified the installation process and implemented braindance.__version__.

@max-c-lim
Copy link
Author

My branch (before merging main) failed the tests Complete tests / windows-latest Python 3.9, Complete tests / windows-latest Python 3.12, and Complete tests / windows-latest Python 3.12.

I may be mistaken, but I believe that all three failed because of the same reason: the command git clone --filter=blob:none --quiet https://github.com/SpikeInterface/probeinterface.git raised the error invalid path 'resources/wiring_references/ASSY-116>RHD2132.pdf'. My branch does not use or change probeinterface or RHD2132.pdf.

Could someone please advise me on how I could resolve this error?

Thanks!

@alejoe91
Copy link
Member

@max-c-lim that has been fixed! Can you try again?

@samuelgarcia tests fail for tdc1. Do you plan to update it to support numpy 2.0?

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

Successfully merging this pull request may close these issues.

5 participants