Skip to content

Add Ensembl Bacteria tools for bacterial genome queries - #9

Open
citizenlee wants to merge 1 commit into
longevity-genie:mainfrom
citizenlee:feat/ensembl-bacteria-tools
Open

Add Ensembl Bacteria tools for bacterial genome queries#9
citizenlee wants to merge 1 commit into
longevity-genie:mainfrom
citizenlee:feat/ensembl-bacteria-tools

Conversation

@citizenlee

Copy link
Copy Markdown

Summary

  • Adds 3 new bacteria-specific MCP tools (gget_bacteria_species, gget_bacteria_search, gget_bacteria_ref) that query the Ensembl REST API directly, since the gget library explicitly excludes bacteria from search() and ref()
  • New EnsemblBacteriaClient class in ensembl_bacteria.py handles species discovery, gene symbol resolution via xrefs, and FTP URL construction for the collection-based bacterial genome layout
  • Existing gget_info and gget_seq tools already work with bacterial Ensembl IDs — these new tools provide the missing discovery layer

New Tools

Tool Purpose API Used
gget_bacteria_species Find full Ensembl species name from partial input GET /info/genomes/taxonomy/{taxon} + species index fallback
gget_bacteria_search Search bacterial genes by symbol GET /xrefs/symbol/ + POST /lookup/id
gget_bacteria_ref Get FTP download URLs for bacterial reference genomes Species index TSV parsing + FTP directory scraping

Workflow Example

bacteria_species("escherichia coli k-12") → full species name
bacteria_search(["dnaA"], species=full_name) → gene ID "b3702"
gget_info("b3702") → gene metadata (existing tool, works as-is)
gget_seq("b3702") → nucleotide sequence (existing tool, works as-is)
bacteria_ref(species=full_name, which="dna") → FTP URLs for genome FASTA

Test plan

  • 19 integration tests covering species search, gene search, reference URLs, error cases, MCP server wrappers, and end-to-end workflow (all passing against live Ensembl API)
  • Existing test suite passes with no regressions (5/5 in test_gget_simple.py)
  • Verify tools appear correctly when mounted in Cultivarium MCP

🤖 Generated with Claude Code

The gget library excludes bacteria from search() and ref(). This adds
3 new bacteria-specific tools that use the Ensembl REST API directly:

- gget_bacteria_species: Find bacterial species by name or taxonomy ID
- gget_bacteria_search: Search bacterial genes by symbol via xrefs
- gget_bacteria_ref: Get FTP URLs for bacterial reference genomes

Existing gget_info and gget_seq tools already work with bacterial IDs,
so after finding gene IDs with bacteria_search, the full workflow is
supported without any changes to those tools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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