Differentially methylated region (DMR) detection aggregates per-CpG methylation into contiguous regions that differ between conditions. The decision-grade framing: a DMR is DEFINED by a chain of arbitrary thresholds (min-CpGs, max-gap, delta-beta, q) plus a smoothing bandwidth, and the region p-value is only honest if its null was generated by re-running that selection under permuted labels. dmrseq is the headline caller built to do this; DSS, methylKit tiles, bsseq BSmooth, DMRcate, metilene, and comb-p combine-and-correct but do not re-select, so region q-values are not comparable across tools and cross-tool overlap is the real evidence. A separate single-sample domain-segmentation step (PMDs/UMRs/LMRs via MethylSeekR) must run before focal calling on cancer, aging, placenta, or cultured-cell genomes.
if (!require('BiocManager', quietly = TRUE))
install.packages('BiocManager')
BiocManager::install(c('dmrseq', 'DSS', 'methylKit', 'bsseq', 'DMRcate',
'annotatr', 'missMethyl', 'MethylSeekR', 'GenomicRanges'))
# metilene (C CLI) and comb-p (Python) are separate second callers:
conda install -c bioconda metilene combined-pvalues
Conceptual prerequisites and notes:
- Input is a per-CpG methylation+coverage table: Bismark .cov/cytosine reports for sequencing callers, a beta/M matrix for DMRcate array mode, or long-read modkit bedMethyl counts piped from long-read-sequencing/nanopore-methylation.
- Annotation packages (annotatr, TxDb) are large and genome-build-specific; the build must match the alignment genome.
- dmrseq and the sequencing callers need count data, not betas; arrays use DMRcate or comb-p.
- Run per-CpG quality checks and the methylKit object-model import (methylkit-analysis) before region calling.
Tell your AI agent what you want to do: - "Find DMRs between treatment and control in my WGBS data with a selection-aware region FDR" - "Call DMRs with dmrseq and corroborate with DSS, then report the overlap" - "Detect DMRs from my EPIC array beta matrix with DMRcate" - "Check whether my cancer hypomethylation DMRs are just PMD background"
"I have WGBS coverage files for 3 controls and 3 treated samples. Call DMRs with dmrseq using a region-level FDR that accounts for region selection, and explain why I should not run BSmooth first."
"Which DMR caller should I use for low-coverage WGBS with only 2 replicates per group, and how do I cross-check the result with a second tool?"
"Detect DMRs from my EPIC array M-value matrix with DMRcate array mode, and tell me why the WGBS kernel settings would be wrong here."
"My samples are tumor-vs-normal WGBS and I got thousands of hypomethylation DMRs. Segment PMDs first with MethylSeekR and report what fraction of my hypo-DMRs are PMD background."
"Annotate my DMRs to genes and CpG islands, then run enrichment with a method that corrects for CpG-density bias."
cpg.annotate('array', ...) for arrays and sequencing.annotate() with C=50 for WGBS; the array C=2 over-smooths sequencing data.