CoMethSingleRegion: Wrapper function to find contiguous and comethyalted...

Description Usage Arguments Value Examples

View source: R/CoMethSingleRegion.R

Description

Wrapper function to find contiguous and comethyalted sub-regions within a pre-defined genomic region

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
CoMethSingleRegion(
  CpGs_char,
  dnam,
  betaToM = TRUE,
  rDropThresh_num = 0.4,
  method = c("pearson", "spearman"),
  minCpGs = 3,
  genome = c("hg19", "hg38"),
  arrayType = c("450k", "EPIC"),
  returnAllCpGs = FALSE
)

Arguments

CpGs_char

vector of CpGs in the inputting pre-defined genomic region.

dnam

matrix (or data frame) of beta values, with row names = CpG ids, column names = sample ids. This should include the CpGs in CpGs_char, as well as additional CpGs.

betaToM

indicates if converting methylation beta values mvalues

rDropThresh_num

threshold for min correlation between a cpg with sum of the rest of the CpGs

method

method for computing correlation, can be "pearson" or "spearman"

minCpGs

minimum number of CpGs to be considered a "region". Only regions with more than minCpGs will be returned.

genome

Human genome of reference hg19 or hg38

arrayType

Type of array, can be "450k" or "EPIC"

returnAllCpGs

When there is not a contiguous comethylated region in the inputing pre-defined region, returnAllCpGs = 1 indicates outputting all the CpGs in the input region, while returnAllCpGs = 0 indicates not returning any CpG.

Value

A list with two components:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
   data(betasChr22_df)

   CpGsChr22_char <- c(
     "cg02953382", "cg12419862", "cg24565820", "cg04234412", "cg04824771",
     "cg09033563", "cg10150615", "cg18538332", "cg20007245", "cg23131131",
     "cg25703541"
   )
   CoMethSingleRegion(
     CpGs_char = CpGsChr22_char,
     dnam = betasChr22_df
   )

   data(betaMatrix_ex3)
   CpGsEx3_char <- c(
     "cg14221598", "cg02433884", "cg07372974", "cg13419809", "cg26856676",
     "cg25246745"
   )
   CoMethSingleRegion(
     CpGs_char = CpGsEx3_char,
     dnam = t(betaMatrix_ex3),
     returnAllCpGs = TRUE
   )

lissettegomez/coMethDMR documentation built on April 25, 2021, 1:10 p.m.