CreateRdrop: Computes leave-one-out correlations (rDrop) for each CpG

View source: R/CreateRdrop.R

CreateRdropR Documentation

Computes leave-one-out correlations (rDrop) for each CpG

Description

Computes leave-one-out correlations (rDrop) for each CpG

Usage

CreateRdrop(data, method = c("pearson", "spearman"), use = "complete.obs")

Arguments

data

a dataframe with rownames = sample IDs, column names = CpG IDs.

method

method for computing correlation, can be "pearson" or "spearman", and is passed to the cor function.

use

method for handling missing values when calculating the correlation. Defaults to "complete.obs" because the option "pairwise.complete.obs" only works for Pearson correlation.

Details

An outlier CpG in a genomic region will typically have low correlation with the rest of the CpGs in a genomic region. On the other hand, in a cluster of co-methylated CpGs, we expect each CpG to have high correlation with the rest of the CpGs. The r.drop statistic is used to identify these co-methylated CpGs here.

Value

A data frame with the following columns:

  • CpG : CpG ID

  • r_drop : The correlation between each CpG with the sum of the rest of the CpGs

Examples

   data(betaMatrix_ex1)

   CreateRdrop(data = betaMatrix_ex1, method = "pearson")


TransBioInfoLab/coMethDMR documentation built on Sept. 14, 2022, 7:09 p.m.