find_dmrs: Find Differentially Methylated Regions across whole genome

View source: R/find_dmrs.R

find_dmrsR Documentation

Find Differentially Methylated Regions across whole genome

Description

A function to define DMR for an entire genome.

Usage

find_dmrs(
  tumor_table,
  control_table,
  auc_vector,
  reference_table,
  ncores = 1,
  max_distance = Inf,
  min_sites = 5,
  pt_start = 0.05,
  normdist = 100000,
  ratiosd = 0.4,
  mu = 0.25,
  use_trunc = TRUE
)

Arguments

tumor_table

A matrix of beta-values (percentage) from tumor samples.

control_table

A matrix of beta-values (percentage) from normal/control samples.

auc_vector

A numeric vector generated by [compute_AUC].

reference_table

A data.frame reporting the location of CpG sites (chromosome, genomic_coordinate and chromosome arm).

ncores

Number of parallel processes to use for parallel computing.

max_distance

Maximum distance between sites within same DMRs. Splits long DMRs (default: no split).

min_sites

Minimum required number of CpG sites within a DMR (default = 5).

pt_start

Transition probability of the HSLM. Default is 0.05.

normdist

Distance normalization parameter of the HSLM. Default is 1e5.

ratiosd

Fraction between the standard deviation of AUC values of differentially methylated sites and the total standard deviation of AUC values. Default is 0.4.

mu

Expected mean (AUC) for hypo-methylated state (1-mu is the expected mean for hyper-methylated state). Default is 0.25.

use_trunc

Use truncated normal distribution (DEBUGGING ONLY). Default is TRUE.

Value

A data.frame reporting genomic location, number of CpG sites, methylation state, average beta difference (tumor vs. control), p-value and adjusted (Benjamini-Hochberg) p-value (fdr) of discovered DMRs.

Examples

auc <- compute_AUC(tumor_example, control_example)
dmr_set <- find_dmrs(tumor_example, control_example, auc, reference_example, min_sites = 10)

cgplab/ROCkerMeth documentation built on March 27, 2022, 9:57 p.m.