ensembl-annotation
Query the Ensembl REST API for regulatory feature annotations, variant effect prediction (VEP), coordinate liftover, gene lookups, and cross-references. Use when the user needs to annotate variants with VEP (consequence, CADD, REVEL, SpliceAI), check Ensembl Regulatory Build over
Install
npx skills add https://github.com/ammawla/encode-toolkit/tree/main/plugin/skills/ensembl-annotation
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install ammawla-encode-toolkit@llmmart
git clone https://github.com/ammawla/encode-toolkit.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole ammawla/encode-toolkit collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Query the Ensembl REST API
When to Use
- User wants to annotate variants with Ensembl VEP (Variant Effect Predictor) consequences
- User asks about "VEP", "Ensembl", "variant annotation", "regulatory build", or "gene annotation"
- User needs to convert coordinates between assemblies using Ensembl's liftover API
- User wants to check the Ensembl Regulatory Build for overlap with ENCODE elements
- Example queries: "run VEP on my variant list", "annotate SNPs with regulatory consequences", "check Ensembl regulatory build for my peaks"
Annotate variants, look up regulatory features, convert coordinates, and resolve gene identifiers using the Ensembl REST API.
Scientific Rationale
The question: "What does the Ensembl Regulatory Build say about this region, and what is the predicted effect of this variant?"
The Ensembl Regulatory Build integrates ENCODE, Roadmap Epigenomics, and Blueprint data into a unified annotation of regulatory features across human cell types. The Variant Effect Predictor (VEP) is the standard tool for variant consequence prediction, integrating 50+ annotation sources including CADD, REVEL, SpliceAI, and AlphaMissense.
Ensembl ↔ ENCODE Feedback Loop
Ensembl's Regulatory Build incorporates ENCODE ChIP-seq, DNase-seq, and CTCF data to define regulatory features. Querying Ensembl after an ENCODE analysis provides an independent, aggregated view of regulatory annotations — often including data from non-ENCODE sources (Blueprint, Roadmap) that may cover biosamples not in ENCODE.
Literature Support
- Cunningham et al. 2022 (Nucleic Acids Research): Ensembl 2022 update. DOI
- McLaren et al. 2016 (Genome Biology, ~4,500 citations): The Ensembl Variant Effect Predictor. DOI
- Zerbino et al. 2015 (Genome Biology): The Ensembl Regulatory Build. DOI
API Reference
Base URL: https://rest.ensembl.org
Authentication: None required
Rate limit: Reasonable use expected; max 5Mb region queries
Formats: JSON (default), XML, GFF3, BED
Current version: Ensembl 114
Add content-type: application/json header to all requests.
Step 1: Regulatory Feature Overlap
Query what regulatory features the Ensembl Regulatory Build assigns to a region:
# Get regulatory features in a region
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/overlap/region/human/7:140424943-140624564?feature=regulatory"
# Also get TF binding motifs
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/overlap/region/human/7:140424943-140624564?feature=regulatory;feature=motif"
Regulatory Feature Types
| Type | Description | ENCODE Equivalent |
|---|---|---|
| Promoter | Active promoter region | cCRE PLS |
| Enhancer | Active enhancer region | cCRE pELS/dELS |
| Open chromatin | Accessible region without H3K27ac | DNase-only sites |
| CTCF binding site | CTCF-occupied region | cCRE CTCF-only |
| TF binding site | Other TF binding | TF ChIP-seq peaks |
| Promoter flanking | Region flanking a promoter | cCRE TssAFlnk |
Step 2: Variant Effect Prediction (VEP)
VEP provides consequence predictions for variants:
Single Variant (by region notation)
# VEP annotation for a variant
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/vep/human/region/9:22125503-22125502:1/C"
# By rs ID
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/vep/human/id/rs699"
Batch VEP (POST, up to 200 variants)
curl -X POST -H "Content-type: application/json" \
"https://rest.ensembl.org/vep/human/region" \
-d '{"variants": ["1 230710048 . A G . . .", "2 241533886 . T C . . ."]}'
Key VEP Parameters
| Parameter | Description | Default |
|---|---|---|
CADD=1 |
Include CADD scores | Off |
Enformer=1 |
Include Enformer predictions | Off |
AlphaMissense=1 |
Include AlphaMissense pathogenicity | Off |
REVEL=1 |
Include REVEL scores | Off |
SpliceAI=1 |
Include SpliceAI splicing predictions | Off |
regulatory=1 |
Include regulatory feature overlap | Off |
cell_type= |
Cell type for regulatory annotations | All |
VEP Consequence Hierarchy (most to least severe)
| Consequence | Impact | Description |
|---|---|---|
transcript_ablation |
HIGH | Deletion of entire transcript |
splice_donor_variant |
HIGH | Essential splice donor site |
stop_gained |
HIGH | Premature stop codon |
frameshift_variant |
HIGH | Reading frame change |
missense_variant |
MODERATE | Amino acid change |
splice_region_variant |
LOW | Near splice site |
synonymous_variant |
LOW | No amino acid change |
regulatory_region_variant |
MODIFIER | In regulatory element |
intergenic_variant |
MODIFIER | Between genes |
For ENCODE regulatory variants: Most will be classified as regulatory_region_variant (MODIFIER impact). The VEP consequence alone does not capture regulatory impact — combine with ENCODE cCRE class, tissue activity, and TF disruption data.
Step 3: Coordinate Conversion (LiftOver)
Convert between GRCh37 (hg19) and GRCh38 (hg38):
# GRCh37 → GRCh38
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/map/human/GRCh37/17:1000000..1000100:1/GRCh38"
# GRCh38 → GRCh37
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/map/human/GRCh38/17:1000000..1000100:1/GRCh37"
When needed: Older GWAS studies report variants on GRCh37. ENCODE data uses GRCh38. Always liftOver before intersecting.
Step 4: Gene Lookup and Cross-References
Gene Information
# By Ensembl ID
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/lookup/id/ENSG00000157764?expand=1"
# By symbol
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/lookup/symbol/homo_sapiens/BRAF"
Cross-References (Ensembl ↔ External DBs)
# Get all external references for a gene
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/xrefs/id/ENSG00000157764"
# Filter by external DB
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/xrefs/id/ENSG00000157764?external_db=HGNC"
ENCODE integration: ENCODE target names are typically HGNC symbols or Ensembl IDs. Use this endpoint to resolve between identifier systems.
Step 5: Phenotype/Disease Associations
# Get phenotype associations for a gene
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/phenotype/gene/homo_sapiens/BRCA2"
# Get phenotype associations for a region
curl -H "Content-type: application/json" \
"https://rest.ensembl.org/phenotype/region/homo_sapiens/9:22125500-22136000"
Integrated ENCODE + Ensembl Workflow
1. Find ENCODE regulatory variants:
→ Intersect GWAS variants with ENCODE cCREs
2. Annotate with VEP:
curl "https://rest.ensembl.org/vep/human/id/rs699?CADD=1;regulatory=1;REVEL=1"
→ Get consequence, CADD score, regulatory overlap
3. Check Ensembl Regulatory Build for independent confirmation:
curl "https://rest.ensembl.org/overlap/region/human/CHR:START-END?feature=regulatory"
→ Compare with ENCODE cCRE classification
4. If working with GRCh37 data, liftOver:
curl "https://rest.ensembl.org/map/human/GRCh37/CHR:POS..POS:1/GRCh38"
5. Resolve gene identifiers for ENCODE targets:
curl "https://rest.ensembl.org/lookup/symbol/homo_sapiens/GENE_SYMBOL"
6. Check disease associations:
curl "https://rest.ensembl.org/phenotype/gene/homo_sapiens/GENE"
Pitfalls and Caveats
- Ensembl Regulatory Build ≠ ENCODE cCREs: The Regulatory Build incorporates ENCODE data but uses different classification criteria. Annotations may not perfectly overlap with ENCODE cCRE calls.
- VEP MODIFIER impact for regulatory variants: Non-coding regulatory variants are classified as MODIFIER impact by default. This does NOT mean low importance — it means VEP cannot assess regulatory consequence from sequence alone. Combine with ENCODE data.
- Region size limits: Overlap queries limited to ~5Mb regions. For genome-wide analysis, download Ensembl GFF files or use the Perl VEP tool locally.
- Batch VEP limit: REST API accepts max 200 variants per POST request. For larger sets, use the standalone VEP tool.
- GRCh38/GRCh37 consistency: Always match assembly between ENCODE data and Ensembl queries. Use the liftOver endpoint when needed.
- Version updates: Ensembl releases quarterly. Regulatory Build annotations may change between versions. Note the Ensembl version in your analysis.
Walkthrough: Variant Effect Prediction for ENCODE Regulatory Variants
Goal: Use Ensembl VEP to predict functional consequences of variants located within ENCODE-defined regulatory elements, combining variant annotation with regulatory context. Context: Ensembl provides the gold-standard Variant Effect Predictor (VEP) and Regulatory Build. Combined with ENCODE peaks, this enables comprehensive variant interpretation.
Step 1: Find ENCODE experiments for the tissue of interest
encode_search_experiments(assay_title="ATAC-seq", organ="brain", organism="Homo sapiens")
Expected output:
{
"results": [
{"accession": "ENCSR800BRN", "assay_title": "ATAC-seq", "biosample_summary": "brain tissue male adult (54 years)", "assembly": ["GRCh38"], "status": "released"}
],
"total": 32,
"limit": 25,
"offset": 0,
"has_more": true,
"next_offset": 25
}
Step 2: Download peaks and extract variants
encode_download_files(file_accessions=["ENCFF900ATK"], download_dir="/data/brain_atac")
Step 3: Run VEP on regulatory variants
Using Ensembl REST API (via skill guidance):
POST https://rest.ensembl.org/vep/human/region
Content-Type: application/json
{"variants": ["1 230710048 . A G", "7 87160618 . T C"]}
Expected VEP output:
[
{
"input": "1 230710048 . A G",
"most_severe_consequence": "regulatory_region_variant",
"regulatory_feature_consequences": [
{
"regulatory_feature_id": "ENSR00000123456",
"biotype": "promoter",
"consequence_terms": ["regulatory_region_variant"]
}
]
}
]
Interpretation: VEP classifies this as a regulatory_region_variant in an Ensembl Regulatory Build promoter. Cross-referencing with the ENCODE ATAC-seq peak confirms the variant is in open chromatin in brain tissue.
Step 4: Liftover if needed
If ENCODE peaks are in GRCh38 but variants are in hg19:
- Use → liftover-coordinates to convert variant positions before intersection
- Or use Ensembl REST API liftover endpoint
Step 5: Integrate Ensembl Regulatory Build with ENCODE peaks
GET https://rest.ensembl.org/regulatory/species/homo_sapiens/id/ENSR00000123456
Interpretation: Compare Ensembl Regulatory Build activity with ENCODE experimental data. If the Regulatory Build calls a region a "promoter" and ENCODE H3K4me3 ChIP-seq confirms this, the annotation is high confidence.
Integration with downstream skills
- ENCODE peaks define regions to annotate via → VEP regulatory consequence prediction
- VEP results feed into → variant-annotation for multi-source annotation
- Regulatory Build comparisons inform → regulatory-elements cCRE classification
- Gene consequence predictions connect to → gtex-expression for expression validation
- Coordinate conversions handled by → liftover-coordinates for cross-assembly work
Code Examples
1. Find ENCODE data for an Ensembl-annotated gene
# Step 1: Identify the gene's regulatory neighborhood
# (via Ensembl REST API — see skill instructions)
# Step 2: Search ENCODE for ChIP-seq at the gene locus
encode_search_experiments(
assay_title="Histone ChIP-seq",
organ="liver",
target="H3K27ac"
)
Expected output:
{
"results": [
{
"accession": "ENCSR123ABC",
"assay_title": "Histone ChIP-seq",
"target": "H3K27ac-human",
"biosample_summary": "liver tissue male adult (54 years)"
}
],
"total": 8,
"limit": 25,
"offset": 0,
"has_more": false,
"next_offset": null
}
2. Track and cross-reference an annotated experiment
encode_track_experiment(
accession="ENCSR123ABC",
notes="Liver H3K27ac for VEP-annotated enhancer variants"
)
Expected output:
{
"tracking": {"accession": "ENCSR123ABC", "action": "tracked"},
"publications_found": 1,
"publications": [
{
"pmid": "32728249",
"doi": "10.1038/s41586-020-2493-4",
"title": "An atlas of gene regulatory elements in adult human liver",
"authors": "Li YE, Preissl S, Hou X",
"journal": "Nature",
"year": "2020",
"abstract": ""
}
],
"pipelines_found": 1,
"pipelines": [
{"title": "Histone ChIP-seq 2 (unreplicated)", "version": "1.7.1", "software": [{"name": "bowtie2", "version": "2.3.4.3"}], "status": "released"}
]
}
Integration
| This skill produces... | Feed into... | Using tool/skill |
|---|---|---|
| VEP-annotated variant list | Regulatory variant filtering | variant-annotation skill |
| Gene annotations with coordinates | Peak-to-gene assignment | peak-annotation skill |
| Lifted-over coordinates (GRCh37→38) | ENCODE data integration | liftover-coordinates skill |
| Regulatory Build overlap results | Enhancer/promoter classification | regulatory-elements skill |
| Gene constraint scores | Target prioritization | cross-reference → Open Targets |
Related Skills
| Skill | When to Use Instead/Additionally |
|---|---|
variant-annotation |
Full ENCODE-based post-GWAS workflow |
gnomad-variants |
Population frequency and constraint data for variants |
regulatory-elements |
ENCODE cCRE classification and chromatin state analysis |
ucsc-browser |
UCSC-hosted ENCODE tracks and sequence retrieval |
disease-research |
Connecting variants to disease mechanisms |
cross-reference |
General external database cross-referencing |
publication-trust |
Verify literature claims backing analytical decisions |
Presenting Results
- Present gene annotations as: gene | ensembl_id | biotype | chr:start-end | strand. Include transcript count. Suggest: "Would you like to check expression in GTEx for these genes?"
For the request: "$ARGUMENTS"
Files (encode-toolkit)
-
references
-
literature.md 10.6 KB
# Ensembl Annotation — Literature References **Last updated:** 2026-03-07 **Purpose:** Reference catalog for the ensembl-annotation skill — key papers informing genome annotation, variant effect prediction, regulatory build resources, and programmatic access to the Ensembl project infrastructure. --- ## Core Ensembl Releases --- ### Cunningham et al. 2022 — Ensembl 2022: comprehensive genome annotation - **Citation:** Cunningham F, Allen JE, Allen J, Alvarez-Jarreta J, Amode MR, Armean IM, Austine-Orimoloye O, Azov AG, Barnes I, Bennett R, et al. Ensembl 2022. Nucleic Acids Research, 50(D1):D988-D995, 2022. - **DOI:** [10.1093/nar/gkab1049](https://doi.org/10.1093/nar/gkab1049) - **PMID:** 34791404 | **PMC:** PMC8728283 - **Citations:** ~1,000 - **Key findings:** Ensembl 2022 annotated 273 vertebrate genomes with production-quality gene models, regulatory annotations, and comparative genomics data through its combined Havana (manual curation) and Ensembl (automated prediction) pipeline. The human annotation (GENCODE v39) included 61,544 genes (19,957 protein-coding), 241,544 transcripts, and 1.4 million regulatory features from the Ensembl Regulatory Build integrating ENCODE Phase III data. Key updates included improved non-coding RNA annotation using Rfam classification, the expanded MANE (Matched Annotation from NCBI and EMBL-EBI) Select transcript set providing one agreed-upon representative transcript per protein-coding gene, and enhanced variant consequence prediction through VEP. The Ensembl gene annotation pipeline remains the reference standard for GRCh38 genome annotation, providing the coordinate framework that all ENCODE experiments use for peak-to-gene mapping, TSS definitions, and genomic feature classification. --- ### Yates et al. 2020 — Ensembl 2020: enabling non-vertebrate genomics research - **Citation:** Yates AD, Achuthan P, Akanni W, Allen J, Allen J, Alvarez- Jarreta J, Amode MR, Armean IM, Azov AG, Bennett R, et al. Ensembl 2020. Nucleic Acids Research, 48(D1):D682-D688, 2020. - **DOI:** [10.1093/nar/gkz966](https://doi.org/10.1093/nar/gkz966) - **PMID:** 31691826 | **PMC:** PMC7145704 - **Citations:** ~700 - **Key findings:** Ensembl 2020 introduced Ensembl Rapid Release, a system for rapidly annotating newly assembled genomes without waiting for the full production cycle (which can take months), enabling timely gene model availability for emerging reference genomes. Deepened integration with the UniProt protein knowledge base through automatic cross-referencing of Ensembl transcript predictions with experimentally characterized protein sequences. Updated the pan-compara analysis to cover 296 species with improved gene tree inference and synteny detection, enabling orthology-based annotation transfer for species without direct experimental evidence. For ENCODE users, the key enhancement was improved MANE transcript selection — providing definitive transcript identifiers agreed upon by both Ensembl/GENCODE and NCBI RefSeq for unambiguous gene-level interpretation of regulatory data, resolving the long-standing confusion when different databases use different "canonical" transcripts for the same gene. --- ### Howe et al. 2021 — Ensembl 2021: rapid release and new vertebrate genomes - **Citation:** Howe KL, Achuthan P, Allen J, Allen J, Alvarez-Jarreta J, Amode MR, Armean IM, Azov AG, Bennett R, Bhai J, et al. Ensembl 2021. Nucleic Acids Research, 49(D1):D884-D891, 2021. - **DOI:** [10.1093/nar/gkaa942](https://doi.org/10.1093/nar/gkaa942) - **PMID:** 33137190 | **PMC:** PMC7778937 - **Citations:** ~800 - **Key findings:** Ensembl 2021 annotated 238 vertebrate genomes with production-quality gene models and launched Ensembl Rapid Release covering 311 additional species for a total of 549 species with gene annotations. Expanded the MANE Select set to cover >97% of human protein-coding genes (19,062 of 19,399), providing definitive transcript identifiers for clinical variant reporting and enabling consistent gene-level quantification across studies. Updated the coordinate liftover service with improved chain files for GRCh37-to-GRCh38 conversion, addressing persistent issues with ENCODE datasets generated on the older hg19/GRCh37 assembly that need to be mapped to the current GRCh38 reference. Introduced integrated gene pages unifying structural annotation, regulatory features, genetic variation, comparative genomics, and tissue-specific expression data into a single gene-centric view. --- ### Martin et al. 2023 — Ensembl 2023: T2T integration and pangenome support - **Citation:** Martin FJ, Amode MR, Anber A, Apweiler R, Arkinson RG, et al. Ensembl 2023. Nucleic Acids Research, 51(D1):D933-D941, 2023. - **DOI:** [10.1093/nar/gkac958](https://doi.org/10.1093/nar/gkac958) - **PMID:** 36318249 | **PMC:** PMC9825606 - **Citations:** ~400 - **Key findings:** Ensembl 2023 incorporated the T2T-CHM13 assembly — the first truly complete, gapless human genome sequence — alongside GRCh38, enabling variant annotation, regulatory feature mapping, and gene model annotation on both reference assemblies. T2T-CHM13 added ~200 Mb of previously unresolved sequence including centromeres, telomeres, and segmental duplications, revealing new genes and regulatory elements in regions invisible to ENCODE experiments mapped against GRCh38. Expanded the Regulatory Build to integrate ENCODE Phase IV data with enhanced cell-type coverage and improved chromatin state assignments. Introduced Ensembl Tark (Transcript Archive) for tracking transcript model changes across Ensembl releases — essential for reproducibility when revisiting historical ENCODE analyses where gene model updates could change peak-to-gene annotations. Also began pangenome graph integration for representing human population structural diversity beyond single linear references. --- ## Variant Effect Prediction --- ### McLaren et al. 2016 — Variant Effect Predictor (VEP) - **Citation:** McLaren W, Gil L, Hunt SE, Riat HS, Ritchie GRS, Thormann A, Flicek P, Cunningham F. The Ensembl Variant Effect Predictor. Genome Biology, 17(1):122, 2016. - **DOI:** [10.1186/s13059-016-0974-4](https://doi.org/10.1186/s13059-016-0974-4) - **PMID:** 27268795 | **PMC:** PMC4893825 - **Citations:** ~4,500 - **Key findings:** VEP annotates genetic variants with predicted functional consequences using Ensembl gene models, assigning standardized Sequence Ontology (SO) terms ranked by severity: transcript ablation and splice acceptor/donor variants (most severe), through frameshift, missense, and synonymous variants, to regulatory region and intergenic variants (least severe). Integrates pluggable pathogenicity prediction algorithms including SIFT (sequence-based), PolyPhen-2 (structure-based), CADD (combined annotation-dependent depletion), and REVEL (ensemble method), providing multiple complementary evidence streams for each variant. VEP maps variants to overlapping regulatory features from the Ensembl Regulatory Build, annotating whether a variant falls in a promoter, enhancer, CTCF site, or open chromatin region — directly integrating ENCODE-derived regulatory annotations into variant interpretation. For non-coding variants, VEP reports the regulatory feature stable ID and cell-type activity status, enabling researchers to determine whether a variant disrupts a regulatory element that is active in disease-relevant cell types. The plugin architecture supports custom annotation sources (ClinVar, gnomAD, ENCODE- specific tracks), processing millions of variants per run from standard VCF input. --- ## Regulatory Annotation --- ### Zerbino et al. 2018 — The Ensembl Regulatory Build - **Citation:** Zerbino DR, Wilder SP, Johnson N, Juettemann T, Flicek P. The Ensembl Regulatory Build. Genome Biology, 16(1):56, 2015. - **DOI:** [10.1186/s13059-015-0621-5](https://doi.org/10.1186/s13059-015-0621-5) - **PMID:** 25887522 | **PMC:** PMC4407537 - **Citations:** ~800 - **Key findings:** Described the Ensembl Regulatory Build computational pipeline that integrates ENCODE and Roadmap Epigenomics data to annotate functional regulatory features across human and mouse genomes. The pipeline uses histone modification ChIP-seq (H3K4me3, H3K4me1, H3K27ac, H3K36me3), DNase-seq/ATAC-seq, CTCF ChIP-seq, and TF ChIP-seq to segment the genome into regulatory feature categories: promoters (H3K4me3 + H3K27ac near TSS), enhancers (H3K4me1 + H3K27ac distal from TSS), CTCF binding sites (CTCF ChIP-seq + characteristic motif), open chromatin regions (DHS/ATAC without histone marks), and TF binding sites (TF ChIP-seq peaks). Each regulatory feature is assigned cell-type-specific activity states (active, poised, repressed, inactive, NA) based on the pattern of histone marks observed in each profiled cell type. The Regulatory Build provides the unified regulatory annotation layer used by VEP for variant consequence prediction, translating raw ENCODE experimental data into functional categories interpretable by clinical geneticists and disease researchers. --- ## Programmatic Access --- ### Hunt et al. 2018 — Ensembl variation resources and REST API - **Citation:** Hunt SE, McLaren W, Gil L, Thormann A, Schuilenburg H, Sheppard D, Parton A, Armean IM, Trevanion SJ, Flicek P, Cunningham F. Ensembl variation resources. Database, 2018:bay119, 2018. - **DOI:** [10.1093/database/bay119](https://doi.org/10.1093/database/bay119) - **PMID:** 30576484 | **PMC:** PMC6305438 - **Citations:** ~300 - **Key findings:** Documented the Ensembl REST API (rest.ensembl.org) endpoints for variant annotation, coordinate conversion, sequence retrieval, and regulatory feature lookup that the ensembl-annotation skill uses for programmatic data access. Key endpoints include: /vep/{species}/region (batch variant effect prediction), /overlap/region/{species}/{region} (features overlapping a genomic region), /lookup/id/{id} (gene/transcript metadata by Ensembl ID), /sequence/region/{species}/{region} (genomic sequence retrieval), and /regulatory/species/{species}/id/{id} (regulatory feature details). The API supports JSON and XML response formats with rate limiting at 15 requests/second for anonymous users and 55/second with registered API keys. For large-scale annotation tasks (>1,000 variants), the paper recommends batch VEP submission via POST request or local VEP installation with cached databases. The REST API enables real-time Ensembl queries without requiring local database installation, making it the preferred access method for the ensembl-annotation skill's on-demand annotation workflows. ---
-
-
SKILL.md 15 KB
--- name: ensembl-annotation description: Query the Ensembl REST API for regulatory feature annotations, variant effect prediction (VEP), coordinate liftover, gene lookups, and cross-references. Use when the user needs to annotate variants with VEP (consequence, CADD, REVEL, SpliceAI), check Ensembl Regulatory Build overlap for ENCODE regions, convert coordinates between GRCh37 and GRCh38, resolve gene IDs (Ensembl ↔ symbol ↔ RefSeq), look up gene phenotype associations, or cross-reference ENCODE targets with Ensembl annotations. Also use when the user mentions Ensembl, VEP, variant effect predictor, liftover, assembly conversion, regulatory build, gene lookup, or cross-references between databases. --- # Query the Ensembl REST API ## When to Use - User wants to annotate variants with Ensembl VEP (Variant Effect Predictor) consequences - User asks about "VEP", "Ensembl", "variant annotation", "regulatory build", or "gene annotation" - User needs to convert coordinates between assemblies using Ensembl's liftover API - User wants to check the Ensembl Regulatory Build for overlap with ENCODE elements - Example queries: "run VEP on my variant list", "annotate SNPs with regulatory consequences", "check Ensembl regulatory build for my peaks" Annotate variants, look up regulatory features, convert coordinates, and resolve gene identifiers using the Ensembl REST API. ## Scientific Rationale **The question**: "What does the Ensembl Regulatory Build say about this region, and what is the predicted effect of this variant?" The Ensembl Regulatory Build integrates ENCODE, Roadmap Epigenomics, and Blueprint data into a unified annotation of regulatory features across human cell types. The Variant Effect Predictor (VEP) is the standard tool for variant consequence prediction, integrating 50+ annotation sources including CADD, REVEL, SpliceAI, and AlphaMissense. ### Ensembl ↔ ENCODE Feedback Loop Ensembl's Regulatory Build incorporates ENCODE ChIP-seq, DNase-seq, and CTCF data to define regulatory features. Querying Ensembl after an ENCODE analysis provides an independent, aggregated view of regulatory annotations — often including data from non-ENCODE sources (Blueprint, Roadmap) that may cover biosamples not in ENCODE. ### Literature Support - **Cunningham et al. 2022** (Nucleic Acids Research): Ensembl 2022 update. [DOI](https://doi.org/10.1093/nar/gkab1049) - **McLaren et al. 2016** (Genome Biology, ~4,500 citations): The Ensembl Variant Effect Predictor. [DOI](https://doi.org/10.1186/s13059-016-0974-4) - **Zerbino et al. 2015** (Genome Biology): The Ensembl Regulatory Build. [DOI](https://doi.org/10.1186/s13059-015-0621-5) ## API Reference **Base URL**: `https://rest.ensembl.org` **Authentication**: None required **Rate limit**: Reasonable use expected; max 5Mb region queries **Formats**: JSON (default), XML, GFF3, BED **Current version**: Ensembl 114 Add `content-type: application/json` header to all requests. ## Step 1: Regulatory Feature Overlap Query what regulatory features the Ensembl Regulatory Build assigns to a region: ```bash # Get regulatory features in a region curl -H "Content-type: application/json" \ "https://rest.ensembl.org/overlap/region/human/7:140424943-140624564?feature=regulatory" # Also get TF binding motifs curl -H "Content-type: application/json" \ "https://rest.ensembl.org/overlap/region/human/7:140424943-140624564?feature=regulatory;feature=motif" ``` ### Regulatory Feature Types | Type | Description | ENCODE Equivalent | |------|-------------|-------------------| | Promoter | Active promoter region | cCRE PLS | | Enhancer | Active enhancer region | cCRE pELS/dELS | | Open chromatin | Accessible region without H3K27ac | DNase-only sites | | CTCF binding site | CTCF-occupied region | cCRE CTCF-only | | TF binding site | Other TF binding | TF ChIP-seq peaks | | Promoter flanking | Region flanking a promoter | cCRE TssAFlnk | ## Step 2: Variant Effect Prediction (VEP) VEP provides consequence predictions for variants: ### Single Variant (by region notation) ```bash # VEP annotation for a variant curl -H "Content-type: application/json" \ "https://rest.ensembl.org/vep/human/region/9:22125503-22125502:1/C" # By rs ID curl -H "Content-type: application/json" \ "https://rest.ensembl.org/vep/human/id/rs699" ``` ### Batch VEP (POST, up to 200 variants) ```bash curl -X POST -H "Content-type: application/json" \ "https://rest.ensembl.org/vep/human/region" \ -d '{"variants": ["1 230710048 . A G . . .", "2 241533886 . T C . . ."]}' ``` ### Key VEP Parameters | Parameter | Description | Default | |-----------|-------------|---------| | `CADD=1` | Include CADD scores | Off | | `Enformer=1` | Include Enformer predictions | Off | | `AlphaMissense=1` | Include AlphaMissense pathogenicity | Off | | `REVEL=1` | Include REVEL scores | Off | | `SpliceAI=1` | Include SpliceAI splicing predictions | Off | | `regulatory=1` | Include regulatory feature overlap | Off | | `cell_type=` | Cell type for regulatory annotations | All | ### VEP Consequence Hierarchy (most to least severe) | Consequence | Impact | Description | |-------------|--------|-------------| | `transcript_ablation` | HIGH | Deletion of entire transcript | | `splice_donor_variant` | HIGH | Essential splice donor site | | `stop_gained` | HIGH | Premature stop codon | | `frameshift_variant` | HIGH | Reading frame change | | `missense_variant` | MODERATE | Amino acid change | | `splice_region_variant` | LOW | Near splice site | | `synonymous_variant` | LOW | No amino acid change | | `regulatory_region_variant` | MODIFIER | In regulatory element | | `intergenic_variant` | MODIFIER | Between genes | **For ENCODE regulatory variants**: Most will be classified as `regulatory_region_variant` (MODIFIER impact). The VEP consequence alone does not capture regulatory impact — combine with ENCODE cCRE class, tissue activity, and TF disruption data. ## Step 3: Coordinate Conversion (LiftOver) Convert between GRCh37 (hg19) and GRCh38 (hg38): ```bash # GRCh37 → GRCh38 curl -H "Content-type: application/json" \ "https://rest.ensembl.org/map/human/GRCh37/17:1000000..1000100:1/GRCh38" # GRCh38 → GRCh37 curl -H "Content-type: application/json" \ "https://rest.ensembl.org/map/human/GRCh38/17:1000000..1000100:1/GRCh37" ``` **When needed**: Older GWAS studies report variants on GRCh37. ENCODE data uses GRCh38. Always liftOver before intersecting. ## Step 4: Gene Lookup and Cross-References ### Gene Information ```bash # By Ensembl ID curl -H "Content-type: application/json" \ "https://rest.ensembl.org/lookup/id/ENSG00000157764?expand=1" # By symbol curl -H "Content-type: application/json" \ "https://rest.ensembl.org/lookup/symbol/homo_sapiens/BRAF" ``` ### Cross-References (Ensembl ↔ External DBs) ```bash # Get all external references for a gene curl -H "Content-type: application/json" \ "https://rest.ensembl.org/xrefs/id/ENSG00000157764" # Filter by external DB curl -H "Content-type: application/json" \ "https://rest.ensembl.org/xrefs/id/ENSG00000157764?external_db=HGNC" ``` **ENCODE integration**: ENCODE target names are typically HGNC symbols or Ensembl IDs. Use this endpoint to resolve between identifier systems. ## Step 5: Phenotype/Disease Associations ```bash # Get phenotype associations for a gene curl -H "Content-type: application/json" \ "https://rest.ensembl.org/phenotype/gene/homo_sapiens/BRCA2" # Get phenotype associations for a region curl -H "Content-type: application/json" \ "https://rest.ensembl.org/phenotype/region/homo_sapiens/9:22125500-22136000" ``` ## Integrated ENCODE + Ensembl Workflow ``` 1. Find ENCODE regulatory variants: → Intersect GWAS variants with ENCODE cCREs 2. Annotate with VEP: curl "https://rest.ensembl.org/vep/human/id/rs699?CADD=1;regulatory=1;REVEL=1" → Get consequence, CADD score, regulatory overlap 3. Check Ensembl Regulatory Build for independent confirmation: curl "https://rest.ensembl.org/overlap/region/human/CHR:START-END?feature=regulatory" → Compare with ENCODE cCRE classification 4. If working with GRCh37 data, liftOver: curl "https://rest.ensembl.org/map/human/GRCh37/CHR:POS..POS:1/GRCh38" 5. Resolve gene identifiers for ENCODE targets: curl "https://rest.ensembl.org/lookup/symbol/homo_sapiens/GENE_SYMBOL" 6. Check disease associations: curl "https://rest.ensembl.org/phenotype/gene/homo_sapiens/GENE" ``` ## Pitfalls and Caveats 1. **Ensembl Regulatory Build ≠ ENCODE cCREs**: The Regulatory Build incorporates ENCODE data but uses different classification criteria. Annotations may not perfectly overlap with ENCODE cCRE calls. 2. **VEP MODIFIER impact for regulatory variants**: Non-coding regulatory variants are classified as MODIFIER impact by default. This does NOT mean low importance — it means VEP cannot assess regulatory consequence from sequence alone. Combine with ENCODE data. 3. **Region size limits**: Overlap queries limited to ~5Mb regions. For genome-wide analysis, download Ensembl GFF files or use the Perl VEP tool locally. 4. **Batch VEP limit**: REST API accepts max 200 variants per POST request. For larger sets, use the standalone VEP tool. 5. **GRCh38/GRCh37 consistency**: Always match assembly between ENCODE data and Ensembl queries. Use the liftOver endpoint when needed. 6. **Version updates**: Ensembl releases quarterly. Regulatory Build annotations may change between versions. Note the Ensembl version in your analysis. ## Walkthrough: Variant Effect Prediction for ENCODE Regulatory Variants **Goal**: Use Ensembl VEP to predict functional consequences of variants located within ENCODE-defined regulatory elements, combining variant annotation with regulatory context. **Context**: Ensembl provides the gold-standard Variant Effect Predictor (VEP) and Regulatory Build. Combined with ENCODE peaks, this enables comprehensive variant interpretation. ### Step 1: Find ENCODE experiments for the tissue of interest ``` encode_search_experiments(assay_title="ATAC-seq", organ="brain", organism="Homo sapiens") ``` Expected output: ```json { "results": [ {"accession": "ENCSR800BRN", "assay_title": "ATAC-seq", "biosample_summary": "brain tissue male adult (54 years)", "assembly": ["GRCh38"], "status": "released"} ], "total": 32, "limit": 25, "offset": 0, "has_more": true, "next_offset": 25 } ``` ### Step 2: Download peaks and extract variants ``` encode_download_files(file_accessions=["ENCFF900ATK"], download_dir="/data/brain_atac") ``` ### Step 3: Run VEP on regulatory variants Using Ensembl REST API (via skill guidance): ``` POST https://rest.ensembl.org/vep/human/region Content-Type: application/json {"variants": ["1 230710048 . A G", "7 87160618 . T C"]} ``` Expected VEP output: ```json [ { "input": "1 230710048 . A G", "most_severe_consequence": "regulatory_region_variant", "regulatory_feature_consequences": [ { "regulatory_feature_id": "ENSR00000123456", "biotype": "promoter", "consequence_terms": ["regulatory_region_variant"] } ] } ] ``` **Interpretation**: VEP classifies this as a regulatory_region_variant in an Ensembl Regulatory Build promoter. Cross-referencing with the ENCODE ATAC-seq peak confirms the variant is in open chromatin in brain tissue. ### Step 4: Liftover if needed If ENCODE peaks are in GRCh38 but variants are in hg19: - Use → **liftover-coordinates** to convert variant positions before intersection - Or use Ensembl REST API liftover endpoint ### Step 5: Integrate Ensembl Regulatory Build with ENCODE peaks ``` GET https://rest.ensembl.org/regulatory/species/homo_sapiens/id/ENSR00000123456 ``` **Interpretation**: Compare Ensembl Regulatory Build activity with ENCODE experimental data. If the Regulatory Build calls a region a "promoter" and ENCODE H3K4me3 ChIP-seq confirms this, the annotation is high confidence. ### Integration with downstream skills - ENCODE peaks define regions to annotate via → VEP regulatory consequence prediction - VEP results feed into → **variant-annotation** for multi-source annotation - Regulatory Build comparisons inform → **regulatory-elements** cCRE classification - Gene consequence predictions connect to → **gtex-expression** for expression validation - Coordinate conversions handled by → **liftover-coordinates** for cross-assembly work ## Code Examples ### 1. Find ENCODE data for an Ensembl-annotated gene ``` # Step 1: Identify the gene's regulatory neighborhood # (via Ensembl REST API — see skill instructions) # Step 2: Search ENCODE for ChIP-seq at the gene locus encode_search_experiments( assay_title="Histone ChIP-seq", organ="liver", target="H3K27ac" ) ``` Expected output: ```json { "results": [ { "accession": "ENCSR123ABC", "assay_title": "Histone ChIP-seq", "target": "H3K27ac-human", "biosample_summary": "liver tissue male adult (54 years)" } ], "total": 8, "limit": 25, "offset": 0, "has_more": false, "next_offset": null } ``` ### 2. Track and cross-reference an annotated experiment ``` encode_track_experiment( accession="ENCSR123ABC", notes="Liver H3K27ac for VEP-annotated enhancer variants" ) ``` Expected output: ```json { "tracking": {"accession": "ENCSR123ABC", "action": "tracked"}, "publications_found": 1, "publications": [ { "pmid": "32728249", "doi": "10.1038/s41586-020-2493-4", "title": "An atlas of gene regulatory elements in adult human liver", "authors": "Li YE, Preissl S, Hou X", "journal": "Nature", "year": "2020", "abstract": "" } ], "pipelines_found": 1, "pipelines": [ {"title": "Histone ChIP-seq 2 (unreplicated)", "version": "1.7.1", "software": [{"name": "bowtie2", "version": "2.3.4.3"}], "status": "released"} ] } ``` ## Integration | This skill produces... | Feed into... | Using tool/skill | |---|---|---| | VEP-annotated variant list | Regulatory variant filtering | variant-annotation skill | | Gene annotations with coordinates | Peak-to-gene assignment | peak-annotation skill | | Lifted-over coordinates (GRCh37→38) | ENCODE data integration | liftover-coordinates skill | | Regulatory Build overlap results | Enhancer/promoter classification | regulatory-elements skill | | Gene constraint scores | Target prioritization | cross-reference → Open Targets | ## Related Skills | Skill | When to Use Instead/Additionally | |-------|--------------------------------| | `variant-annotation` | Full ENCODE-based post-GWAS workflow | | `gnomad-variants` | Population frequency and constraint data for variants | | `regulatory-elements` | ENCODE cCRE classification and chromatin state analysis | | `ucsc-browser` | UCSC-hosted ENCODE tracks and sequence retrieval | | `disease-research` | Connecting variants to disease mechanisms | | `cross-reference` | General external database cross-referencing | | `publication-trust` | Verify literature claims backing analytical decisions | ## Presenting Results - Present gene annotations as: gene | ensembl_id | biotype | chr:start-end | strand. Include transcript count. Suggest: "Would you like to check expression in GTEx for these genes?" ## For the request: "$ARGUMENTS"
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.