plotHighestExprs {scater} | R Documentation |
Plot the features with the highest average expression across all cells, along with their expression in each individual cell.
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)
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 |
colour_cells_by |
Specification of a column metadata field or a feature to colour by, see |
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 |
by_show_single |
Logical scalar specifying whether single-level factors should be used for colouring, see |
feature_names_to_plot |
Specification of which row-level metadata column contains the feature names, see |
as_percentage |
logical scalar indicating whether percentages should be plotted.
If |
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.
A ggplot object.
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") plotHighestExprs(example_sce, controls = NULL) plotHighestExprs(example_sce, colour_cells_by="Mutation_Status")