plotScater: Plot an overview of expression for each cell

View source: R/plotScater.R

plotScaterR Documentation

Plot an overview of expression for each cell

Description

Plot the relative proportion of the library size that is accounted for by the most highly expressed features for each cell in a SingleCellExperiment object.

Usage

plotScater(
  x,
  nfeatures = 500,
  exprs_values = "counts",
  colour_by = color_by,
  by_exprs_values = exprs_values,
  block1 = NULL,
  block2 = NULL,
  ncol = 3,
  line_width = 1.5,
  theme_size = 10,
  color_by = NULL,
  assay.type = exprs_values,
  by.assay.type = by_exprs_values
)

Arguments

x

A SingleCellExperiment object.

nfeatures

Numeric scalar indicating the number of top-expressed features to show n the plot.

exprs_values

Alias to assay.type.

colour_by

Specification of a column metadata field or a feature to colour by, see the by argument in ?retrieveCellInfo for possible values. The curve for each cell will be coloured according to this specification.

by_exprs_values

Alias to by.assay.type.

block1

String specifying the column-level metadata field by which to separate the cells into separate panels in the plot. Alternatively, an AsIs vector or data.frame, see ?retrieveCellInfo. Default is NULL, in which case there is no blocking.

block2

Same as block1, providing another level of blocking.

ncol

Number of columns to use for facet_wrap if only one block is defined.

line_width

Numeric scalar specifying the line width.

theme_size

Numeric scalar specifying the font size to use for the plotting theme.

color_by

Alias to colour_by.

assay.type

String or integer scalar indicating which assay of object should be used to obtain the expression values for this plot.

by.assay.type

A string or integer scalar specifying which assay to obtain expression values from, for use in point aesthetics - see the assay.type argument in ?retrieveCellInfo.

Details

For each cell, the features are ordered from most-expressed to least-expressed. 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 downstream 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. If only one of block1 and block2 are specified, each panel corresponds to a separate level of the specified blocking factor. If both are specified, each panel corresponds to a combination of levels.

Value

A ggplot object.

Author(s)

Davis McCarthy, with modifications by Aaron Lun

Examples

example_sce <- mockSCE()
plotScater(example_sce)
plotScater(example_sce, assay.type = "counts", colour_by = "Cell_Cycle")
plotScater(example_sce, block1 = "Treatment", colour_by = "Cell_Cycle")


LTLA/scater documentation built on July 21, 2024, 5:43 p.m.