LorenFrankLab / spyglass

Neuroscience data analysis framework for reproducible research built by Loren Frank Lab at UCSF
https://lorenfranklab.github.io/spyglass/
MIT License
93 stars 42 forks source link

artifact detection across tetrodes for spike sorting #582

Closed MichaelCoulter closed 10 months ago

MichaelCoulter commented 1 year ago

it would be great to easily detect spike artifacts across multiple sort groups. currently, this requires making a new combined sort group manually and then detecting artifacts on that. it would be great if this was easier / built in.

dpeg22 commented 1 year ago

@jguides I believe has something along these lines for her spike sorting pipeline.

jguides commented 1 year ago

Yes. @MichaelCoulter I believe we talked about this about a year or so ago and @khl02007 came up with a solution that used the existing lab tables. You are more than welcome to use / adapt my tables if you would like.

MichaelCoulter commented 1 year ago

Yes, I have been using this solution, thanks. It would be great if this could be made into a method as part of artifact detection so that it is more streamlined to do this for new data.

khl02007 commented 10 months ago

I think this can be done by either

  1. detect artifacts for each sort group, take their union, add it to IntervalList, and use that for populating SpikeSorting
  2. make one large sort group that includes the all the tetrodes, do artifact detection on that, then use the resulting interval to do spike sorting for each smaller sort group containing individual tetrodes

I would recommend 1 because then you don't have to filter and reference and save the recording for the one large sort group that contains all tetrodes.

Does this work? if yes, can we close this issue?

MichaelCoulter commented 10 months ago

the first option might detect the same artifacts as the second option, but i think we would have to try it out in practice to see. you can close the issue and i can try to test this.

are you expecting both options to detect exactly the same artifacts, or artifacts that are pretty similar?

khl02007 commented 10 months ago

Since the artifact detection is done on an electrode-by-electrode basis, both method should lead to the same results (intervals with artifacts). Closing for now but feel free to reopen if you want to keep the discussion going.