BoxplotsFromCounts: Produce notched boxplots from count data

Description Usage Arguments Details Author(s) Examples

View source: R/src_BoxplotsFromCounts.R

Description

This minimal function accepts a count matrix (columns=samples, rows=regions/genes) and then uses ggplot2 to produce notched boxplots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
BoxplotsFromCounts(
  InputData,
  ScaleByQuantile = NULL,
  Box.title = NULL,
  Box.color = "darkgoldenrod2",
  Box.ylab = "",
  Box.axislabsize = 25,
  Box.titlesize = 25,
  add.NumberElements = TRUE,
  Return.Plot = FALSE
)

Arguments

InputData

a matrix or dataframe with the count data

ScaleByQuantile

a numeric vector with two elements that define the lower and upper quantile which will be used to winsorize the data in order to limit infuence of outliers on the plot.

Box.title

the title of the boxplots

Box.color

the color to fill the boxes with

Box.ylab

the y-axis description

Box.axislabsize

the fontsize of the axis labels

Box.titlesize

the fontsize of the title

add.NumberElements

logical, whether to add the number of rows of the count matrix to the end of the plot title like <PlotTitle (1000 elements)>

Return.Plot

logical, whether to return the ggplot2 object to be saved as a variable

Details

Not much to say here. The function accepts the counts "as-is" so any normalization or averaging of samples has to be done externally.

Author(s)

Alexander Toenges

Examples

1
2
3
cts <- sapply(seq(1,10), function(x) rnorm(1000,100))
colnames(cts) <- paste0("sample", seq(1,10))
PlotSaved <- BoxplotsFromCounts(InputData = cts, ScaleByQuantile = c(.01, .99), Box.title = "The main title", Return.Plot = TRUE)

ATpoint/misterplotR documentation built on Feb. 15, 2020, 12:17 a.m.