runEMrangeClassNum: Run EM to predict a range of class numbers

View source: R/EMbasic.R

runEMrangeClassNumR Documentation

Run EM to predict a range of class numbers

Description

Perform EM clustering on the same matrix with a range of different class numbers.

Usage

runEMrangeClassNum(
  dataMatrix,
  k_range = 2:8,
  convergenceError = 1e-06,
  maxIterations = 100,
  EMrepeats = 10,
  outPath = ".",
  xRange = c(-250, 250),
  outFileBase = "",
  myXlab = "CpG/GpC position",
  featureLabel = "TSS",
  baseFontSize = 12,
  doIndividualPlots = TRUE,
  distMetric = list(name = "euclidean", rescale = F)
)

Arguments

dataMatrix

A matrix of methylation or bincount values (reads x position)

k_range

A vector indicating different numbers of classes to learn

convergenceError

An float indicating the convergence threshold for stopping iteration

maxIterations

An integer indicating the max number of iterations to perform even if the algorithm has not converged

EMrepeats

An integer indicating the number of times to repeat the clustering (default=10)

outPath

A string with the path to the directory where the output should go

xRange

A vector of the first and last coordinates of the region to plot (default is c(-250,250))

outFileBase

A string that will be used in the filenames and titles of the plots produced (default is "")

myXlab

A label for the x axis (default is "CpG/GpC position")

featureLabel

A label for a feature you want to plot, such as the position of the TSS (default="TSS")

baseFontSize

The base font for the plotting theme (default=12 works well for 4x plots per A4 page)

doIndividualPlots

Produce individual plots for each repeat (default=F)

distMetric

A list with the name of the distance metric and any parameters it might require

Value

allClassMeans list of different class numbers each containing a data.frame with columns: position, methFreq, class, replicate


jsemple19/EMclassifieR documentation built on Aug. 12, 2022, 2:57 p.m.