-
Notifications
You must be signed in to change notification settings - Fork 191
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
Plot_unit_locations error? #3563
Comments
Hi @JazlynnXM-Tan , The unit_locations are likely computed in different ways. By default, spikeinterface uses I have a feeling you’ll get closer to kilosort results if you compute again using
Could you recompute the spike locations, and let us know what the results look like? Thanks! We’ve actually documented this wrong - our docs claim that center_of_mass is the default, but it isn’t! I'll make a fix now. |
Hi, I reran it as you said. The units no longer appear on regions without recording channels. However, they do still seem to be clustered on the rightmost shank. The position of the unit 52 has changed but is also not in the expected location from kilosort results. I did get this error from computing either spike and unit locations though: |
I ran about 15 min of the same recording in spikeinterface with kilosort4 in |
This is helpful! Can you ask on the Kilosort GH repo as well? It might be indeed some problem with kcoords! Spike sorting by shank in SpikeInterface is bullet-proof :) |
Sure, have asked on kilosort: MouseLand/Kilosort#826 |
@JazlynnXM-Tan actually the problem is probably in the channel map from SpikeGLX: see this issue int-brain-lab/ibl-sorter#24 Thansk @oliche for the hint! |
Hi @alejoe91, do you mean that the raw data itself has to be ordered by channel number (ie. CH1, CH2, etc.)? I was under the impression that the channel map file contains the information for the sorters to reorder the data. The channel maps I used did have the x, y and k coordinate information. Do you have any suggestions on what we can do? Thanks! |
I think that performing sorting within spikeinterface might fix the problem. Otherwise I'll ask @oliche what recommendation he has! |
I would be curious to look at the spikeglx meta data file and if possible a few seconds of raw data to understand the issue. @grg2rsr would also be interested ! |
Hi,
I have a recording on neuropixel 2.0 using openephys and performed sorting on kilosort 4 (outside of spikeinterface). I then loaded both the recording and sorting into spikeinterface to create a sorting_analyzer object. After computing random spikes, templates, spike and unit locations, I tried plot_unit_locations which gave a plot where most of the units seemed to be on the rightmost shank, while there are also many units on the third from left shank, where there aren't even recording channels selected. Finally, some units are plotted in between shanks. These locations do not match the spike locations visualization from kilosort either.
Plot_unit_locations output:
I plotted the spike_positions.npy file from kilosort 4:
To look at a single unit in detail, here is unit 52 highlighted in red on the second from left shank (for ease of viewing I did not plot all the spikes from other units). The plot_unit_locations widget however highlights unit 52 on the 4th shank, at a different depth as well.
May I know if I am doing something wrong?
This is my code:
The text was updated successfully, but these errors were encountered: