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

spike detection affected by light artifacts? #179

Closed
megkirch opened this issue Jan 17, 2020 · 1 comment · Fixed by #595
Closed

spike detection affected by light artifacts? #179

megkirch opened this issue Jan 17, 2020 · 1 comment · Fixed by #595

Comments

@megkirch
Copy link

I have been running into an issue where it looks like fewer spikes are being detected immediately after as well as immediately before (~5-10ms) the onset of LED light for optogenetic manipulation. I am quite certain that it is in fact before the LED comes on because light artifacts that are mistaken for spikes are quite obvious (high amplitude) and line up with my analog signal (blue trace in attached figure) for my light delivery. I've been going through the Kilosort2 code a lot trying to figure out where the problem is arising, and so far my best guess is that is has to do with how the raw signal containing a big deflection in voltage due to light onset is getting filtered in the pre-processing stage. Anyway, I'm wondering if anyone has any explanation for this and suggestions for how to mitigate it (while it's not a huge deal for my analyses because I'm not analyzing spikes during this time period when the LED first comes on, I noticed it because some of PSTHs look weird with a little dip in spikes immediately prior to LED onset)
NPRH25_LP_detectedspikes

A few other relevant points:

  • this effect scales with LED intensity (the greater the intensity, the greater the drop in spikes)
  • I still see it in control animals not expressing an opsin (i.e., it's not a legitimate optogenetic effect)
  • I only noticed it when I started recording from the thalamus, where spontaneous spike rates are considerably higher than in cortex (and so a dip in spikes is more obvious)
  • It seems to mainly effect the detection of lower-amplitude units (which is why I'm thinking it has to do with how the threshold for spike detection is determined from the pre-processed data?)

Thanks in advance for any explanations and/or advice!

@marius10p
Copy link
Contributor

Indeed, the filtering could affect the spike sorting both before and after an artifact. My only recommendation at this time is to try to remove the artifact yourself from the raw data before passing it to Kilosort2.

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

Successfully merging a pull request may close this issue.

2 participants