[ENH] BEP032: Require anatomical_reference_point when stereotaxic coordinates are given - #2482
Open
bendichter wants to merge 1 commit into
Open
Conversation
Replace the species-conditional requirement on anatomical_reference_point with one conditioned on the presence of stereotaxic coordinates, following the working group discussion on 2026-07-29. The column previously stated that Bregma is assumed for rodents and that the reference point MUST be defined for other species. That requirement could not be enforced. The validator context exposes only participant_id from participants.tsv, so a rule evaluating probes.tsv cannot read the species column at all, species is itself only recommended and defaults to homo sapiens when absent, and deciding rodent versus non-rodent would require taxonomic reasoning that the expression language does not have. The column is now required whenever any of AP, ML, or DV are present, for every species, which is the condition that actually matters, since those coordinates cannot be interpreted without knowing the point they are measured from. This is expressible as a check and one is added. The Bregma default is dropped, since with the coordinates present the column is required and there is no case left for a default to cover. Add the reference point to the intracellular probes example, which gives stereotaxic coordinates and would otherwise no longer be valid. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## bep032-review #2482 +/- ##
==============================================
Coverage 83.09% 83.09%
==============================================
Files 22 22
Lines 1698 1698
==============================================
Hits 1411 1411
Misses 287 287 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Jul 29, 2026
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.
Implements the decision we reached in the working group meeting on 2026-07-29 about
anatomical_reference_point, addressing #2307 (comment) and following up on #2307 (comment). This targetsbep032-review, so it merges into #2307 rather than into master.The Change
The column previously said that Bregma is assumed for rodents and that the reference point MUST be defined for species other than rodents. It is now required whenever any of the
AP,ML, orDVcolumns are present, for every species, and the Bregma default is dropped.As @effigies pointed out, the species conditional came with no check and could not be enforced. The validator context exposes only
participant_idfromparticipants.tsv, so a rule evaluatingprobes.tsvcannot read thespeciescolumn at all;speciesis itself only RECOMMENDED and is assumed to behomo sapienswhen absent; and deciding rodent versus non-rodent would require taxonomic reasoning rather than string comparison. The condition on the coordinates is both the one that actually matters, since stereotaxic coordinates cannot be interpreted without knowing the point they are measured from, and one that can be checked.Dropping the default follows from the same change: with the coordinates present the column is required, so there is no case left for a default to cover.
Implementation
MicroephysRequiredAnatomicalReferencePointinrules/checks/microephys.yamlselects on the presence of any of the three coordinate columns and checks for the reference point. It follows the form of the existingRequiredTemplateXandRequiredComponentchecks inrules/checks/nirs.yaml, which condition one column's requirement on another's contents.In the columns rule the level stays OPTIONAL with a
level_addendumof "required ifAP,ML, orDVare present", so the rendered table reads "OPTIONAL, but REQUIRED ifAP,ML, orDVare present" rather than understating the requirement. The description inobjects/columns.yamland the corresponding sentence in the surgical coordinates appendix are updated to match.I also added the reference point to the intracellular probes example, which gives stereotaxic coordinates and would otherwise stop being valid under the new check.
Verification
bidsschematoolstests pass (81 passed, 1 skipped), as dopre-commiton the changed files andnpm run remark. I parsed both new check expressions withbidsschematools.expressionsto confirm they are well formed, and confirmed the rendered probes table shows the conditional requirement. Both probes examples in the specification now satisfy the check.Note on Ordering
This touches the intracellular probes example, which #2481 also edits, so whichever merges second will need a trivial rebase on that one row. Everything else is independent. Happy to rebase whenever it is useful.
@lzehl, this is the third item from the meeting. The first two are #2480 and #2481.