Learn R Programming

sigminer (version 0.1.11)

draw_cn_distribution: Plot copy number distribution either by length or chromosome

Description

Visually summarize copy number distribution either by copy number segment length or chromosome. When input is a CopyNumber object, genome_build option will read from genome_build slot of object instead of using argument set in function.

Usage

draw_cn_distribution(data, rm_normal = TRUE, mode = c("ld", "cd"),
  fill = FALSE, scale_chr = TRUE, genome_build = c("hg19", "hg38"))

Arguments

data

result from get_LengthFraction function result or 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.

genome_build

genome build version, should be 'hg19' or 'hg38'.

Value

a ggplot object

See Also

Other copy number plot: draw_cn_components, draw_cn_features

Examples

Run this code
# NOT RUN {
# Load copy number object
load(system.file("extdata", "toy_copynumber.RData",
  package = "sigminer", mustWork = TRUE
))
# Plot distribution
draw_cn_distribution(cn)
draw_cn_distribution(cn, mode = "cd")
draw_cn_distribution(cn, mode = "cd", fill = TRUE)
# }

Run the code above in your browser using DataLab