/methylation-aggregation
Build comprehensive DNA methylation maps by aggregating WGBS (Whole Genome Bisulfite Sequencing) data across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "where is DNA methylated/unmethylated in my tissue?" by combining per-CpG methylation
$ npx -y skills add ammawla/encode-toolkit --skill methylation-aggregation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/methylation-aggregation
Context preview
The summary Claude sees to decide when to auto-load this skill.
Build comprehensive DNA methylation maps by aggregating WGBS (Whole Genome Bisulfite Sequencing) data across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "where is DNA methylated/unmethylated in my tissue?" by combining per-CpG methylation
SKILL.md
methylation-aggregation.SKILL.mdname: methylation-aggregation
description: Build comprehensive DNA methylation maps by aggregating WGBS (Whole Genome Bisulfite Sequencing) data across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "where is DNA methylated/unmethylated in my tissue?" by combining per-CpG methylation data into tissue-level methylation profiles. Handles coverage filtering, identifies hypomethylated regions (HMRs) and partially methylated domains (PMDs), and manages cross-lab variation.
Aggregate DNA Methylation Data Across Studies
When to Use
- User wants to build a tissue-level DNA methylation landscape from multiple WGBS experiments
- User asks "where is DNA methylated in brain?" or "find hypomethylated regions across donors"
- User needs to identify HMRs (hypomethylated regions), UMRs, or PMDs from aggregated WGBS data
- User wants per-CpG weighted methylation averages from multiple experiments
- Example queries: "aggregate WGBS data for liver", "build methylation map across donors", "find unmethylated CpG islands in pancreas"
Build a comprehensive methylation landscape for a tissue/cell type by merging WGBS bedMethyl files from multiple ENCODE experiments.
Scientific Rationale
**The question**: "What is the DNA methylation state across the genome in my tissue?"
DNA methylation is **fundamentally different** from histone marks and accessibility:
| Property | Histone/Accessibility | DNA Methylation | |----------|----------------------|-----------------| | Signal type | Binary (bound/open or not) | Continuous (0-100% methylated) | | Default state | Unmarked | ~70-80% methylated (CpG context) | | Biology of interest | Where marks ARE present | Where methylation is ABSENT or REDUCED | | Aggregation approach | Union of peak calls | Average/median of methylation levels per CpG |
**The key insight**: Unlike histone ChIP-seq where we want the union of all peaks, for methylation we want the **average methylation level per CpG site** across individuals. Methylation is a quantitative, continuous signal measured at every CpG dinucleotide.
**However**, for identifying regulatory regions, we focus on **hypomethylated regions (HMRs)** — stretches of low methylation that mark active regulatory elements. HMRs can be treated more like peaks for union-style aggregation.
Literature Support
- **Roadmap Epigenomics** (Schultz et al. 2015, Nature, 2,900+ citations): Established that tissue-specific HMRs mark active regulatory elements; demonstrated per-CpG averaging across biological replicates as standard approach
- **DMRcate** (Peters et al. 2021, Nucleic Acids Research, 65 citations): Method for calling differentially methylated regions from multiple WGBS samples; uses kernel smoothing across CpG sites
- **ENCODE Phase 3** (Gorkin et al. 2020, Nature, 301 citations): Integrated methylation data with histone marks and accessibility to define chromatin states
- **ENCODE Blacklist** (Amemiya et al. 2019, Scientific Reports, 1,372 citations): Problematic genomic regions to filter. [DOI](https://doi.org/10.1038/s41598-019-45839-z)
- **Zhou et al. 2020** (Nature Genetics): Tissue-specific methylation patterns: ~80% of CpGs are constitutively methylated, ~10% constitutively unmethylated (CpG islands/promoters), ~10% tissue-variable
- **Liu et al. 2024** (Briefings in Bioinformatics): Cross-platform comparison (NovaSeq vs DNBSEQ) showing WGBS is gold standard; coverage depth critically affects accuracy; platform differences exist in GC-rich regions
- **Ortega-Recalde et al. 2021** (Methods in Molecular Biology): Demonstrated that even low-coverage WGBS can accurately estimate global methylation levels, with bootstrap methods to quantify uncertainty
Two-Level Analysis
1. **Per-CpG level**: Average methylation at each CpG site across samples (quantitative map) 2. **Region level**: Identify HMRs, PMDs, and UMRs from the averaged profile (union of regulatory regions)
Step 1: Find All Available WGBS Data
encode_search_experiments(
assay_title="WGBS",
organ="pancreas", # user's tissue of interest
biosample_type="tissue",
limit=100
)Present a summary to the user:
- Total WGBS experiments
- Labs represented
- Unique donors/biosamples
- Genome coverage per experiment
Use `encode_get_facets` to check availability:
encode_get_facets(assay_title="WGBS", organ="pancreas")
**Note**: WGBS is expensive to generate. Typical tissues have 2-5 experiments. Even 2 biological replicates are valuable for identifying consistent methylation patterns.
Step 2: Quality-Gate Each Experiment
encode_get_experiment(accession="ENCSR...")
WGBS Quality Checks
- Audit status: no ERROR flags
- **Bisulfite conversion rate**: >=98% (measured by lambda spike-in or non-CpG methylation)
- **Genome coverage**: >=10x mean CpG coverage for reliable per-site estimates
- **Mapping rate**: >=50% (bisulfite-converted reads are harder to map)
- **Duplication rate**: <30%
- Has `methylation state at CpG` output files (bedMethyl format)
Include if:
- Bisulfite conversion >=98%
- Mean CpG coverage >=10x
- Has bedMethyl output files for GRCh38
Exclude if:
- ERROR audit flags
- Conversion rate <98% (unconverted reads create false methylation calls)
- Very low coverage (<5x mean) — individual CpG estimates unreliable
Track all included experiments:
encode_track_experiment(accession="ENCSR...")
Step 3: Download bedMethyl Files
For each experiment:
encode_list_files(
experiment_accession="ENCSR...",
output_type="methylation state at CpG",
assembly="GRCh38"
)**bedMethyl format** (ENCODE standard):
chr start end name score strand thickStart thickEnd color coverage percentMethylated
- Column 10: read coverage at this CpG
- Column 11: percent methylation (0-100)
Prefer `preferred_default=True` files:
encode_download_files(
file_accessions=["ENCFF...", ...],
download_dir="/pathRead more
name: methylation-aggregation description: Build comprehensive DNA methylation maps by aggregating WGBS (Whole Genome Bisulfite Sequencing) data across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "where is DNA methylated/unmethylated in my tissue?" by combining per-CpG methylation data into tissue-level methylation profiles. Handles coverage filtering, identifies hypomethylated regions (HMRs) and partially methylated domains (PMDs), and manages cross-lab variation.
Aggregate DNA Methylation Data Across Studies
When to Use
- User wants to build a tissue-level DNA methylation landscape from multiple WGBS experiments
- User asks "where is DNA methylated in brain?" or "find hypomethylated regions across donors"
- User needs to identify HMRs (hypomethylated regions), UMRs, or PMDs from aggregated WGBS data
- User wants per-CpG weighted methylation averages from multiple experiments
- Example queries: "aggregate WGBS data for liver", "build methylation map across donors", "find unmethylated CpG islands in pancreas"
Build a comprehensive methylation landscape for a tissue/cell type by merging WGBS bedMethyl files from multiple ENCODE experiments.
Scientific Rationale
**The question**: "What is the DNA methylation state across the genome in my tissue?"
DNA methylation is **fundamentally different** from histone marks and accessibility:
| Property | Histone/Accessibility | DNA Methylation | |----------|----------------------|-----------------| | Signal type | Binary (bound/open or not) | Continuous (0-100% methylated) | | Default state | Unmarked | ~70-80% methylated (CpG context) | | Biology of interest | Where marks ARE present | Where methylation is ABSENT or REDUCED | | Aggregation approach | Union of peak calls | Average/median of methylation levels per CpG |
**The key insight**: Unlike histone ChIP-seq where we want the union of all peaks, for methylation we want the **average methylation level per CpG site** across individuals. Methylation is a quantitative, continuous signal measured at every CpG dinucleotide.
**However**, for identifying regulatory regions, we focus on **hypomethylated regions (HMRs)** — stretches of low methylation that mark active regulatory elements. HMRs can be treated more like peaks for union-style aggregation.
Literature Support
- **Roadmap Epigenomics** (Schultz et al. 2015, Nature, 2,900+ citations): Established that tissue-specific HMRs mark active regulatory elements; demonstrated per-CpG averaging across biological replicates as standard approach
- **DMRcate** (Peters et al. 2021, Nucleic Acids Research, 65 citations): Method for calling differentially methylated regions from multiple WGBS samples; uses kernel smoothing across CpG sites
- **ENCODE Phase 3** (Gorkin et al. 2020, Nature, 301 citations): Integrated methylation data with histone marks and accessibility to define chromatin states
- **ENCODE Blacklist** (Amemiya et al. 2019, Scientific Reports, 1,372 citations): Problematic genomic regions to filter. [DOI](https://doi.org/10.1038/s41598-019-45839-z)
- **Zhou et al. 2020** (Nature Genetics): Tissue-specific methylation patterns: ~80% of CpGs are constitutively methylated, ~10% constitutively unmethylated (CpG islands/promoters), ~10% tissue-variable
- **Liu et al. 2024** (Briefings in Bioinformatics): Cross-platform comparison (NovaSeq vs DNBSEQ) showing WGBS is gold standard; coverage depth critically affects accuracy; platform differences exist in GC-rich regions
- **Ortega-Recalde et al. 2021** (Methods in Molecular Biology): Demonstrated that even low-coverage WGBS can accurately estimate global methylation levels, with bootstrap methods to quantify uncertainty
Two-Level Analysis
1. **Per-CpG level**: Average methylation at each CpG site across samples (quantitative map) 2. **Region level**: Identify HMRs, PMDs, and UMRs from the averaged profile (union of regulatory regions)
Step 1: Find All Available WGBS Data
encode_search_experiments(
assay_title="WGBS",
organ="pancreas", # user's tissue of interest
biosample_type="tissue",
limit=100
)Present a summary to the user:
- Total WGBS experiments
- Labs represented
- Unique donors/biosamples
- Genome coverage per experiment
Use `encode_get_facets` to check availability:
encode_get_facets(assay_title="WGBS", organ="pancreas")
**Note**: WGBS is expensive to generate. Typical tissues have 2-5 experiments. Even 2 biological replicates are valuable for identifying consistent methylation patterns.
Step 2: Quality-Gate Each Experiment
encode_get_experiment(accession="ENCSR...")
WGBS Quality Checks
- Audit status: no ERROR flags
- **Bisulfite conversion rate**: >=98% (measured by lambda spike-in or non-CpG methylation)
- **Genome coverage**: >=10x mean CpG coverage for reliable per-site estimates
- **Mapping rate**: >=50% (bisulfite-converted reads are harder to map)
- **Duplication rate**: <30%
- Has `methylation state at CpG` output files (bedMethyl format)
Include if:
- Bisulfite conversion >=98%
- Mean CpG coverage >=10x
- Has bedMethyl output files for GRCh38
Exclude if:
- ERROR audit flags
- Conversion rate <98% (unconverted reads create false methylation calls)
- Very low coverage (<5x mean) — individual CpG estimates unreliable
Track all included experiments:
encode_track_experiment(accession="ENCSR...")
Step 3: Download bedMethyl Files
For each experiment:
encode_list_files(
experiment_accession="ENCSR...",
output_type="methylation state at CpG",
assembly="GRCh38"
)**bedMethyl format** (ENCODE standard):
chr start end name score strand thickStart thickEnd color coverage percentMethylated
- Column 10: read coverage at this CpG
- Column 11: percent methylation (0-100)
Prefer `preferred_default=True` files:
encode_download_files(
file_accessions=["ENCFF...", ...],
download_dir="/pathShowing the first part of this file.
Search ENCODE, cross-reference 14 databases, run 7 analysis pipelines, and generate publication-ready methods — all from natural language in Claude Code.
Repo: ammawla/encode-toolkit
Other skills on encode-toolkit.
- /accessibility-aggregation
Build comprehensive chromatin accessibility maps by aggregating ATAC-seq and DNase-seq narrowPeak data across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "where is chromatin accessible in my tissue?" by combining peak calls into a union peak
Open skill - /batch-analysis
Guide for multi-experiment batch operations: QC screening, batch download, comparison, and report generation across many ENCODE experiments simultaneously. Use when users need to process 5+ experiments together, create experiment comparison tables, perform batch quality checks,
Open skill - /bioinformatics-installer
Install bioinformatics tools for ENCODE data analysis. Covers CLI tools (BWA, STAR, samtools, MACS2), R/Bioconductor packages (DESeq2, Seurat, ChIPseeker), Python packages (Scanpy, deeptools), and Nextflow pipeline infrastructure. Generates conda environments, R install scripts,
Open skill - /cellxgene-context
Guide for integrating CellxGene Census single-cell data with ENCODE bulk experiments. Use when users need cell-type-specific expression context for ENCODE regulatory data, want to deconvolve bulk ENCODE signals, or validate regulatory elements at single-cell resolution. Trigger
Open skill - /cite-encode
Generate proper ENCODE citations for publications, grants, and presentations. Use when the user needs to cite ENCODE data, create bibliography entries, write acknowledgment sections, or ensure compliance with ENCODE data use policy.
Open skill - /clinvar-annotation
Guide for annotating ENCODE regulatory variants with ClinVar clinical significance. Use when users need to check if variants in ENCODE peaks have clinical associations, find pathogenic variants in regulatory regions, or assess variant clinical impact. Trigger on: ClinVar,
Open skill

