This function takes a scCNVisObject and outputs a ggplot2 object

makeFrequencyPlot(
  obj,
  gr = NULL,
  group = "Sample",
  gain.color = "cornflowerblue",
  loss.color = "deeppink",
  secondary.group = NULL,
  data.func = NULL,
  remove.chr.prefix = TRUE,
  verbose = F
)

Arguments

obj

A scCNVisObject made using createPlotObject()

gr

A GenomicRanges:GRanges object of the regions to graph. If NULL, all regions will be plotted. Default = NULL

group

Metadata column. Average signal will be calculated per group and then called as loss/neutral/gain. Default = "Sample"

gain.color

Color to represent gain frequency. Default = 'cornflowerblue'

loss.color

Color to represent loss frequency. Default = 'deeppink'

secondary.group

Secondary group for plot groupings. Each value in group, should overlap 1 and only 1 secondary grouping. Default = NULL

data.func

A function for defining thresholds of loss(0)/neutral(1)/gain(2) and otherwise manipulating plot data. If not provided, mean +/- sd will be used for thresholding. See FrequencyPlot example on Github for examples. Default = NULL

remove.chr.prefix

Remove 'chr' prefix of chromosome names. Default = TRUE

verbose

Verbose logging. Default = FALSE

Value

Returns a list containing a "Plot" (ComplexHeatmap) and "PlotData" (matrix)