Skip to contents

This helper identifies differentially methylated positions (DMPs) from methylation array beta values using limma, returning the same seed-style output columns as findDMPsBSSeq(). In contrast to dmpFinder() from minfi, this function supports flexible covariate inclusion and returns a consistent output format with the BS-seq DMPs for downstream compatibility with CMEnt's region-finding functions.

Usage

findDMPsArray(
  beta,
  samplesheet,
  samplesheet_sep = "\t",
  sample_group_col = "Sample_Group",
  id_col = "Sample_ID",
  array = c("450K", "27K", "EPIC", "EPICv2", "Mouse"),
  genome = c("hg19", "hg38", "hs1", "mm10", "mm39"),
  sorted_locs = NULL,
  njobs = getOption("CMEnt.njobs", 1L),
  chr = "auto",
  case_group = NULL,
  covariates = NULL,
  output_file = NULL
)

Arguments

beta

A beta input supported by getBetaHandler(), such as a numeric matrix/data frame or a beta file path. minfi MethylSet/RatioSet inputs are also accepted and converted to beta values.

samplesheet

A data frame or file path to a tab-delimited sample sheet.

samplesheet_sep

Separator for samplesheet files. Default is tab.

sample_group_col

Column in samplesheet containing group labels.

id_col

Column in samplesheet containing sample IDs. row.names can also be used by specifying id_col = "row.names".

array

Array platform passed to getSortedGenomicLocs() when sorted_locs is not supplied.

genome

Genome passed to getSortedGenomicLocs() when sorted_locs is not supplied.

sorted_locs

Optional data frame of probe locations with row names as site IDs and chr plus start or pos columns.

njobs

Number of jobs used by getBetaHandler() when reading beta files.

chr

Chromosomes to retain, "auto" for chr1-chr22, or "all" for chr1-chr22 plus chrX and chrY.

case_group

Group label to treat as case. If NULL, the first group in sample_group_col is used.

covariates

Optional covariate column names, or a comma-separated string, to include in the limma model.

output_file

Optional tab-delimited output path. Files ending in .gz are gzipped.

Value

A data frame with columns chr, start, end, site_id, pval, qval, delta_beta, and score.