Plot counts

plotCounts(object, ...)

# S4 method for SummarizedExperiment
plotCounts(object, genes, assay = 1L,
  interestingGroups = NULL, trans = c("identity", "log2", "log10"),
  line = c("none", "median", "mean", "geometricMean"),
  color = getOption(x = "acid.color.discrete", default =
  acidplots::scale_color_synesthesia_d()), legend = getOption(x =
  "acid.legend", default = TRUE), style = c("facet", "wide"),
  labels = list(title = NULL, subtitle = NULL, sampleAxis = NULL,
  countAxis = "counts"), ...)

Arguments

object

Object.

genes

character. Gene identifiers.

assay

vector(1). Assay name or index position.

interestingGroups

character. Groups of interest to use for visualization. Corresponds to factors describing the columns of the object.

trans

character(1). Name of the axis scale transformation to apply.

For more information:

help(topic = "scale_x_continuous", package = "ggplot2")
line

character(1). Include average (median, mean, or geometric mean) line for each interesting group. Disabled by default and if samples are colored by sample name.

color

ScaleDiscrete. Desired ggplot2 color scale. Must supply discrete values. When set 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(acid.color.discrete = ggplot2::scale_color_viridis_d())
legend

logical(1). Include plot legend.

style

character(1). Plot style.

labels

list. ggplot2 labels. See ggplot2::labs() for details.

...

Additional arguments.

Value

  • style = "facet": ggplot grouped by sampleName, with ggplot2::facet_wrap() applied to panel the samples.

  • style = "wide": ggplot in wide format, with genes on the x-axis.

Note

Updated 2019-11-07.

See also

Examples

data(RangedSummarizedExperiment, package = "acidtest") ## SummarizedExperiment ==== object <- RangedSummarizedExperiment rownames <- head(rownames(object)) print(rownames)
#> [1] "gene001" "gene002" "gene003" "gene004" "gene005" "gene006"
g2s <- basejump::Gene2Symbol(object) geneIDs <- head(g2s[["geneID"]]) print(geneIDs)
#> [1] "ENSG00000000003" "ENSG00000000005" "ENSG00000000419" "ENSG00000000457" #> [5] "ENSG00000000460" "ENSG00000000938"
geneNames <- head(g2s[["geneName"]]) print(geneNames)
#> [1] "TSPAN6" "TNMD" "DPM1" "SCYL3" "C1orf112" "FGR"
## Rownames, gene IDs, and gene names (symbols) are supported. plotCounts(object, genes = geneIDs, style = "facet")
plotCounts(object, genes = geneNames, style = "wide")