← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-database-access-ensembl-rest / references / usage-guide.md

Ensembl REST Usage Guide

Overview

Query Ensembl's REST API for gene/transcript/protein lookup, sequence retrieval, Compara orthologs, VEP variant annotation, regulatory features, and LD. Encodes: the 15 req/sec rate limit (55K/hour); version-pinned archive endpoints (https://e110.rest.ensembl.org) for reproducibility; symbol-vs-Ensembl-ID stability (resolve symbol to ID once, then query by ID); Ensembl divisions (vertebrates main host vs Ensembl Genomes for plants/fungi/metazoa/bacteria); and the defection rules (BioMart for >5K queries; local VEP for bulk variant annotation).

Prerequisites

pip install requests

No API key required. Respect Retry-After on 429.

Quick Start

Example Prompts

Resolve to stable ID first

"Don't use gene symbols in downstream queries -- HGNC renames break workflows (MARCH1 -> MARCHF1 in 2020). Resolve via /lookup/symbol/human/BRCA1 once, persist the Ensembl Gene ID (ENSG...), and use ID-based endpoints from then on."

Version pinning

"I'm writing a paper. Pin all Ensembl REST calls to https://e110.rest.ensembl.org so re-running in 2030 returns the same gene models. Live https://rest.ensembl.org follows the current release and drifts."

VEP for ad hoc variants

"Annotate this single variant (chr17:41276135 T>G) with VEP. Use /vep/human/region/17:41276135-41276135:1/G. For bulk (>1K variants), download VEP and run locally -- REST rate limit makes bulk infeasible."

Compara orthologs

"Get all Compara orthologs of human BRCA1 across mouse and zebrafish. Use /homology/symbol/human/BRCA1?type=orthologues. Filter by target_species and ortholog_one2one for high-confidence calls."

Overlap query

"What genes are in chr17:43000000-43200000? Use /overlap/region/human/{region}?feature=gene. For multiple feature types, repeat with feature=transcript, feature=regulatory, etc."

Non-vertebrate

"For Arabidopsis or fungi, switch to rest.ensemblgenomes.org -- the main rest.ensembl.org host is vertebrates only."

What the Agent Will Do

  1. Always resolve gene symbol to Ensembl Gene ID at pipeline start; use IDs downstream.
  2. Pin to an archive endpoint (e110, e111, etc.) for any reproducible analysis.
  3. Respect 15 req/sec rate limit; sleep 0.07s between calls; handle 429 with Retry-After.
  4. For >5,000 queries, recommend BioMart bulk export (separate skill).
  5. For >1,000 variant annotations, recommend local VEP install.
  6. For non-vertebrates, switch to rest.ensemblgenomes.org host.
  7. Use ID-based endpoints over symbol-based for any persistent code.
  8. Document the pinned release in pipeline metadata.

Tips