Query Ensembl for genomic data. Use when user asks about gene coordinates, genomic sequences, variants, gene structure, exons, transcripts, or species comparison. Triggers on "ensembl", "gene coordinates", "genomic location", "exon", "transcript", "variant location", "rsid", "rs number".
npx skills add https://github.com/BioTender-max/awesome-bio-agent-skills --skill query-ensembl
Query the Ensembl REST API for genomic annotations, sequences, and variants.
import requests
import json
BASE_URL = "https://rest.ensembl.org"
HEADERS = {"Content-Type": "application/json", "Accept": "application/json"}
# 1. Gene lookup by symbol
def lookup_gene(symbol, species="homo_sapiens"):
url = f"{BASE_URL}/lookup/symbol/{species}/{symbol}"
r = requests.get(url, headers=HEADERS, params={"expand": 1})
r.raise_for_status()
return r.json()
# 2. Get sequence
def get_sequence(ensembl_id, seq_type="genomic"):
url = f"{BASE_URL}/sequence/id/{ensembl_id}"
r = requests.get(url, headers=HEADERS, params={"type": seq_type})
r.raise_for_status()
return r.json()
# 3. Variant lookup by rsID
def lookup_variant(rsid, species="homo_sapiens"):
url = f"{BASE_URL}/variation/{species}/{rsid}"
r = requests.get(url, headers=HEADERS)
r.raise_for_status()
return r.json()
# 4. Get overlapping features in a region
def overlap_region(species, chrom, start, end, feature="gene"):
url = f"{BASE_URL}/overlap/region/{species}/{chrom}:{start}-{end}"
r = requests.get(url, headers=HEADERS, params={"feature": feature})
r.raise_for_status()
return r.json()
# 5. Cross-species homologs
def get_homologs(ensembl_id, target_species=None):
url = f"{BASE_URL}/homology/id/{ensembl_id}"
params = {}
if target_species:
params["target_species"] = target_species
r = requests.get(url, headers=HEADERS, params=params)
r.raise_for_status()
return r.json()
# Example: look up BRCA2
gene = lookup_gene("BRCA2")
print(f"Gene: {gene['display_name']}")
print(f"Ensembl ID: {gene['id']}")
print(f"Location: chr{gene['seq_region_name']}:{gene['start']}-{gene['end']}")
print(f"Strand: {'+' if gene['strand'] == 1 else '-'}")
print(f"Biotype: {gene['biotype']}")
print(f"Description: {gene.get('description', 'N/A')}")
| Endpoint | Use |
|----------|-----|
| /lookup/symbol/{species}/{symbol} | Gene info by symbol |
| /lookup/id/{id} | Info by Ensembl ID |
| /sequence/id/{id}?type=genomic | Get sequence |
| /variation/{species}/{rsid} | Variant info |
| /overlap/region/{species}/{chr}:{start}-{end} | Features in region |
| /homology/id/{id} | Orthologs/paralogs |
| /vep/{species}/hgvs/{hgvs} | Variant effect prediction |
homo_sapiens, mus_musculus, danio_rerio, drosophila_melanogasterapplication/json Accept headerEfficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.
Access BRENDA enzyme database via SOAP API. Retrieve kinetic parameters (Km, kcat), reaction equations, organism data, and substrate-specific enzyme information for biochemical research and metabolic pathway analysis.
Access ClinPGx pharmacogenomics data (successor to PharmGKB). Query gene-drug interactions, CPIC guidelines, allele functions, for precision medicine and genotype-guided dosing decisions.
Query NCBI ClinVar for variant clinical significance. Search by gene/position, interpret pathogenicity classifications, access via E-utilities API or FTP, annotate VCFs, for genomic medicine.
Access COSMIC cancer mutation database. Query somatic mutations, Cancer Gene Census, mutational signatures, gene fusions, for cancer research and precision oncology. Requires authentication.
Query Ensembl genome database REST API for 250+ species. Gene lookups, sequence retrieval, variant analysis, comparative genomics, orthologs, VEP predictions, for genomic research.
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.
Query NCBI Gene via E-utilities/Datasets API. Search by symbol/ID, retrieve gene info (RefSeqs, GO, locations, phenotypes), batch lookups, for gene annotation and functional analysis.
Take biotender-max/query-ensembl from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.