plotClassesSingleMolecule: Plot reads by class for a single gene

View source: R/EMbasic.R

plotClassesSingleMoleculeR Documentation

Plot reads by class for a single gene

Description

Create a single molecule plot of the reads sorted by class.

Usage

plotClassesSingleMolecule(
  dataOrderedByClass,
  numClasses,
  xRange = c(-250, 250),
  title = "Reads by classes",
  myXlab = "CpG/GpC position",
  featureLabel = "TSS",
  baseFontSize = 12,
  segmentSize = 5,
  colourChoice = list(low = "blue", mid = "white", high = "red", bg = "white", lines =
    "black"),
  colourScaleMidpoint = 0.5,
  classesToPlot = NULL
)

Arguments

dataOrderedByClass

A matrix of methylation or bincount values (reads x position) that have been ordered by class. The assigned class, e.g. "__class1" etc has been appended to read names.

numClasses

Number of classes

xRange

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

title

A title for the plot (default is "Reads by classes")

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)

segmentSize

Length of colour segment denoting methylation site

colourChoice

A list of colours for colour pallette. Must include values for "low", "mid", "high" and "bg" (background) and "lines".

colourScaleMidpoint

Numerical value for middle of colour scale. Useful for Nanopore data where a particular threshold other than 0.5 is used to distinguish methylated from non-methylated sites. (default=0.5).

classesToPlot

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

Value

Returns a ggplot2 object of a single molecule plot sorted by classes


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