plotHighestExprs {scater} | R 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, controls, colour_cells_by,
      drop_features = NULL, exprs_values = "counts",
      by_exprs_values = exprs_values, by_show_single = TRUE,
      feature_names_to_plot = NULL, as_percentage = TRUE)

### Arguments

`object` | A SingleCellExperiment object.
`n` | A numeric scalar specifying the number of the most expressed features to show.
`controls` | Specification of the row-level metadata column indicating whether a feature is a control, see `?"scater-vis-var"` for possible values. Only metadata fields will be searched, `assays` will not be used. If not supplied, this defaults to `"is_feature_control"` or equivalent for compacted data.
`colour_cells_by` | Specification of a column metadata field or a feature to colour by, see `?"scater-vis-var"` for possible values. If not supplied, this defaults to `"total_features_by_counts"` or equivalent for compacted data.
`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 `?"scater-vis-var"` for details.
`by_show_single` | Logical scalar specifying whether single-level factors should be used for colouring, see `?"scater-vis-var"` for details. Default is `NULL`, in which case `rownames(object)` are used.
`feature_names_to_plot` | Specification of which row-level metadata column contains the feature names, see `?"scater-vis-var"` for possible values.
`as_percentage` | logical scalar indicating whether percentages should be plotted. If `FALSE`, the raw `exprs_values` are shown instead.

### Details

This function will plot the percentage of counts accounted for by the top `n` most highly expressed features across the dataset. Each feature corresponds to a row on the plot, sorted by average expression (denoted by the point).

The plot will attempt to colour the points based on whether the corresponding feature is labelled as a control in `object`. This can be turned off by setting `controls=NULL`.

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`. Setting `colour_cells_by=NULL` will disable all tick colouring.

### Value

A ggplot object.

### Examples

    data("sc_example_counts")
    data("sc_example_cell_info")
    example_sce <- SingleCellExperiment(
        assays = list(counts = sc_example_counts),
        colData = sc_example_cell_info
    )
    example_sce <- calculateQCMetrics(example_sce,
        feature_controls = list(set1 = 1:500)
    )

    plotHighestExprs(example_sce, colour_cells_by ="total_features_by_counts")
    plotHighestExprs(example_sce, controls = NULL)
    plotHighestExprs(example_sce, colour_cells_by="Mutation_Status")

[Package scater version 1.12.2 Index]