Overview
CMEnt is an R package for identifying Differentially Methylated Regions (DMRs) from pre-computed seeds, commonly identified Differentially Methylated Positions (DMPs). The package implements a correlation-based approach to expand regions around significant DMPs, considering both statistical significance and biological relevance of methylation changes.
Features
- Correlation-based model-free region expansion from genomic seeds
- DMR-level Stouffer meta-p-values and FDR q-values from supporting seed p-values
- Optional SVM-based DMR scoring as a complementary discriminative ranking measure
- Motif discovery within DMRs
- DMRs motif-based interactions
- lookup of DMRs motifs matching binding factors on JASPAR database
- Support for 450K, EPIC, EPICv2, mouse array platforms and NGS datasets in the form of bed (or tabix) files
- Support for genome builds hg19, hg38, hs1, mm10 and mm39
- Visualization functions for DMRs and methylation profiles
Considerations
- CMEnt is designed to work with pre-computed seeds (DMPs) and does not perform DMP identification itself. Users should first identify DMPs using their preferred method before using CMEnt for region expansion. Helper functions for this are provided for convenience and mentioned in the Usage section.
- CMEnt is not preprocessing input methylation files (e.g. no normalization, no filtering, no probe removal), apart from conversion to different formats for efficiency, and optional confounders adjustment. It is recommended to preprocess beta files using established pipelines (e.g. minfi, meffil) before using CMEnt for DMR identification.
- When seed p-values are provided, DMR
pval/qvalare the primary statistical evidence columns. The optional SVMscoreis useful as a complementary measure of sample-level discriminative strength, not as a replacement for statistical significance and effect size.
Installation
Install CMEnt from Bioconductor with:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("CMEnt")You can install the development version of CMEnt from GitHub with:
Another option is the Docker image on GitHub Container Registry. It contains CMEnt and common dependencies. At startup, the container installs missing optional packages for the requested command, inputs, and genome before running CMEnt. Viewer setup uses the saved analysis metadata. Installation requires network access and a writable R library when packages are missing; CMEnt package functions never install software. See INSTALL for external tools and Windows limitations, and inst/docker/ for the container build and setup scripts. You can pull the image using:
and run it using:
To launch the packaged example output in CMEntViewer, publish the Shiny port from the container and bind the app to 0.0.0.0:
docker run --rm -p 3838:3838 \
ghcr.io/cmg-ua/cment/cment:latest \
launchCMEntViewer \
--output_prefix /CMEnt/inst/extdata/example_outputChr5And11 \
--launch_browser FALSE \
--host 0.0.0.0 \
--port 3838Then open http://localhost:3838 in your browser.
If you want to view outputs created on your machine, mount them into the container. Keeping the R library and cache on Docker volumes avoids re-installing on-demand packages and cached annotations on every run:
docker volume create cment-r-lib
docker volume create cment-r-cache
docker run --rm -p 3838:3838 \
-v "$PWD:/work" -w /work \
-v cment-r-lib:/usr/local/lib/R/site-library \
-v cment-r-cache:/home/root/.cache/R \
ghcr.io/cmg-ua/cment/cment:latest \
launchCMEntViewer \
--output_prefix /work/path/to/output_prefix \
--launch_browser FALSE \
--host 0.0.0.0 \
--port 3838Usage
Here’s a basic example of how to use CMEnt in a 450K Microarray setting:
suppressPackageStartupMessages(library(CMEnt))
loadExampleInputDataChr5And11("beta", "dmps", "pheno", "array_type")
cat("\nBeta matrix:")
cat(head(beta), "\n")
cat("\nSeeds:")
cat(head(dmps), "\n")
cat("\nPhenotype data:")
cat(head(pheno), "\n")
# Build DMRs using parallel processing
dmrs <- buildDMRs(
beta = beta,
seeds = dmps,
pheno = pheno,
sample_group_col = "Sample_Group",
array = array_type, # Specify array platform
min_sites = 3,
min_seeds = 2,
njobs = 2 # Use parallel processing
)
# View summary of DMR statistics
summary(dmrs)Here’s the same workflow with a custom BED-like methylation file instead of array probe IDs. The BED file must have a header, chromosome and start-position columns, and one column per sample. Sample column names must match rownames(pheno). Because the beta rows are genomic coordinates rather than array probes, set array = NULL and provide genome explicitly. Seeds must also be identified by chr:start coordinates.
Expected BED format:
chrom start Sample1 Sample2 Sample3
chr1 100000 0.21 0.76 0.73
chr1 100120 0.25 0.79 0.75
chr2 250010 0.64 0.31 0.29
suppressPackageStartupMessages(library(CMEnt))
pheno <- data.frame(
Sample_Group = c("control", "case", "case"),
row.names = c("Sample1", "Sample2", "Sample3")
)
seeds <- data.frame(
site_id = c("chr1:100000", "chr1:100120", "chr2:250010"),
pval = c(1e-5, 2e-4, 8e-4)
)
dmrs <- buildDMRs(
beta = "methylation_values.bed",
seeds = seeds,
seeds_id_col = "site_id",
pheno = pheno,
sample_group_col = "Sample_Group",
array = NULL,
genome = "hg38",
bed_chrom_col = "chrom",
bed_start_col = "start",
min_sites = 2,
min_seeds = 2,
njobs = 2
)
summary(dmrs)The tool supports also bsseq and tabix-indexed BED files as input, which can be specified by setting beta to a BSseq object or a path to a tabix-indexed BED file, respectively. When using tabix-indexed BED files, the function will automatically fetch only the relevant genomic regions based on the seed locations, which can significantly reduce memory usage and improve performance for large datasets.
There are two helper functions that can be used to find DMPs and create seeds for buildDMRs():
-
findDMPsArray()takes a beta matrix and phenotype data as input and identifies DMPs using linear modeling with limma. Please cite limmaif used.
-
findDMPsBSSeq()takes aBSseqobject and phenotype data as input and identifies DMPs using a beta-binomial regression model with DSS. Please cite DSSif used.
For automated seed cleaning, CMEnt also exposes combinePvalues(), which implements comb-p-style spatial autocorrelation adjustment. Please cite comb-p if used.
Citation
If you use CMEnt in your research, please cite:
To cite package 'CMEnt' in publications use:
Lemonidis et al (2026). From DMPs to DMRs: CMEnt, Characterization of Methylation using positional Entanglement. R package version 0.99.9.
University of Antwerp, Antwerp, Belgium.
A BibTeX entry for LaTeX users is:
@Manual{
title = {From DMPs to DMRs: CMEnt, Characterization of Methylation using positional Entanglement},
author = {Vasileios Lemonidis, Ken op de Beeck, Joris R Vermeesch, Timon Vandamme, Guy Van Camp, Joe Ibrahim},
year = {2026},
note = {R package version 0.99.9},
url = {https://github.com/CMG-UA/CMEnt},
}License
This project is licensed under the GPL-2 License - see the LICENSE.md file for details.
Acknowledgments
- Center of Medical Genetics, University of Antwerp
- Genetics of Cancer and Hearing Loss Research Group
- Bioconductor review-response updates were assisted by OpenAI Codex. The maintainer reviewed the changes and remains responsible for package reliability and maintenance.
