feat: add ncbi taxonomy information to database#23
Merged
Conversation
…e or else o.bpa_sci.._name
emilylm
marked this pull request as ready for review
May 18, 2026 12:56
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
This PR adds NCBI taxonomy enrichment support to the API and updates the organism/taxonomy data model to separate BPA-supplied organism fields from NCBI-derived taxonomy fields.
It introduces the NCBI lookup service, stores fetched taxonomy details on
taxonomy_info, updates the relevant models and schemas, and adds bulk-import support plus validation and tests around the new behavior.We also re-set 0001-initial-schema.sql and clear previous db migrations
🔄 Type of Change
🧩 Key Changes
taxonomy_infoand rename organism source fields tobpa_*.ncbi_taxonomy_serviceto fetch and map taxonomy details from the NCBI Datasets API, including lineage enrichment andmito_ref. This code is largely across from https://github.com/emilylm/tutorial-fetch-ncbi-data/blob/main/src/parent_lineage_enrichment.pytaxonomy_infocreate and bulk-import flows to fetch and persist NCBI taxonomy details, with bulk import using batched lookups.ncbi_*fields are not accepted from callers, including a typed bulk taxonomy-info import schema.✅ Checklist
🔍 Review Notes
bpa_*names.📎 Related Issues / Tickets