plotHighestExprs: Plot the highest expressing features

Description Usage Arguments Details Value Examples

View source: R/plotHighestExprs.R

Description

Plot the features with the highest average expression across all cells, along with their expression in each individual cell.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plotHighestExprs(
  object,
  n = 50,
  colour_cells_by = NULL,
  drop_features = NULL,
  exprs_values = "counts",
  by_exprs_values = exprs_values,
  feature_names_to_plot = NULL,
  as_percentage = TRUE,
  swap_rownames = NULL
)

Arguments

object

A SingleCellExperiment object.

n

A numeric scalar specifying the number of the most expressed features to show.

colour_cells_by

Specification of a column metadata field or a feature to colour by, see ?retrieveCellInfo for possible values.

drop_features

A character, logical or numeric vector indicating which features (e.g. genes, transcripts) to drop when producing the plot. For example, spike-in transcripts might be dropped to examine the contribution from endogenous genes.

exprs_values

A integer scalar or string specifying the assay to obtain expression values from.

by_exprs_values

A string or integer scalar specifying which assay to obtain expression values from, for use in colouring - see ?retrieveCellInfo for details.

feature_names_to_plot

String specifying which row-level metadata column contains the feature names. Alternatively, an AsIs-wrapped vector or a data.frame, see ?retrieveFeatureInfo for possible values. Default is NULL, in which case rownames(object) are used.

as_percentage

logical scalar indicating whether percentages should be plotted. If FALSE, the raw exprs_values are shown instead.

swap_rownames

Column name of rowData(object) to be used to identify features instead of rownames(object) when labelling plot elements.

Details

This function will plot the percentage of counts accounted for by the top n most highly expressed features across the dataset. Each row on the plot corresponds to a feature and is sorted by average expression (denoted by the point). The distribution of expression across all cells is shown as tick marks for each feature. These ticks can be coloured according to cell-level metadata, as specified by colour_cells_by.

Value

A ggplot object.

Examples

1
2
3
4
5
6
example_sce <- mockSCE()
colData(example_sce) <- cbind(colData(example_sce),
     perCellQCMetrics(example_sce))

plotHighestExprs(example_sce, colour_cells_by="detected")
plotHighestExprs(example_sce, colour_cells_by="Mutation_Status")

scater documentation built on Feb. 28, 2021, 2:01 a.m.