Learn R Programming

scater (version 1.0.4)

plot: Plot an overview of expression for each cell

Description

Plot the relative proportion of the library accounted for by the most highly expressed features for each cell for an SCESet dataset.

Usage

"plot"(x, y, ...)
plotSCESet(x, block1 = NULL, block2 = NULL, colour_by = NULL, nfeatures = 500, exprs_values = "tpm", ncol = 3, linewidth = 1.5, theme_size = 10)

Arguments

x
an SCESet object
y
optional argument for generic plot functions, not used for plotting an SCESet object
...
arguments passed to plotSCESet
block1
character string defining the column of pData(object) to be used as a factor by which to separate the cells into blocks (separate panels) in the plot. Default is NULL, in which case there is no blocking.
block2
character string defining the column of pData(object) to be used as a factor by which to separate the cells into blocks (separate panels) in the plot. Default is NULL, in which case there is no blocking.
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.
nfeatures
numeric scalar indicating the number of features to include in the plot.
exprs_values
character string indicating which values should be used as the expression values for this plot. Valid arguments are "tpm" (default; transcripts per million), "fpkm" (FPKM values), "counts" (counts for each feature) or "exprs" (whatever is in the 'exprs' slot of the SCESet object; if already on the log2 scale, as indicated by the logged slot of the object, then exprs values are set to the power of 2 (so they are back on the raw scale they were on) before making the plot).
ncol
number of columns to use for facet_wrap if only one block is defined.
linewidth
numeric scalar giving the "size" parameter (in ggplot2 parlance) for the lines plotted. Default is 1.5.
theme_size
numeric scalar giving font size to use for the plotting theme

Value

a ggplot plot object

Details

Plots produced by this function are intended to provide an overview of large-scale differences between cells. For each cell, the features are ordered from most-expressed to least-expressed and the cumulative proportion of the total expression for the cell is computed across the top nfeatures features. These plots can flag cells with a very high proportion of the library coming from a small number of features; such cells are likely to be problematic for analyses. Using the colour and blocking arguments can flag overall differences in cells under different experimental conditions or affected by different batch and other variables.

Examples

Run this code
## Set up an example SCESet
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)

plot(example_sceset, exprs_values = "exprs")
plot(example_sceset, exprs_values = "exprs", colour_by = "Cell_Cycle")
plot(example_sceset, exprs_values = "exprs", block1 = "Treatment",
colour_by = "Cell_Cycle")
plot(example_sceset, exprs_values = "exprs", block1 = "Treatment",
block2 = "Mutation_Status", colour_by = "Cell_Cycle")
# What happens if chosen expression values are not available?
plot(example_sceset, block1 = "Treatment", colour_by = "Cell_Cycle")

Run the code above in your browser using DataLab