reduce_to_regions: Reduce beta values from CpG sites to genomic regions

View source: R/reduce_to_regions.R

reduce_to_regionsR Documentation

Reduce beta values from CpG sites to genomic regions

Description

Reduce several beta values from different CpG sites to a single beta value associated to one genomic region (such as CpG islands). Different technologies retrieve DNA methylation levels of different CpG sites. This function makes possible a direct comparison.

Usage

reduce_to_regions(
  beta_table,
  cpg_sites,
  cpg_regions,
  min_CpGs = 3,
  method = c("median", "mean")
)

Arguments

beta_table

A matrix of beta-values.

cpg_sites

A data.frame reporting the genomic location of CpG sites.

cpg_regions

A data.frame reporting the genomic location of genomic regions.

min_CpGs

An integer (default=3). Minimum number of CpG sites within a single genomic region (return NA otherwise).

method

Function to summarise a region: either 'median' or 'mean' (default=median).

Value

A matrix of beta values, each row corresponding to one region.

Examples

reduced_data <- reduce_to_regions(bs_seq_toy_matrix, bs_seq_toy_sites, cpg_islands[1:10,])

romagnolid/PAMES documentation built on Dec. 7, 2022, 10:37 a.m.