gcap.plotDistribution: Draw Gene Amplicon Distribution By User Specified Class

View source: R/distribution.R

gcap.plotDistributionR Documentation

Draw Gene Amplicon Distribution By User Specified Class

Description

Draw Gene Amplicon Distribution By User Specified Class

Usage

gcap.plotDistribution(
  fCNA,
  x = NULL,
  x_size = 8,
  set_order = TRUE,
  set_label = TRUE,
  fill = TRUE,
  palette = c("#CCCCCC", "#0066CC", "#FFCCCC", "#CC0033"),
  plot = TRUE,
  by_gene = FALSE,
  genelist = NULL,
  bar_width = 0.9,
  ...
)

Arguments

fCNA

a fCNA object or a data.frame with at least 3 columns "sample", "class" and "by".

x

a column name in fCNA$sample_summary.

x_size

font size of x axis text.

set_order

set order for by.

set_label

set labels to add sample count for by.

fill

if TRUE, show the percentage instead of count.

palette

color palette.

plot

if FALSE, return data instead of plot.

by_gene

sow distribution for genes.

genelist

only listed gene will be shown.

bar_width

set the width of bar, when it is 1, the border can be removed.

...

other parameters passing to ggplot2::geom_bar.

Value

a ggplot object.

Examples

set.seed(1234)
data <- data.frame(
  sample = sample(LETTERS[1:10], 100, replace = TRUE),
  class = sample(c("nofocal", "noncircular", "circular"), 100, replace = TRUE),
  by = sample(1:4, 100, replace = TRUE)
)
p <- gcap.plotDistribution(data)
p

ShixiangWang/gcaputils documentation built on Feb. 14, 2023, 5:58 a.m.