[ENH] BEP032: Move anatomical location to the electrode level - #2481
Conversation
Rework how anatomical location is described, following the working group discussion on 2026-07-29. In probes.tsv, associated_brain_region and associated_brain_region_id become anatomical_location and anatomical_location_id. The columns now describe the probe as a whole, so the structure named there must contain every recording site on the probe, and may be as coarse as the brain or a hemisphere. The name change also drops the assumption that a probe is in the brain, since a probe may be placed in peripheral tissue. In electrodes.tsv, location becomes anatomical_location, and anatomical_location_id and localization_method are added. Per-contact localization belongs here, since a long shank probe passes through several structures and only the electrode table can describe that. Remove associated_brain_region_quality_type. Its estimated and proof values were not clearly separable in practice, and the free-text localization_method column records the same thing more directly. Remove reference_atlas from probes.tsv in favor of a ReferenceAtlas field in the electrodes sidecar, alongside a LocalizationMethod field for the case where one method applies to every electrode in the file. Guidance no longer prefers species-independent terms. Terms from a species-specific atlas are acceptable and often the better choice, and identifiers should be resolvable so that they can be looked up. 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 #2481 +/- ##
==============================================
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:
|
effigies
left a comment
There was a problem hiding this comment.
Some notes. Apologies for the hit and run. Will be out-of-office for the next week.
The specification says the localization method must not be given both in the localization_method column of electrodes.tsv and in the LocalizationMethod field of the sidecar, but nothing enforced it. Add the check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The field was described as RECOMMENDED whenever anatomical locations are given, but the sidecar rule declared it optional, so the recommendation was not backed by anything. Keep the field optional, since an identifier such as MBA:315 already names its source and the atlas then adds only version detail, and add a warning-level check for the case where the field carries the meaning: an electrodes table that gives locations by name with no anatomical_location_id column. Replace "resolvable identifiers" in the description, which did not say what it meant, with the concrete case of an atlas that publishes region names but no identifiers that can be looked up. Add two electrodes.json examples, one for each case, showing that a column of identifiers can carry a TermURL in the usual way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…lumn Drop anatomical_location_id from electrodes.tsv and probes.tsv, following review. BIDS already documents what the values of a tabular column mean through TermURL and Levels in the sidecar, and the number of distinct structures in any one file is small, so an identifier column duplicates machinery the standard already has. Every other *_id column in BIDS identifies an entity within the dataset rather than carrying an external ontology reference, so the column was also introducing a pattern that does not otherwise exist. The anatomical_location columns stay as plain human readable names, which a curator can fill in without knowing any ontology, and the sidecar carries the identifiers. Rework the ReferenceAtlas check accordingly. It keyed on the absence of the identifier column, and now asks the question directly: locations are given, but the sidecar neither resolves the terms nor names the atlas they came from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…column Drop anatomical_location_id from samples.tsv, matching the change made to the electrode and probe tables in bids-standard#2481. BIDS already documents what the values of a tabular column mean through TermURL and Levels in the sidecar, so the identifier column duplicated machinery the standard already has. Show the sidecar form in the samples.json example. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…es.tsv (#2484) * enh: Extend sample_type and add anatomical location to samples.tsv Follow up on the working group discussion on 2026-07-29 about the samples table. The sample_type enum was taken from ENCODE Biosample Type, which does not describe the samples that microelectrode electrophysiology works with. There was no value for a slice, which is what a patch clamp recording is usually made from, none for the block a slice is cut from, and none for a whole organ, so an extracted brain had to be recorded as a whole organism. Add whole organ, tissue block, tissue slice, single cell, and cell population, using the names openMINDS gives them so that a joint list is easier to arrive at later, and describe the enum as drawing on both sources rather than on ENCODE alone. Add optional anatomical_location and anatomical_location_id columns to samples.tsv. A sample is taken from somewhere, and until now there was no standard column to say where, even though the same information is recorded for probes and electrodes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * enh: Document sample locations with TermURL instead of an identifier column Drop anatomical_location_id from samples.tsv, matching the change made to the electrode and probe tables in #2481. BIDS already documents what the values of a tabular column mean through TermURL and Levels in the sidecar, so the identifier column duplicated machinery the standard already has. Show the sidecar form in the samples.json example. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com>
# Conflicts: # src/modality-specific-files/microelectrode-electrophysiology.md # src/schema/rules/checks/microephys.yaml
|
@bendichter you had two questions for me regarding this PR which I'm going to answer here. 1. Is a free-text method column enough, or should we keep a controlled quality-type field alongside it, given the openMINDS criteria quality types?
|
|
Thanks @lzehl, this is very helpful. On the quality type question, I agree with deferring it. A free-text method column captures what most experimenters can readily provide, and a controlled asserted/processive classification seems like something that should be designed once for BIDS as a whole rather than introduced piecemeal here. I'll leave that to the broader discussion and would also welcome @effigies's take. On the identifiers, thanks for confirming the short forms are correct. One small addendum to the resolvability picture: while I agree that the Allen Institute itself has never minted persistent resolvable identifiers, there is a registered third-party route. The Bioregistry (a community-maintained registry of identifier prefixes for the life sciences, similar in spirit to identifiers.org, that maps compact identifiers like Given that, I plan to keep the example as is, with the Allen atlas viewer URLs as the |
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
05e41b8
into
bids-standard:bep032-review
Implements the decisions we reached in the working group meeting on 2026-07-29 about anatomical location, addressing the threads on Uberon intent and
(estimated|proof)rendering, and following up on #2307 (comment). This targetsbep032-review, so it merges into #2307 rather than into master. It is independent of #2480 and the two do not touch the same lines.probes.tsvassociated_brain_regionandassociated_brain_region_idbecomeanatomical_locationandanatomical_location_id. The columns now describe the probe as a whole, so the structure named there must be one that contains every recording site on the probe, and may be as coarse as the brain or a single hemisphere. The renaming also drops the assumption that a probe is in the brain, which does not hold for a probe placed in peripheral tissue, muscle, or spinal cord.Note that this differs from what I proposed in the comment on #2307. I had suggested reading the probe-level columns as the intended surgical target. The meeting landed somewhere better: the probe-level value is whatever level of anatomical detail actually holds for the whole probe, which is a claim you can make with confidence rather than a statement of intent.
electrodes.tsvlocationbecomesanatomical_location, andanatomical_location_idandlocalization_methodare added. Per-contact localization belongs here, since a long shank probe passes through several structures and only the electrode table can describe that. Putting the identifier here also means that different electrode tables, distinguished by thespace-<label>entity, can carry localizations from different atlases produced by different methods.Removals
associated_brain_region_quality_typeis removed. We could not draw a clear line between itsestimatedandproofvalues in practice, and knowing the actual method, for example whether the location was histologically confirmed, is both more useful and easier to record. The free-textlocalization_methodcolumn replaces it. This also resolves the rendering problem @effigies reported, since the(estimated|proof)notation that was truncating the table is gone.reference_atlasis removed fromprobes.tsv. The atlas is now named in aReferenceAtlasfield in the electrodes sidecar, which is where the terms it applies to live. ALocalizationMethodfield is available in the same sidecar for the case where one method applies to every electrode in the file. Both are optional, and the specification states that the method must not be given in both the column and the sidecar.Ontology Guidance
The guidance no longer prefers species-independent terms. Terms from a species-specific atlas are acceptable and are often the better choice, and identifiers should be resolvable, either as a URI or as a prefixed identifier whose prefix identifies the source. This is what @effigies' question about whether Uberon was required or merely an example was getting at, and the answer is now stated explicitly rather than implied by an example.
Requirement Levels
The two probe columns keep the requirement level of the columns they replace (RECOMMENDED). On the electrodes table,
anatomical_locationkeeps the RECOMMENDED level thatlocationhad, and the two new columns are OPTIONAL, as are both sidecar fields. Happy to adjust if the group would rather set these differently.Verification
bidsschematoolstests pass (81 passed, 1 skipped), as dopre-commiton the changed files andnpm run remark. I confirmed that both the probes and electrodes column tables and the new sidecar table render, and that no references to the removed columns remain anywhere insrc/.One thing worth a second pair of eyes: I updated the example tables to use Allen Mouse Brain Atlas identifiers (
MBA:315for isocortex,MBA:985for MOp,MBA:382for CA1). I believe those structure identifiers are right, but someone who works with the atlas daily should confirm them before this merges.@lzehl, this is the second item from the meeting. The first is #2480.