RAMEN 

Overview
Regional Association of Methylome variability with the Exposome and
geNome (RAMEN) is an R package which goal is to estimate the
contribution of genetic variants and environmental exposures to loci
with high DNA methylation (DNAme) variability at a genome-wide scale
using population data. Characterizing the factors that contribute to
DNAme variability is important because DNAme is a key epigenetic
mechanism that regulates gene expression and plays an important role in
development, disease, and environmental adaptation.
RAMEN provides a Findable, Accesible, Interoperable and Reusable (FAIR)
workflow to conduct gene-environment contribution analyses to
high-dimensional DNA methylome data (described in Navarro-Delgado et
al. (2025). Using a blend
of traditional statistical methods and machine learning approaches,
RAMEN is designed to be computationally efficient and user-friendly,
allowing researchers to gain insights into the complex interplay between
genetics, environment and DNA methylation variability. The package
includes a detailed
tutorial, and
individual functions that could be useful for other applications beyond
the gene-environment contribution analysis.
RAMEN takes advantage of the fact that DNA methylation levels at nearby
CpG sites are often correlated, and uses this information to identify
Variable Methylated Loci (VML) from microarray DNA methylation data.
Then, integrating genomic and exposomic data, it can identify which
model out of the following explains best the DNA methylation variability
at each VML: genetic (G), environmental (E), additive (G+E) or
interactive (GxE).
Installation
You can install the latest version of RAMEN from
GitHub with:
## Install RAMEN (recommended option)
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("RAMEN")
## Alternatively install the RAMEN package from GitHub
BiocManager::install("ropensci/RAMEN")
Usage
For a detailed tutorial on how to use RAMEN, please check the package’s
vignette, which you can build locally by running
BiocManager::install("ropensci/RAMEN", build_vignettes = TRUE) or see
externally in its
website.
Altogether, RAMEN provides a workflow that takes a set of individuals
with genome, exposome and DNA methylome information, and generates an
estimation of the contribution of genetic variants and environmental
exposures to its DNA methylation variability. Functions that conduct
computationally intensive tasks are compatible with parallel computing.

In brief, the standard workflow consists of the following steps:
- Identify Variable Methylated Loci (VML) with
findVML().
library(RAMEN)
#> __ _ ___
#> )_) /_) )\/) )_ )\ )
#> / \ / / ( ( (__ ( \(
#>
#> ( ) ( (
#> ( ( ) ( )
#> ) ) (
#> _.(--'(''--.._
#> /, _..-----).._,\
#> | `'''-----'''` |
#> \ /
#> '. .'
#> '--.....--'
#>
#> If you use RAMEN for your analysis, please cite: Navarro-Delgado,
#> E.I., et al. RAMEN: Dissecting individual, additive and interactive
#> gene-environment contributions to DNA methylome variability in cord
#> blood. Genome Biol 26, 421 (2025).
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggplot2)
library(doParallel)
#> Loading required package: foreach
#> Loading required package: iterators
#> Loading required package: parallel
# Set the parallel backend to use 2 workers
registerDoParallel(2)
VML <- findVML(
methylation_data = test_methylation_data,
array_manifest = "IlluminaHumanMethylationEPICv1",
cor_threshold = 0,
var_method = "variance",
var_distribution = "ultrastable",
var_threshold_percentile = 0.99,
max_distance = 1000
)
#> Identifying Highly Variable Probes...
#> Setting options('download.file.method.GEOquery'='auto')
#> Setting options('GEOquery.inmemory.gpl'=FALSE)
#> Identifying sparse Variable Methylated Probes
#> Identifying Variable Methylated Regions...
#> Applying correlation filter to Variable Methylated Regions...
head(VML$VML) # Take a look at the identified VML GRanges object
#> GRanges object with 6 ranges and 5 metadata columns:
#> seqnames ranges strand | n_VMPs probes
#> <Rle> <IRanges> <Rle> | <numeric> <list>
#> [1] chr21 10990119-10990903 + | 2 cg09872009,cg05437132
#> [2] chr21 11109021-11109336 + | 2 cg00750806,cg12301579
#> [3] chr21 31799091-31799248 + | 2 cg24500711,cg07621949
#> [4] chr21 32715908-32716792 + | 2 cg16417027,cg14151498
#> [5] chr21 15955548-15955699 - | 2 cg14772146,cg07412745
#> [6] chr21 26573136-26573196 - | 2 cg11112002,cg23973918
#> median_correlation type VML_index
#> <numeric> <character> <character>
#> [1] 0.609918 VMR VML1
#> [2] 0.626168 VMR VML2
#> [3] 0.727915 VMR VML3
#> [4] 0.693244 VMR VML4
#> [5] 0.812065 VMR VML5
#> [6] 0.617368 VMR VML6
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
- Summarize the regional methylation state of each VML with
summarizeVML().
summarized_methyl_VML <- summarizeVML(
VML = VML$VML,
methylation_data = test_methylation_data
)
# Look at the resulting object
summarized_methyl_VML[1:5, 1:5]
#> VML1 VML2 VML3 VML4 VML5
#> ID1 4.935942 2.853168 6.389600 9.017997 2.714379
#> ID2 1.879166 2.699689 7.790474 3.134218 2.223942
#> ID3 3.311818 1.078262 4.135771 2.864724 8.648046
#> ID4 6.558106 4.683173 6.153156 3.828411 1.448140
#> ID5 2.899969 4.930614 4.919235 3.664651 2.926548
- Identify the SNPs in cis of each VML with
findCisSNPs().
VML_cis_snps <- findCisSNPs(
VML = VML$VML,
genotype_information = test_genotype_information,
distance = 1e+06
)
#> Reminder: please make sure that the positions of the VML data frame and the ones in the genotype information are from the same genome build.
# Take a look at the result
head(VML_cis_snps)
#> GRanges object with 6 ranges and 7 metadata columns:
#> seqnames ranges strand | n_VMPs probes
#> <Rle> <IRanges> <Rle> | <numeric> <list>
#> [1] chr21 10990119-10990903 + | 2 cg09872009,cg05437132
#> [2] chr21 11109021-11109336 + | 2 cg00750806,cg12301579
#> [3] chr21 31799091-31799248 + | 2 cg24500711,cg07621949
#> [4] chr21 32715908-32716792 + | 2 cg16417027,cg14151498
#> [5] chr21 15955548-15955699 - | 2 cg14772146,cg07412745
#> [6] chr21 26573136-26573196 - | 2 cg11112002,cg23973918
#> median_correlation type VML_index surrounding_SNPs
#> <numeric> <character> <character> <integer>
#> [1] 0.609918 VMR VML1 1
#> [2] 0.626168 VMR VML2 1
#> [3] 0.727915 VMR VML3 659
#> [4] 0.693244 VMR VML4 855
#> [5] 0.812065 VMR VML5 726
#> [6] 0.617368 VMR VML6 788
#> SNP
#> <list>
#> [1] 21:10873592:G:A
#> [2] 21:10873592:G:A
#> [3] 21:30813322:G:A,21:30860437:G:A,21:30862803:T:C,...
#> [4] 21:31718195:C:T,21:31719083:AAG:A,21:31719372:C:T,...
#> [5] 21:14957973:A:G,21:15167527:T:C,21:15169567:C:T,...
#> [6] 21:25582143:A:G,21:25586702:G:A,21:25587960:G:T,...
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
- Conduct a LASSO-based feature selection strategy to identify
potentially relevant cis SNPs and environmental variables with
selectVariables().
set.seed(1)
selected_variables <- selectVariables(
VML_wSNPs = VML_cis_snps,
genotype_matrix = test_genotype_matrix,
environmental_matrix = test_environmental_matrix,
covariates = test_covariates,
summarized_methyl_VML = summarized_methyl_VML
)
#> Loading required package: Matrix
#> Loaded glmnet 5.1
#> Loading required package: rngtools
head(selected_variables)
#> VML_index selected_genot selected_env
#> 1 VML1 21:10873.... E43, E3,....
#> 2 VML2 21:10873.... E43
#> 3 VML3 21:32782.... E15, E25....
#> 4 VML4 E43
#> 5 VML5 21:15248.... E40, E43
#> 6 VML6 21:25648.... E43
- Fit linear single-variable genetic (G), environmental (E), pairwise
additive (G+E) and pairwise interaction (GxE) linear models, and
select the best explanatory model for each VML with
lmGE().