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

BUG: <How to assign a better setting based on the probe map> #780

Open
Alchemist-Y opened this issue Sep 10, 2024 · 10 comments
Open

BUG: <How to assign a better setting based on the probe map> #780

Alchemist-Y opened this issue Sep 10, 2024 · 10 comments

Comments

@Alchemist-Y
Copy link

Alchemist-Y commented Sep 10, 2024

Describe the issue:

First:
My probe map is a little irregular compared with Neuropixle probe. I want to assign a better settting to fit it. Here is my probe map.
Actually I do not know it clearly about the Group Centers and Universal Templates during sorting. And intuitively it seems better to remove the group centers in the middle(about 50 - 150) and reduce the number of the universal templates.
image
image
image

Second:
only thess channel I can toggle it to exclude, others are not permitted,I don't know the reason.
image

Reproduce the bug:

No response

Error message:

No response

Version information:

Kilosort v4.0.15

@jacobpennington
Copy link
Collaborator

Please upload your probe file so I can reproduce the issue, or paste in the output of "Print Probe" from the GUI.

@Alchemist-Y
Copy link
Author

hi,jacob, here is my probe file screenshot. Thanks a lot. actually in the acqusition software Intan, I just find 5-6 spike unit, but after the kilosort process, it output more than 50 unit and with about 10 unit with good refractory.
image

@jacobpennington
Copy link
Collaborator

Please use the "Print Probe" button in the GUI and paste that output here, or upload the .json file for the probe. I can't copy-paste code from an image.

@Alchemist-Y
Copy link
Author

sorry,jacob. Here is my .json file.
32 Tetrode 4 shank probe map.json

@Alchemist-Y
Copy link
Author

@jacobpennington hi,jacob. I want to extract the waveform from the .dat file.I have a question: If I have excluded some bad channels, what is the number of channels will be streamed into disk in the .dat file?

@jacobpennington
Copy link
Collaborator

@Alchemist-Y As for the template and center placement for your probe, it's being thrown off because you're treating tetrodes as if they were shanks. Unless there's a specific reason for that for the type of tetrode you're using, I would recommend either:

a) Putting all contacts in a single column (i.e. all the same x- position), marked as a single shank, with ~100 micron spacing between contacts. This will essentially sort each contact separately, which is often preferable since the true geometry for tetrodes is not known.

b) Marking each tetrode as a separate shank (i.e. use 8 shanks, not 4). That will restrict template and center placement to keep them within each shank.

As for the number of channels "streamed into disk," I'm not sure exactly what you mean. When you exclude bad channels through the Kilosort4 GUI or API, those channels are simply skipped over when viewing the data. The shape of the data in the .dat file is unchanged. If you want to exclude the same channels when extracting waveforms yourself, you just need to skip those indices when loading the data.

@Alchemist-Y
Copy link
Author

@jacobpennington,hi jacob, In my stereotype images, is it necessary to keep the map the same with my actural probe? Here is my real probe channels design. So it is 2 tetrodes in one shank. So in this case, could I do the change according to your adivce? BY the way, in your plan B, is this map json meets your advice(this new map json)? But it also seems to obey the origin design of the probe.
image
32 Tetrode 8 shank probe map.json

@jacobpennington
Copy link
Collaborator

I see. In that case, suggestion a) would not make sense since the contacts do have a fixed geometry. Yes, please try that 8-shank probe map you uploaded. You should also update to the latest version of kilosort4, since I recently fixed the placement of the grouping centers for layouts like this.

@Alchemist-Y
Copy link
Author

@jacobpennington Bravo. Excellent work! Thanks for your advice! but I seems to meet a new problem, is it due to my new probe design submitted above or just for my exclueded channels? Or is the waring important to be paid attention? Here is my sort parameters file and warning log.
sorted setting 2version.json
warning log: C:\Users\alche\anaconda3\envs\kilosort\lib\site-packages\scipy\sparse_index.py:151: SparseEfficiencyWarning: Changing the sparsity structure of a csr_matrix is expensive. lil_matrix is more efficient.
self._set_arrayXarray(i, j, x)
image

@Alchemist-Y
Copy link
Author

Follow with the above, I try to restart the kilosort and clear the Cache, and the warning is missing but another error occurs, which is about the CUDA memory. Acutually I have run this data sucessfully before with the kilosort version of 4.0.17. Here is my log. So I just think is there any imcompatibility in this new version of 4.0.18?
CUDA out of memory kilosort4 4.0.18 Log.log

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

2 participants