R/CoMethAllRegions.R
CoMethAllRegions.Rd
Extract contiguous co-methylated genomic regions from a list of pre-defined genomic regions
matrix (or data frame) of beta values, with row names = CpG IDs, column names = sample IDs. This is typically genome-wide methylation beta values.
indicates if converting methylation beta values to mvalues
method for computing correlation, can be "spearman" or "pearson"
threshold for min correlation between a cpg with sum of the rest of the CpGs
minimum number of CpGs to be considered a "region".
Only regions with more than minCpGs
will be returned.
Human genome of reference hg19 or hg38
Type of array, can be "450k" or "EPIC"
list where each item is a character vector of CpGs IDs. This should be CpG probes located closely on the array.
an RDS file with clusters of CpG locations (i.e. CpGs
located closely to each other on the genome). This file can be generated
by the WriteCloseByAllRegions
function.
When there is not a contiguous comethylated region in
the inputting pre-defined region, returnAllCpGs = TRUE
indicates
outputting all the CpGs in the input regions (regardless of statistical
significance), while returnAllCpGs = FALSE
indicates not returning
any CpGs not contained in comethylated clusters. Defaults to FALSE
,
and we provide this option for debugging purposes only.
a character vector of CpGs or a dataframe of CpGs along with rDrop info
Number of computing cores to be used when executing code in parallel. Defaults to 1 (serial computing).
Dots for additional arguments passed to the cluster constructor.
See CreateParallelWorkers
for more information.
When output = "dataframe"
is selected, returns a list of data
frames, each with CpG
(CpG name), Chr
(chromosome number),
MAPINFO
(genomic position), r_drop
(correlation between the
CpG with rest of the CpGs), keep
(indicator for co-methylated CpG),
keep_contiguous
(index for contiguous comethylated subregions).
When output = "CpGs"
is selected, returns a list, each item is a
list of CpGs in the contiguous co-methylated subregion.
There are two ways to input genomic regions for this function: (1)
use CpGs_ls
argument, or (2) use file
argument. Examples of
these files are in /inst/extdata/ folder of the package.
data(betasChr22_df)
CpGisland_ls <- readRDS(
system.file(
"extdata",
"CpGislandsChr22_ex.rds",
package = 'coMethDMR',
mustWork = TRUE
)
)
coMeth_ls <- CoMethAllRegions (
dnam = betasChr22_df,
betaToM = TRUE,
method = "pearson",
CpGs_ls = CpGisland_ls,
arrayType = "450k",
returnAllCpGs = FALSE,
output = "CpGs"
)
#> snapshotDate(): 2021-05-18
#> see ?sesameData and browseVignettes('sesameData') for documentation