Skip to content

/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
2994 skills7 agents10 commands
shell
$ npx -y skills add ammawla/encode-toolkit --skill methylation-aggregation --agent claude-code

How 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
How auto-invocation works

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.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
Read it on GitHub ↗

Showing the first part of this file.

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.

Get the whole plugin, auto-invoked
Stats
29
Stars
0
Views
5
Forks
Active
Maintenance
Python
Language
AGPL-3.0
License
8d ago
Last commit
4mo ago
Created

Repo: ammawla/encode-toolkit

Other skills on encode-toolkit.