Skip to content

[ENH] BEP032: Move anatomical location to the electrode level - #2481

Merged
bendichter merged 8 commits into
bids-standard:bep032-reviewfrom
bendichter:bep032-anatomical-location
Aug 26, 2026
Merged

[ENH] BEP032: Move anatomical location to the electrode level#2481
bendichter merged 8 commits into
bids-standard:bep032-reviewfrom
bendichter:bep032-anatomical-location

Conversation

@bendichter

@bendichter bendichter commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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 targets bep032-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.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 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.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. Putting the identifier here also means that different electrode tables, distinguished by the space-<label> entity, can carry localizations from different atlases produced by different methods.

Removals

associated_brain_region_quality_type is removed. We could not draw a clear line between its estimated and proof values 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-text localization_method column replaces it. This also resolves the rendering problem @effigies reported, since the (estimated|proof) notation that was truncating the table is gone.

reference_atlas is removed from probes.tsv. The atlas is now named in a ReferenceAtlas field in the electrodes sidecar, which is where the terms it applies to live. A LocalizationMethod field 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_location keeps the RECOMMENDED level that location had, and the two new columns are OPTIONAL, as are both sidecar fields. Happy to adjust if the group would rather set these differently.

Verification

bidsschematools tests pass (81 passed, 1 skipped), as do pre-commit on the changed files and npm 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 in src/.

One thing worth a second pair of eyes: I updated the example tables to use Allen Mouse Brain Atlas identifiers (MBA:315 for isocortex, MBA:985 for MOp, MBA:382 for 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.

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>
@bendichter
bendichter requested a review from erdalkaraca as a code owner July 29, 2026 16:30
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.09%. Comparing base (3f661db) to head (b8afb5d).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@effigies effigies left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes. Apologies for the hit and run. Will be out-of-office for the next week.

Comment thread src/modality-specific-files/microelectrode-electrophysiology.md
Comment thread src/modality-specific-files/microelectrode-electrophysiology.md Outdated
Comment thread src/modality-specific-files/microelectrode-electrophysiology.md
Comment thread src/modality-specific-files/microelectrode-electrophysiology.md Outdated
bendichter and others added 3 commits July 29, 2026 13:49
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>
bendichter added a commit to bendichter/bids-specification that referenced this pull request Jul 29, 2026
…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>
CodyCBakerPhD added a commit that referenced this pull request Aug 17, 2026
…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>
Comment thread src/modality-specific-files/microelectrode-electrophysiology.md Outdated
Comment thread src/modality-specific-files/microelectrode-electrophysiology.md Outdated
@bendichter
bendichter requested a review from lzehl August 17, 2026 21:31
@lzehl

lzehl commented Aug 26, 2026

Copy link
Copy Markdown

@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?
The quality type of the localization method is not necessarily inferrable from the provided free-text method (e.g. in particular if the method name is not specific enough). However the question is if we want to encourage/enforce a quick classification according to the quality type (asserted vs processive in openMINDS lingo) or if this is less relevant here/for now. Since this theoretically is a reusable quality assessment across all claimed methods within the BIDS it is maybe worth to not introduce it right now but discuss this in the broader BIDS context (maybe as part of how quality of data, methods, etc is handled in BIDS). @effigies maybe you could provide feedback here ?

  1. And are the Allen MBA identifiers in the examples (MBA:315 isocortex, MBA:985 MOp, MBA:382 CA1) correct?
    These are all correct variants of the short versions of the identifiers for the AMBA brain regions as registered by Allen Institute. However MBA_315 etc is also used in some cases. Problem with Allen Institute is that they actually do not define resolvable, globally unique PIDs to their brain regions and ontology registries built their own wrappers for those (several of those also not directly resolvable). So... not sure if we want to go through all the possibilities of best identification of brain regions? For me the example is efficient enough considering the missing resolvable, globally unique PID. Where region IDs properly resolve is for UBERON parcellations (e.g. http://purl.obolibrary.org/obo/UBERON_0001950).

@bendichter

Copy link
Copy Markdown
Contributor Author

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 mba:985 to resolvable URLs) registers the mba prefix and points it at the purls minted by the BICAN project (https://purl.brain-bican.org/ontology/mbao/MBA_985), which are in turn configured to resolve to the corresponding EBI OLS4 term pages. At the moment the BICAN purl server is misconfigured and every purl redirects to their config repo instead (I filed brain-bican/purl.brain-bican.org#73 about it), so today the form that reliably resolves is the OLS term page itself. This actually illustrates your point about wrapper fragility fairly well.

Given that, I plan to keep the example as is, with the Allen atlas viewer URLs as the TermURL values, since those resolve and land somewhere genuinely informative. The sidecar mechanism in this PR already covers both situations: per-term TermURL where something resolvable exists, and ReferenceAtlas alone where it does not.

Comment thread src/modality-specific-files/microelectrode-electrophysiology.md Outdated
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
@bendichter
bendichter merged commit 05e41b8 into bids-standard:bep032-review Aug 26, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants