compute_BC_CV: BC(CV)

View source: R/compute_BC_CV.R

compute_BC_CVR Documentation

BC(CV)

Description

Computes bimodality coefficient of the CVlogT per CpG across samples

Usage

compute_BC_CV(CV, parallel = F, nThread = NULL)

Arguments

CV

A coefficient of variation matrix (probes as rows, samples as columns)

parallel

Whether to perform this task employing parallel processing.

nThread

Number of CPU cores to employ on this task

Details

It computes the following per row (per CpG):

BC = \frac{\gamma^{2} +1}{\kappa + \frac{3\cdot(n-1)^{2}}{(n-2)\cdot(n-3)}}

Where \gamma is the sample skewness and where \kappa is the sample excess kurtosis.

For more details, check the reference paper.

Value

A vector of coefficients of bimodality per CpG

References

Revisiting Genetic artefacts on DNA methylation microarrays. Genome Research

Examples

rgSet = read.metharray.exp(getwd(), extended = TRUE)
Grn = assay(rgSet, "Green")       # Green mean across beads
Red = assay(rgSet, "Red")         # Red mean across beads
M_U = GR_to_UM(Red, Grn, rgSet, "Mean")
GrnSD = assay(rgSet, "GreenSD")   # Green SD across beads
RedSD = assay(rgSet, "RedSD")     # Red SD across beads
M_U_sd = GR_to_UM(RedSD, GrnSD, rgSet, "SD")
CV = compute_CV(M_U_sd$M, M_U_sd$U, M_U$M, M_U_sd$U)
compute_BC_CV(CV)

BenjaminPlanterose/UMtools documentation built on Aug. 19, 2024, 4:54 a.m.