feat: extract brain area anatomy from NWB location fields#1807
Open
bendichter wants to merge 2 commits intomasterfrom
Open
feat: extract brain area anatomy from NWB location fields#1807bendichter wants to merge 2 commits intomasterfrom
bendichter wants to merge 2 commits intomasterfrom
Conversation
Extract brain location values from NWB files (ImagingPlane.location, electrodes.location, IntracellularElectrode.location), match them against bundled Allen Mouse Brain Atlas CCF structures, and populate BioSample.anatomy within wasDerivedFrom. Closes #1806 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Cast json.load() return to explicit type - Use str() for AnyHttpUrl identifier comparisons - Add None-checks before indexing wasDerivedFrom in tests - Add explanatory comments to bare except clauses Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1807 +/- ##
==========================================
+ Coverage 75.12% 75.39% +0.26%
==========================================
Files 84 87 +3
Lines 11925 12282 +357
==========================================
+ Hits 8959 9260 +301
- Misses 2966 3022 +56
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:
|
Member
Author
|
sister PR: NeurodataWithoutBorders/nwbinspector#671 |
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
Closes #1806
ImagingPlane.location,electrodes.location,IntracellularElectrode.location)BioSample.anatomywithin thewasDerivedFromfield using MBAO identifiersNCBITaxon_10090); non-mouse species are skippedNew files
dandi/data/allen_ccf_structures.json— bundled Allen CCF structuresdandi/data/generate_allen_structures.py— regeneration script (python -m dandi.data.generate_allen_structures)dandi/metadata/brain_areas.py— parsing and matching moduledandi/tests/test_brain_areas.py— 29 unit testsModified files
dandi/pynwb_utils.py—_get_brain_locations()extracts location strings from NWBdandi/metadata/util.py—extract_wasDerivedFrom()now adds anatomy to deepest BioSampledandi/tests/test_metadata.py— 3 integration tests for anatomy in wasDerivedFromTest plan
python -m pytest dandi/tests/test_brain_areas.py -v— 29 unit tests passpython -m pytest dandi/tests/test_metadata.py -v -k anatomy— 3 integration tests passpre-commit run --files <all changed files>— all hooks pass🤖 Generated with Claude Code