plotRLE: Plot a relative log expression (RLE) plot

Description Usage Arguments Details Value Author(s) References Examples

Description

Produce a relative log expression (RLE) plot of one or more transformations of cell expression values.

Usage

1
2
3
4
5
6
plotRLE(object, ...)

## S4 method for signature 'SCESet'
plotRLE(object, exprs_mats = list(exprs = "exprs"),
  exprs_logged = c(TRUE), colour_by = NULL, style = "minimal",
  legend = "auto", order_by_colour = TRUE, ncol = 1, ...)

Arguments

object

an SCESet object

...

further arguments passed to geom_boxplot.

exprs_mats

named list of expression matrices. Entries can either be a character string, in which case the corresponding expression matrix will be extracted from the SCESet object, or a matrix of expression values.

exprs_logged

logical vector of same length as exprs_mats indicating whether the corresponding entry in exprs_mats contains logged expression values (TRUE) or not (FALSE).

colour_by

character string defining the column of pData(object) to be used as a factor by which to colour the points in the plot. Alternatively, a data frame with one column, containing values to map to colours for all cells.

style

character(1), either "minimal" (default) or "full", defining the boxplot style to use. "minimal" uses Tufte-style boxplots and is fast for large numbers of cells. "full" uses the usual ggplot2 and is more detailed and flexible, but can take a long time to plot for large datasets.

legend

character, specifying how the legend(s) be shown? Default is "auto", which hides legends that have only one level and shows others. Alternative is "none" (hide all legends).

order_by_colour

logical, should cells be ordered (grouped) by the colour_by variable? Default is TRUE. Useful for visualising differences between batches or experimental conditions.

ncol

integer, number of columns for the facetting of the plot. Default is 1.

Details

Unwanted variation can be highly problematic and so its detection is often crucial. Relative log expression (RLE) plots are a powerful tool for visualising such variation in high dimensional data. RLE plots are particularly useful for assessing whether a procedure aimed at removing unwanted variation, i.e. a normalisation procedure, has been successful. These plots, while originally devised for gene expression data from microarrays, can also be used to reveal unwanted variation in single-cell expression data, where such variation can be problematic.

If style is "full", as usual with boxplots, the box shows the inter-quartile range and whiskers extend no more than 1.5 * IQR from the hinge (the 25th or 75th percentile). Data beyond the whiskers are called outliers and are plotted individually. The median (50th percentile) is shown with a white bar.

If style is "minimal", then median is shown with a circle, the IQR in a grey line, and "whiskers" (as defined above) for the plots are shown with coloured lines. No outliers are shown for this plot style.

Value

a ggplot plot object

Author(s)

Davis McCarthy

References

Gandolfo LC, Speed TP. RLE Plots: Visualising Unwanted Variation in High Dimensional Data. arXiv [stat.ME]. 2017. Available: http://arxiv.org/abs/1704.03590

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
drop_genes <- apply(exprs(example_sceset), 1, function(x) {var(x) == 0})
example_sceset <- example_sceset[!drop_genes, ]

plotRLE(example_sceset, list(exprs = "exprs", counts = "counts"), c(TRUE, FALSE),
       colour_by = "Mutation_Status", style = "minimal")

plotRLE(example_sceset, list(exprs = "exprs", counts = "counts"), c(TRUE, FALSE),
       colour_by = "Mutation_Status", style = "full",
       outlier.alpha = 0.1, outlier.shape = 3, outlier.size = 0)

dynverse/scaterlegacy documentation built on Feb. 17, 2020, 5:07 a.m.