plotCountsPerGene: Plot Counts Per Gene

Description Usage Arguments Value Examples

Description

Generally, we expect similar count spreads for all genes between samples unless the library sizes or total RNA expression are different.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'SummarizedExperiment'
plotCountsPerGene(object, assay = 1L,
  interestingGroups = NULL, geom = c("boxplot", "density", "violin"),
  trans = c("identity", "log2", "log10"),
  color = getOption("basejump.discrete.color", NULL),
  fill = getOption("basejump.discrete.fill", NULL),
  flip = getOption("basejump.flip", TRUE), countsAxisLabel = "counts",
  title = "counts per gene")

## S4 method for signature 'SingleCellExperiment'
plotCountsPerGene(object, assay = 1L,
  interestingGroups = NULL, geom = c("boxplot", "density", "violin"),
  trans = c("identity", "log2", "log10"),
  color = getOption("basejump.discrete.color", NULL),
  fill = getOption("basejump.discrete.fill", NULL),
  flip = getOption("basejump.flip", TRUE), countsAxisLabel = "counts",
  title = "counts per gene")

Arguments

object

Object.

assay

scalar. Name or index of count matrix slotted in SummarizedExperiment::assays(). When passing in a string, the name must be defined in SummarizedExperiment::assayNames().

interestingGroups

character or NULL. Groups of interest that define the samples. If left unset, defaults to sampleName.

geom

string. Type of ggplot2 geometric object to use.

trans

string. Name of the axis scale transformation to apply. See help("scale_x_continuous", "ggplot2") for more information.

color

ggproto/ScaleDiscrete or NULL. Desired ggplot2 color scale. Must supply discrete values. When set to NULL, the default ggplot2 color palette will be used. If manual color definitions are desired, we recommend using ggplot2::scale_color_manual(). To set the discrete color palette globally, use options(basejump.discrete.color = ggplot2::scale_color_viridis_d()).

fill

ggproto/ScaleDiscrete or NULL. Desired ggplot2 fill scale. Must supply discrete values. When set to NULL, the default ggplot2 color palette will be used. If manual color definitions are desired, we recommend using ggplot2::scale_fill_manual(). To set the discrete fill palette globally, use options(bcbio.discrete.fill = scale_fill_viridis_d()).

flip

boolean. Flip x and y axes. Recommended for plots containing many samples.

countsAxisLabel

string. Counts axis label.

title

string or NULL. Plot title.

Value

ggplot.

Examples

1
2
3
4
5
6
7
8
data(rse, sce, package = "basejump.data")

## SummarizedExperiment ====
plotCountsPerGene(rse, geom = "boxplot")
plotCountsPerGene(rse, geom = "density")

## SingleCellExperiment ====
plotCountsPerGene(sce)

steinbaugh/basejump.plots documentation built on Nov. 5, 2018, 10:36 p.m.