Repository navigation
Fix segment timing, LFP alignment, dates, units and electrode groups - #14
Draft
bendichter wants to merge 4 commits into
Draft
bendichter wants to merge 4 commits into
bendichter wants to merge 4 commits into
Conversation
Maze task (DANDI:000070): trial times now handle every recording segment restart, not only the first, so sessions with three or more segments no longer jump backwards in time. When the recording durations are known, each segment starts no earlier than the end of the previous recording. The neuroconv converter uses this to place each LFP segment at the same offset as its trials. Hand and cursor positions are marked as mm, the hand's y offset is described, and the session date is read from the mat filename instead of assuming 2009. Center-out task (DANDI:000121): each unit's electrode_group now matches the group of its electrode row (they were swapped between M1 and PMd), positions are marked as mm, and the is_successful description now says what the column holds. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The maze source records each trial's start on both Cerebus systems, so array B is now mapped onto array A's clock with a per-segment linear fit instead of left unaligned. Trials gain the cursor offset, the offline movement onset and reaction time, the accessible target, and the unhittable flag described in the lab's how-to. hit_target_position was indexed by position in the list of kept trials instead of by trial, and took the last target when none was hit; both are fixed. The neuroconv session script now handles both monkeys, finds the recordings and date from the session folder, and runs on neuroconv 0.10. Units are described as unsorted threshold crossings with a 30 kHz resolution, and the LFP series keep their published names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Macaca mulatta maps to NCBITaxon:9544, the PMd array to UBERON premotor cortex and the M1 array to UBERON primary motor cortex. This needs the ExternalResources support on neuroconv main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the conversion problems reported in #9, #11, #12 and #13 that come from the conversion code. The changes were checked against the source files on our Drive, including the lab's "Maze Data How-To" document and the array notes in each session's zip. All ten DANDI:000070 sessions have been re-converted locally with the updated
maze_task_unsortedpipeline, and nothing has been uploaded yet.Maze Task (DANDI:000070)
Trial times now handle every recording segment, not only the second. Each segment starts at the end of the previous recording, or one mean inter-trial interval after the previous segment's last trial if that is later. In the five Nitschke sessions with three or more segments, trial, spike and position times no longer jump backwards.
The LFP is aligned to the trials. Array A shares a clock with the trials and is placed at each segment's offset. The source records every trial's start on both Cerebus systems (
CerebusInfoAandCerebusInfoB), so array B is mapped onto array A's clock with a linear fit per segment. The fit gives 999.990 Hz for Jenkins and 999.9855 Hz for Nitschke, with residuals under 0.11 ms, which agrees with @cboulay's estimates in #11. Cross-correlating each array's spikes with its LFP's high-frequency power peaks at lag 0 (array A) or within one 10 ms bin (array B) in every segment of ses-20090912.The session date is read from the
.matfilename. The old script prepended "2009" to a month-day folder name, so the five Nitschke sessions on DANDI are dated a year early (the source files are all from 2010).Hand and cursor positions are marked as mm. The trials gain
cursor_offset(the cursor was drawnPARAMS.cursorDispYabove the hand, 35 mm for Jenkins, which explains the hand ending below the target in #12), and the fields the how-to recommends:offline_move_onset_time,offline_reaction_time,active_targetandunhittable.hit_target_positionwas indexed by position in the list of kept trials instead of by trial, and took the last target when none was hit. Both are fixed.The Units table is described as unsorted threshold crossings, one per electrode (every entry in
SU.unitLookuphas Blackrock unit code 0), with a 30 kHz resolution. The 65,536 spike split between units 0 and 1 (#9) came from the hdmf version used in 2021, and the re-converted files no longer have it.The
maze_task_unsortedpipeline now handles both monkeys, finds a session's recordings and date from its folder, runs on current neuroconv, and adds HERD references for the species (NCBITaxon) and both arrays (UBERON). The HERD support needs neuroconvmainuntil the next release, soenvironment.yamlpins it. Jenkins's age is set to "/", since his date of birth is unknown.Center-Out Task (DANDI:000121)
Each unit's
electrode_groupnow matches its electrode row; they were swapped between M1 and PMd. Positions are marked as mm,is_successfulis described as the rig's trial success flag, and the Units table is described as threshold crossings. The LFP timing problems from #11 are not addressed here, and this pipeline still usesnwb_conversion_tools, so it needs porting to neuroconv before 000121 can be re-converted.Testing
All ten 000070 sessions converted without errors. In every file, trials and each unit's spike times run forward in time, and each LFP segment starts where the previous one ends. NWB Inspector reports only a missing subject description. An Encore check of the re-converted files against the paper is running now.
Two things are open. The LFP voltage scale is still 1 µV per bit, as in the published files, because these NSx 2.1 files carry no scaling. Also, the old
maze_taskpipeline received the same extractor fixes but cannot be installed with a fixed hdmf, so the re-conversion should usemaze_task_unsorted.🤖 Generated with Claude Code