plotHighestExprs: Plot the highest expressing features

View source: R/plotHighestExprs.R

plotHighestExprsR Documentation

Plot the highest expressing features

Description

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

Usage

plotHighestExprs(
  object,
  n = 50,
  colour_cells_by = color_cells_by,
  drop_features = NULL,
  exprs_values = "counts",
  by_exprs_values = exprs_values,
  feature_names_to_plot = NULL,
  as_percentage = TRUE,
  swap_rownames = NULL,
  color_cells_by = NULL,
  assay.type = exprs_values,
  by.assay.type = by_exprs_values
)

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

Alias to assay.type.

by_exprs_values

Alias to by.assay.type.

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 assay.type are shown instead.

swap_rownames

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

color_cells_by

Alias to colour_cells_by.

assay.type

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

by.assay.type

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

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

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")


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