runClassLikelihoodRpts: Run several repeats classifying reads into classes

View source: R/classifyByKnownClasses.R

runClassLikelihoodRptsR Documentation

Run several repeats classifying reads into classes

Description

Reads are classified into different classes based on likelihood estimation using the class means. Due to the need for randomisation when binarisation of the methylation matrix, the classification is carried out repeatedly and then the most frequently assigned class is chosen.

Usage

runClassLikelihoodRpts(
  dataMatrix,
  classes,
  numRepeats = 20,
  outPath = ".",
  xRange = c(-250, 250),
  outFileBase = "",
  myXlab = "CpG/GpC position",
  featureLabel = "TSS",
  baseFontSize = 12,
  figFormat = "png",
  distMetric = list(name = "euclidean"),
  classesToPlot = NULL
)

Arguments

dataMatrix

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

classes

A matrix of classes x position giving the mean frequency of methylation at each position for each class

numRepeats

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)

figFormat

format of output figures. Should be one of "png" or "pdf"

distMetric

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

classesToPlot

NULL or a numerical vector indicating which classes to plot (default NULL will plot all classes)

Value

allClassMeans data.frame with columns: position, methFreq, class, replicate


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