spyglass icon indicating copy to clipboard operation
spyglass copied to clipboard

Spikes sorting recording timestamps starting from 0

Open samuelbray32 opened this issue 5 months ago • 0 comments

Describe the bug

  • I have found multiple entries in my data (scannning the full table now) where the recording stored by v0.SpikeSortingRecording starts from time zero rather than the unix time of the interval.

  • I haven't yet found a clear connection of which entries will cause it

    • the same sort interval all but one sort group will not have this error
    • The same sort group with the error will be fine for other intervals on the same day
  • In downstream clusterless sorting, this creates events outside the interval (with none occuring within), which can lead to failed decodes in ClusterlessDecoding

To Reproduce

import spikeinterface as si
from spyglass.spikesorting.v0 import SpikeSortingRecording

bad_key = {
    "curation_id": 0,
    "nwb_file_name": "Frodo20230814_.nwb",
    "sort_group_id": 0,
    "sort_interval_name": "02_wtrack",
    "preproc_params_name": "franklab_tetrode_hippocampus",
    "team_name": "ms_stim",
    "sorter": "clusterless_thresholder",
    "sorter_params_name": "clusterless_fixed",
    "artifact_removed_interval_list_name": "Frodo20230814_.nwb_02_wtrack_0_franklab_tetrode_hippocampus_ampl_2000_prop_75_artifact_removed_valid_times",
}
SpikeSortingRecording & bad_key
recording_path = (SpikeSortingRecording & bad_key).fetch1("recording_path")
recording = si.load_extractor(recording_path)
recording.get_times()

samuelbray32 avatar Sep 25 '24 22:09 samuelbray32