plotExprsFreqVsMean {scater} | R Documentation |
Plot the frequency of expression (i.e., percentage of expressing cells) against the mean expression level for each feature in a SingleCellExperiment object.
plotExprsFreqVsMean(object, freq_exprs, mean_exprs, controls, exprs_values = "counts", by_show_single = FALSE, show_smooth = TRUE, show_se = TRUE, ...)
object |
A SingleCellExperiment object. |
freq_exprs |
Specification of the row-level metadata field containing the number of expressing cells per feature, see |
mean_exprs |
Specification of the row-level metadata field containing the mean expression of each feature, see |
controls |
Specification of the row-level metadata column indicating whether a feature is a control, see |
exprs_values |
String specifying the assay used for the default |
by_show_single |
Logical scalar specifying whether a single-level factor for |
show_smooth |
Logical scalar, should a smoothed fit (through feature controls if available; all features otherwise) be shown on the plot?
See |
show_se |
Logical scalar, should the standard error be shown for a smoothed fit? |
... |
Further arguments passed to |
This function plots gene expression frequency versus mean expression level, which can be useful to assess the effects of technical dropout in the dataset. We fit a non-linear least squares curve for the relationship between expression frequency and mean expression. We use this curve to define the number of genes above high technical dropout and the numbers of genes that are expressed in at least 50% and at least 25% of cells.
The plot will attempt to colour the points based on whether the corresponding features are labelled as feature controls in object
.
This can be turned off by setting controls=NULL
.
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 <- normalize(example_sce) example_sce <- calculateQCMetrics(example_sce, feature_controls = list(set1 = 1:500)) plotExprsFreqVsMean(example_sce) plotExprsFreqVsMean(example_sce, size_by = "is_feature_control")