plotScater {scater} | R Documentation

## 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 `SingleCellExperiment` dataset.

### Usage

    plotScater(x, block1 = NULL, block2 = NULL, colour_by = NULL,
      nfeatures = 500, exprs_values = "counts", ncol = 3, linewidth = 1.5,
      theme_size = 10)

### Arguments

`x` | an `SingleCellExperiment` object
`block1` | character string defining the column of `colData(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 `colData(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 `colData(object)` to be used as a factor by which to colour the points in the plot. Alternatively, a data frame with one column containing a value for each cell, which will be mapped to a corresponding colour.
`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"` (transcripts per million), `"counts"` (raw counts) [default], `"cpm"` (counts per million), or `"fpkm"` (FPKM values).
`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
`...` | arguments passed to `plotSCE`

### 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.

### Value

a ggplot plot object

### Examples

    ## Set up an example SingleCellExperiment
    data("sc_example_counts")
    data("sc_example_cell_info")
    example_sce <- SingleCellExperiment(
    assays = list(counts = sc_example_counts), colData = sc_example_cell_info)

    plotScater(example_sce)
    plotScater(example_sce, exprs_values = "counts", colour_by = "Cell_Cycle")
    plotScater(example_sce, block1 = "Treatment", colour_by = "Cell_Cycle")

    cpm(example_sce) <- calculateCPM(example_sce, use.size.factors = FALSE)
    plotScater(example_sce, exprs_values = "cpm", block1 = "Treatment",
    block2 = "Mutation_Status", colour_by = "Cell_Cycle")
    # Error is thrown if chosen expression values are not available

[Package scater version 1.6.3 Index]