plotFreq: plotFreq

View source: R/plotFreq.R

plotFreqR Documentation

plotFreq

Description

plotFreq

Usage

plotFreq(
  scCNA,
  high_threshold = 1.1,
  low_threshold = 0.9,
  assay = "segment_ratios",
  group = NULL,
  geom = c("area", "line"),
  BPPARAM = bpparam()
)

Arguments

scCNA

scCNA object.

high_threshold

A numeric with the threshold above which events are considered amplifications.

low_threshold

A numeric with the threshold below which events are considered deletions.

assay

String with the name of the assay to pull data from to plot the frequency plot.

group

A string with the name of the columns from colData to separate each frequency plot.

geom

A character with the desired geom

BPPARAM

A BiocParallelParam specifying how the function should be parallelized.

Details

plotFreq retrieves the data from the desired assay and creates an event matrix based on the high and low thresholds arguments. Values above the high threshold will be classified as gains whereas values below are classified as deletions. The resulting plot is a frequency plot where values above 0 represent the frequency of gains and values below 0 represent the frequency of deletions.

If the argument 'group' is provided the frequency plot will be calculated separately for each group. Group can be any string column from colData

The following geoms are available:

  • area: If geom = 'area' an area plot with the frequency is plotted. If the group argument is provided a different facet will be plotted for each group

  • line: If geom = 'line' a line plot with the frequency is plotted. If the group argument lines are overlapped with different colors.

Value

A ggplot object with a frequency plot

Examples

set.seed(1000)
copykit_obj <- copykit_example_filtered()[, sample(40)]
plotFreq(copykit_obj)

navinlabcode/copykit documentation built on Sept. 22, 2023, 9:16 a.m.