Skip to content
Data
Skill

/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

From plugin
encode-toolkit
2047 skills7 agents10 commands1 MCP

Claude Code

$ npx -y skills add ammawla/encode-toolkit --skill methylation-aggregation --agent claude-code

SKILL.md

methylation-aggregation.SKILL.md
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="/path
Read more
@ammawla
Ships withencode-toolkit

Search ENCODE, cross-reference 14 databases, run 7 analysis pipelines, and generate publication-ready methods — all from natural language in Claude Code.

2047 skills7 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
20
Star history of ammawla/encode-toolkit on GitHub, a chart by star-history.com

Other skills on encode-toolkit.

batch-analysis

batch-analysis

Guide for multi-experiment batch operations: QC screening, batch download, comparison, and report generation across many ENCODE…

cellxgene-context

cellxgene-context

Guide for integrating CellxGene Census single-cell data with ENCODE bulk experiments. Use when users need cell-type-specific…

cite-encode

cite-encode

Generate proper ENCODE citations for publications, grants, and presentations. Use when the user needs to cite ENCODE data, create…

clinvar-annotation

clinvar-annotation

Guide for annotating ENCODE regulatory variants with ClinVar clinical significance. Use when users need to check if variants in…

More skills from other plugins.

context-loader
Auto-invoked

context-loader

Search memories from earlier Pi sessions in this repository. Use it when earlier work may already explain the code, error,…

mem08d69k
@mem0ai@mem0aiInstall Skill
analyzing-ai-citations

analyzing-ai-citations

Answer AI citation and answer engine optimization (AEO) questions in PostHog: whether AI answer engines (ChatGPT, Claude, and an…

posthog2w41k
@posthog@posthogInstall Skill

Questions about methylation-aggregation.

Which coding agents can use methylation-aggregation?
methylation-aggregation installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.