-
Notifications
You must be signed in to change notification settings - Fork 41
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
BF: Skip PCA projection and results storing for spike-less groups #34
base: master
Are you sure you want to change the base?
Conversation
do you confirm that this fixes the bug in your case? |
For me, it's good--recall that I am not doing anything downstream of spikedetekt in phy/klustaviewa. |
Scratch that -- I will take a moment in the next few days to go through the full run of klusta and then try to visualize the results. |
Ok, "next few days" got out of hand, as well as the weeks following that. Back to this now, I have two results to report:
I'm tracing the lack of path error back to line 254 in klusta/launch.py that (logically) skips clustering if there are no spikes. (*) I only seem to see spikes from one "shank", but I definitely don't know how to drive this GUI |
I'm wondering if adding an empty child named "clusters" would work... |
Happy to try this, but I haven't dug into the KwikModel. Can I just open new empty model and save it? ` |
... must have posted & closed with stray keystrokes there. I was thinking I would just try to save a default KwikModel. I'll see what happens. |
I am not having success taking out the no-spikes check I mentioned. If I let the model try to write an empty cluster-ID array, an exception is thrown on the second of these two lines: https://github.com/kwikteam/klusta/blob/master/klusta/launch.py#L282-L283 The cause is when adding the empty cluster, these lines are blocking the creation of a https://github.com/kwikteam/klusta/blob/master/klusta/kwik/model.py#L369-L379 I'm not sure how to add an empty cluster that isn't nonsensical. If you want, can you send a patch or suggestion? |
OK, I'm wondering whether it might make more sense to slightly change this PR, so that PCA is skipped when the cluster is empty, but the loop iteration is not stopped and the cluster is nevertheless created..? So just create an empty array for the features in this case. |
No dice. I can avoid assertion errors here by making some fake feature dimensions (e.g. and create a special case for empty sets to avoid an assertion error here: Then I run into an object size consistency problem when trying to construct a Rather than hacking the pre-processing, perhaps it would be best to learn why phy does not break down on channels w/o clusters? |
Okay so let's go back to the beginning. You have shanks with no spikes, right? klusta failed, and this PR fixes it? Then, phy works (you may have to test with the |
Yep, phy kwik-gui works with all valid channels groups. It's too bad that the other latent bug was too deep for me to follow, but if you're phasing out KlustaViewa anyway then no big deal. |
Pull request re: spikedetekt bug for sparsely spiking channels in phy-users link