feat: add UBERON brain anatomy matching for all species#1825
Open
bendichter wants to merge 4 commits intoadd-brain-area-anatomyfrom
Open
feat: add UBERON brain anatomy matching for all species#1825bendichter wants to merge 4 commits intoadd-brain-area-anatomyfrom
bendichter wants to merge 4 commits intoadd-brain-area-anatomyfrom
Conversation
For mice, location tokens are first matched against Allen CCF, then fall back to UBERON. For all other species, UBERON is tried directly. Synonym scope (EXACT, RELATED, NARROW, BROAD) is a settable parameter, defaulting to EXACT only. - Add generate_uberon_structures.py to parse the UBERON OBO file and produce a bundled JSON of ~2,400 nervous-system descendants - Add UBERON lookup/matching functions to brain_areas.py - Update _extract_brain_anatomy in util.py to handle non-mouse species - Add comprehensive tests for UBERON matching and Allen/UBERON fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## add-brain-area-anatomy #1825 +/- ##
==========================================================
+ Coverage 75.34% 75.50% +0.16%
==========================================================
Files 87 88 +1
Lines 12259 12413 +154
==========================================================
+ Hits 9237 9373 +136
- Misses 3022 3040 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Instead of passing a flat set of scopes, use a max_synonym_scope parameter (default "EXACT"). Matching tries tiers in precision order: EXACT > NARROW > BROAD > RELATED, up to the specified maximum. Term names are always tried first before any synonym tier. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Thread the scope parameter through so callers can control how permissive UBERON synonym matching is. Defaults to EXACT. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
frozenset[str]), defaulting to EXACT onlyNew files
dandi/data/generate_uberon_structures.py— downloads and parsesuberon.obo, extracts nervous system descendantsdandi/data/uberon_brain_structures.json— bundled lookup data (2,408 structures, 9,717 synonyms)Modified files
dandi/metadata/brain_areas.py— UBERON loading, lookup, and matching functions;locations_to_mouse_anatomy()with Allen→UBERON fallbackdandi/metadata/util.py—_extract_brain_anatomy()now handles all speciesdandi/tests/test_brain_areas.py— tests for UBERON matching, synonym scope control, and Allen/UBERON fallback.pre-commit-config.yaml,pyproject.toml— codespell exclusions for new JSONTest plan
🤖 Generated with Claude Code