bGMM: Bivariate Gaussian Mixture Model

View source: R/bGMM.R

bGMMR Documentation

Bivariate Gaussian Mixture Model

Description

Fits a Gaussian Mixture Model (bGMM) with K components on the Unmethylated/Methylated plane

Usage

bGMM(
  M,
  U,
  CpG,
  K,
  stable.solution = TRUE,
  min.n = NULL,
  min.n.iter = 2000,
  method = "em.EM",
  EMC = .EMC,
  transform = TRUE
)

Arguments

M

A matrix containing the methylated intensities (CpGs as rows, samples as columns)

U

A matrix containing the unmethylated intensities (CpGs as rows, samples as columns)

CpG

A CpG identifier (e.g. "cg15771735")

K

Targeted number of clusters

...

Control functions for EMCluster

Details

It employs the function init.EM from the R-package EMCluster that fits a Gaussian Mixture Model employing the expectation-maximization algorithm on the U/M plane. Run help(init.EM) for more information on the EMCluster control functions.

Value

A vector of classes in the same order as the columns of U and M.

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)
bGMM(M = M_U$M, U = M_U$U, CpG = "cg00814218", K = 3)

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