-
Notifications
You must be signed in to change notification settings - Fork 222
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
Tracking units across state changes in chronic recordings (kilosort drift captures state changes) #388
Comments
Can you show data that this behavior of kilosort is actually producing spike sorting errors? Right now you've shown clear data that there are state changes which alter spiking in a way that kilosort tried to account for by slight spatial shifting. This might help or hurt tracking units across states. But you haven't shown which, unless I'm missing something. |
Hi @agbondy, I see your point. It seems that for the second animal I showed you, the large spatial shifting imposed for REM and Wake are indeed mostly artifactual and thus, to answer your question, may a priori only hurt tracking. Apparently a lot of the artifactual drift estimation in this particular case is due not to the different patterns of activity across states as I suggested, but to the limitation on the number of spikes detected per batch during preprocessing by the standalone detector (#394) Here are the drift traces with df parameters that I showed above, with the missing spikes Here is the same drift traces with df parameters after increasing the maximum number of spikes detected to form the drift map (from 10000 per batch to 50000). The state-dependent drift that I was concerned about is mostly gone. So in summary in this case it is a state-dependency of the overall firing rate (rather than of the patterns of activity) which tricked the algorithm. This issue put aside, I'm still wondering whether changes in patterns of activity across states could be mistakingly interpreted as physical drift by kilosort... but this is after all not what my data shows at the moment Best |
In case anyone else wonders about the effects of a possible state-dependency of the fingerprints use for registration, this paper directly adresses the issue: Decentralized Motion Inference and Registration of Neuropixel Data |
Hi all,
We (@grahamfindlay)would like to be able to track units reliably across state changes during chronic recordings (mostly through sleep/wake cycle, but also under various anesthetics). This is a broad and difficult topic but I thought it would be good to engage the discussion here as this is of interest to many.
As far as I understand, there are at least three ways that units could be "lost" by kilosort during recordings spanning multiple vigilance states:
Below are the drift traces and drift maps (pre-correction), as computed by kilosort2.5 with default parameters from 2h of raw data, for 2 rats. Top is ~cortex and bottom is ~thalamus. On the drift traces, blue is deep channel blocks and yellow is superficial, and on the drift map dark dots are high amplitude spikes. These are from chronic recordings so there is very little acute drift.
In particular, this shows very fast (single batch) drift which is wholly artifactual, and overall different patterns of drift across states. Both are (I suppose) due to the image registration algorithm of the drift correction capturing differences in the patterns of activity across batches (for instance a change in the laminar distribution of spiking activity may be interpreted as a translation of the probe). I haven't systematically explored this but the error seems to be greater in the animals/blocks of channels where fewer spikes are detected.
I'm not expecting a definitive out-of-the-box solution for this issue but here are some ideas that I would be happy to discuss
On the user end:
On kilosort's end (changing the drift correction algorithm), I can think of the following options:
c- Setting a more agressive smoothing of the drift traces across channel blocks and time (possibly weighted by the number of spikes in the batch/block? or by how much the batch's footprint histogram resembles the target histogram after registration?)
d- Ideally we would find a footprint for each channel/batch that would be better invariant to changes in patterns of activity. I understand from the npx 2.0 science paper that this might be in the works...
Looking forward to hearing your thoughts,
Best, Tom
The text was updated successfully, but these errors were encountered: