Supervised Prioritization of CpG Sites for Methylation-based Biomarker Discovery
PriorityMeth is an R package designed for robust and scalable prioritization of CpG (Cytosine-phosphate-Guanine) sites in large-scale DNA methylation datasets. It integrates a multi-phase Boruta-based feature selection pipeline with machine learning, UMAP visualization, and heatmap generation to help researchers identify stable, high-importance CpG signatures for disease classification and biomarker discovery.
- Three-phase wrapper-based feature selection using Boruta
- Repeated seed-based stability selection for reproducible CpG prioritization
- Automatic UMAP (unsupervised) visualization for subgroup clustering
- Supervised machine learning models via caret (default: Random Forest)
- Heatmap visualization of methylation beta values
- Annotation support via internal CpG annotation dataset
- User-friendly output containing models, performance metrics, plots, and selected CpGs
PriorityMeth can be installed directly from GitHub:
# Install devtools if not available
install.packages("devtools")
# Install PriorityMeth
devtools::install_github("arsalanqazi/PriorityMeth")PriorityMeth automatically loads the following dependencies:
- Boruta
- dplyr
- umap
- ggplot2
- caret
- pheatmap
- tibble
- plyr
To install the packages you can use the following command.
# Define the package list
required_packages <- c("Boruta", "dplyr", "umap", "ggplot2",
"caret", "pheatmap", "tibble", "plyr")
# Install all packages
install.packages(required_packages)Ensure these are installed to avoid runtime errors.
PriorityMeth expects:
- A data frame
- Features in columns (CpG beta values)
- Samples in rows
- A label column containing the class/category
Example Structure;
| Sample | CpG1 | CpG2 | CpG3 | … | label |
|---|---|---|---|---|---|
| S1 | 0.45 | 0.83 | 0.12 | … | Group1 |
| S2 | 0.29 | 0.77 | 0.18 | … | Group2 |
library(PriorityMeth)
result <- priority_meth(data = your_data, label_col = "subgroup")
# View UMAP plot
print(result$umap_plot)
# View confusion matrix
result$models$rf$confusion_matrix
# View selected CpGs with annotations
result$final_featuresRaw methylation data ─► Train/Test Split
│
▼
Repeated Boruta Feature Selection (3 Phases)
│
▼
Final CpG Signature (Stable Features)
│
┌──────────────────┴──────────────────┐
▼ ▼
UMAP Clustering (unsupervised) ML Classification (caret)
│ │
└──────────────► Heatmap ◄─────────────┘The function returns a list containing:
models— trained classifiers + confusion matricesumap_df— UMAP coordinates for plottingfinal_features— prioritized CpG sites with annotationsheatmap— heatmap object of methylation valuesumap_plot— ggplot UMAP visualization
- UMAP plot: reveals natural subgroup clustering
- Final CpG list: stable features confirmed across all seed runs
- Heatmap: visual separation of classes using selected CpGs
- Model accuracy: derived from caret’s repeated CV
For issues, suggestions, or feature requests:
📧 arsalanriaz38@gmail.com GitHub Issues: https://github.com/arsalanqazi/PriorityMeth/issues