plotGene: Plot Gene Expression

Description Usage Arguments Value Examples

Description

Plot Gene Expression

Usage

1
2
3
4
5
6
## S4 method for signature 'SummarizedExperiment'
plotGene(object, genes, assay = 1L,
  interestingGroups = NULL, countsAxisLabel = "counts",
  medianLine = TRUE, color = getOption("basejump.discrete.color",
  NULL), legend = getOption("basejump.legend", TRUE),
  style = c("facet", "wide"))

Arguments

object

Object.

genes

character. Gene identifiers. It is considered better practice to input the stable gene identifiers from Ensembl (e.g. "ENSG00000000003") and not the (HGNC) gene symbols (e.g. "TSPN6"), if possible.

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.

countsAxisLabel

string. Label to use for the counts axis.

medianLine

boolean. Include median line for each group. Disabled if samples are colored by sample name.

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()).

legend

boolean. Show plot legend.

style

string. Plot style.

...

Additional arguments.

Value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(rse, package = "basejump.data")
object <- rse

rownames <- head(rownames(object))
print(rownames)
g2s <- basejump.classes::Gene2Symbol(object)
geneIDs <- head(g2s[["geneID"]])
print(geneIDs)
geneNames <- head(g2s[["geneName"]])
print(geneNames)

## Rownames, gene IDs, and gene names (symbols) are supported.
plotGene(object, genes = geneIDs, style = "facet")
plotGene(object, genes = geneNames, style = "wide")

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