show_cn_distribution: Show Copy Number Distribution either by Length or Chromosome

View source: R/show_cn_distribution.R

show_cn_distributionR Documentation

Show Copy Number Distribution either by Length or Chromosome

Description

Visually summarize copy number distribution either by copy number segment length or chromosome. Input is a CopyNumber object, genome_build option will read from genome_build slot of object.

Usage

show_cn_distribution(
  data,
  rm_normal = TRUE,
  mode = c("ld", "cd"),
  fill = FALSE,
  scale_chr = TRUE,
  base_size = 14
)

Arguments

data

a CopyNumber object.

rm_normal

logical. Whether remove normal copy (i.e. "segVal" equals 2), default is TRUE.

mode

either "ld" for distribution by CN length or "cd" for distribution by chromosome.

fill

when mode is "cd" and fill is TRUE, plot percentage instead of count.

scale_chr

logical. If TRUE, normalize count to per Megabase unit.

base_size

overall font size.

Value

a ggplot object

Author(s)

Shixiang Wang w_shixiang@163.com

Examples

# Load copy number object
load(system.file("extdata", "toy_copynumber.RData",
  package = "sigminer", mustWork = TRUE
))
# Plot distribution
p1 <- show_cn_distribution(cn)
p1
p2 <- show_cn_distribution(cn, mode = "cd")
p2
p3 <- show_cn_distribution(cn, mode = "cd", fill = TRUE)
p3

sigminer documentation built on May 29, 2024, 3:11 a.m.