Add channels -> electrodes -> probes consistency checks#2366
Draft
ree-gupta wants to merge 1 commit intobids-standard:bep032-reviewfrom
Draft
Add channels -> electrodes -> probes consistency checks#2366ree-gupta wants to merge 1 commit intobids-standard:bep032-reviewfrom
ree-gupta wants to merge 1 commit intobids-standard:bep032-reviewfrom
Conversation
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.
Thanks @effigies and @rwblair for the meeting and feedback yesterday. I have tried drafting a rule for the channels -> electrodes -> probes consistency checks.
What this does
Validates that references from child files resolve in parent files:
electrode_nameinchannels.tsvmust exist inelectrodes.tsvprobe_nameinelectrodes.tsvmust exist inprobes.tsvBoth checks allow
n/a(for aux channels without electrodes, or standalone electrodes without probes). We intentionally do not check the reverse direction (parent -> child) since not all electrodes need channels (broken contacts, reference-only, run-specific subsets).Changes
context.yaml: Addednamecolumn toelectrodesassociation and newprobesassociation withprobe_namecolumnassociations.yaml: Extended selectors soelectrodesis resolved when visitingchannels.tsvandprobesis resolved when visitingelectrodes.tsv(follows thecoordsystemprecedent which already includeselectrodesin its selector). Addedinherit: truetoprobes.checks/microephys.yaml: Two warning-level child -> parent reference checksLooking for feedback on
I was not able to get the validator to fire these checks when I broke a dataset by replacing
probe_namevalues inelectrodes.tsvwith nonexistent names. The schema compiles fine, valid datasets still pass, but the broken dataset did not trigger the new warnings.Also, the check expression uses
length(intersects(...)). Whenintersects()finds zero overlap it returnsfalserather than an empty array -- how doeslength(false)behave? If this is problematic, would a simpler check like the following be preferred?Related #2307