Skip to content

[ENH] BEP032: Extend sample_type and add anatomical location to samples.tsv - #2484

Open
bendichter wants to merge 2 commits into
bids-standard:bep032-reviewfrom
bendichter:bep032-samples-table
Open

[ENH] BEP032: Extend sample_type and add anatomical location to samples.tsv#2484
bendichter wants to merge 2 commits into
bids-standard:bep032-reviewfrom
bendichter:bep032-samples-table

Conversation

@bendichter

@bendichter bendichter commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Follows up on the working group discussion on 2026-07-29 about the samples table. This targets bep032-review, so it merges into #2307 rather than into master.

Unlike the four preceding items, this one changes modality-agnostic files rather than anything under the microephys datatypes, so it deserves wider scrutiny than the rest of the BEP. Nothing here is specific to electrophysiology, and the gaps it fills were reported independently by the atlas curation work as well.

Extending sample_type

The enum was taken from ENCODE Biosample Type, and it does not describe the samples this BEP deals with. There is 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 has to be recorded as a whole organisms, which it is not.

This adds five values: whole organ, tissue block, tissue slice, single cell, and cell population. The description now says the list draws on ENCODE Biosample Type and on the openMINDS tissue sample types, rather than on ENCODE alone, and notes that further additions may be proposed.

I took only the five values that our discussion actually motivated, not the whole openMINDS list. openMINDS also has biopsy sample, fluid specimen, hemisphere, nerve, and splits cell populations into homogeneous and heterogeneous. Adding all of them is a bigger and more speculative change, and it seemed better to add what we know we need and pursue the joint list separately.

@lzehl, this is the part where you offered to raise a joint list with Tom Gillespie. Nothing here forecloses that. If a joint list comes together, these values can be reconciled with it.

Anatomical Location on samples.tsv

anatomical_location is added as an OPTIONAL column. 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.

It holds a plain human readable name. The ontology or atlas the name comes from is documented in samples.json through TermURL and Levels, in the way BIDS documents any other tabular column, and the example shows that form.

An earlier version of this PR also added an anatomical_location_id column. @effigies pointed out on #2481 that this duplicates machinery the standard already has, and he is right, so it is gone. Every other identifier column in BIDS names an entity within the dataset rather than carrying an external ontology reference, so it would have been introducing a pattern that does not otherwise exist.

The column is defined as anatomical_location__samples so it can carry a sample-appropriate description. That also keeps this PR independent of #2481, which defines the probe and electrode variants. The two can merge in either order.

Verification

bidsschematools tests pass (81 passed, 1 skipped), as do pre-commit on the changed files and npm run remark. I confirmed the extended enum and the new column resolve in the loaded schema and render in the samples table.

The samples.tsv and samples.json examples are updated to show a slice derived from a block, which exercises derived_from and the new values together. The example term resolves to UBERON:0000955 for the brain, chosen because I am confident it is correct rather than because it is the most illustrative.

The other items from the meeting are #2480, #2481, #2482, and #2483.

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>
@bendichter
bendichter requested a review from erdalkaraca as a code owner July 29, 2026 17:29
…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>
@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 (e5bbc22).

Additional details and impacted files
@@              Coverage Diff               @@
##           bep032-review    #2484   +/-   ##
==============================================
  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.

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.

1 participant