scientific-skills/Evidence Insights/ena-database/SKILL.md
Access the European Nucleotide Archive (ENA) via REST APIs and FTP/Aspera to search and retrieve sequences, raw reads (FASTQ), assemblies, and metadata when you have accession IDs or need metadata-driven discovery for genomics pipelines.
npx skillsauth add aipoch/medical-research-skills ena-databaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when you need to:
ERR..., SRR..., PRJ...).For detailed endpoint and parameter documentation, see
references/api_reference.md.
>=3.9requests >=2.31.0Optional (recommended for XML parsing when using the Browser API):
lxml >=4.9.0The following script is a complete, runnable example that:
#!/usr/bin/env python3
import sys
import time
import requests
PORTAL_SEARCH = "https://www.ebi.ac.uk/ena/portal/api/search"
BROWSER_XML = "https://www.ebi.ac.uk/ena/browser/api/xml"
TAXONOMY = "https://www.ebi.ac.uk/ena/taxonomy/rest"
SESSION = requests.Session()
SESSION.headers.update({"User-Agent": "ena-database-skill/1.0"})
def get_with_backoff(url, params=None, max_retries=6, timeout=30):
delay = 1.0
for attempt in range(max_retries):
r = SESSION.get(url, params=params, timeout=timeout)
if r.status_code != 429:
r.raise_for_status()
return r
time.sleep(delay)
delay *= 2
r.raise_for_status()
def search_runs_by_study(study_accession, limit=5):
params = {
"result": "read_run",
"query": f"study_accession={study_accession}",
"format": "json",
"limit": limit,
# Ask for a few useful fields; adjust as needed for your pipeline.
"fields": "run_accession,study_accession,sample_accession,experiment_accession,tax_id,scientific_name,fastq_ftp"
}
r = get_with_backoff(PORTAL_SEARCH, params=params)
return r.json()
def fetch_run_xml(run_accession):
url = f"{BROWSER_XML}/{run_accession}"
r = get_with_backoff(url)
return r.text # XML string
def fetch_taxonomy_lineage(tax_id):
url = f"{TAXONOMY}/tax-id/{tax_id}"
r = get_with_backoff(url)
return r.json()
def main():
if len(sys.argv) < 2:
print("Usage: python ena_example.py <STUDY_ACCESSION> (e.g., PRJEB1234)", file=sys.stderr)
sys.exit(2)
study = sys.argv[1]
runs = search_runs_by_study(study_accession=study, limit=5)
if not runs:
print(f"No runs found for study {study}")
return
print(f"Found {len(runs)} runs for study {study}")
first = runs[0]
run_acc = first.get("run_accession")
tax_id = first.get("tax_id")
print("\nFirst run summary (Portal API JSON):")
for k in ["run_accession", "sample_accession", "experiment_accession", "scientific_name", "tax_id", "fastq_ftp"]:
print(f" {k}: {first.get(k)}")
if run_acc:
xml = fetch_run_xml(run_acc)
print("\nBrowser API XML (first 600 chars):")
print(xml[:600])
if tax_id:
tax = fetch_taxonomy_lineage(tax_id)
print("\nTaxonomy lineage (ENA Taxonomy REST API):")
# Response is typically a list with one record
rec = tax[0] if isinstance(tax, list) and tax else tax
print(f" scientificName: {rec.get('scientificName')}")
print(f" rank: {rec.get('rank')}")
print(f" lineage: {rec.get('lineage')}")
if __name__ == "__main__":
main()
Run:
python ena_example.py PRJEB1234
ENA organizes records into common object types used in pipelines:
/ena/portal/api/search): use for searching and exporting metadata at scale.
json, tsv, csv.references/api_reference.md)./ena/browser/api/xml/{accession}): use for direct retrieval by accession.
/ena/taxonomy/rest/...): use for lineage/rank lookups.https://www.ebi.ac.uk/ena/xref/rest/ for related records in external databases.https://www.ebi.ac.uk/ena/cram/ for reference sequence retrieval by checksum.result: record type (e.g., sample, read_run, assembly)query: filter expression (e.g., study_accession=PRJEB1234, tax_tree(Escherichia coli))fields: comma-separated fields to return (improves performance vs returning everything)format: json/tsv/csvlimit (and pagination where applicable)fastq_ftp) from Portal results, then download via FTP/Aspera for scale.tools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.