plotVarianceVsMean | R Documentation |
This function calculates the per-feature mean and variance using normalised
counts (accessible via logcounts()
) from a SingleCellExperiment
object,
and returns a logcounts mean-variance scatter plot.
plotVarianceVsMean(
sce,
top_n = 5,
point_size = 2,
point_alpha = 0.8,
text_size = 4,
text_color = "black",
box.padding = 0.5,
max.overlaps = Inf,
seed = 12321,
xlab = "Mean log-counts",
ylab = "Variance of log-counts",
title = NULL,
theme_size = 18,
...
)
sce |
A |
top_n |
An integer scalar indicating the first |
point_size |
A numeric scalar indicating the size of the points. Default is 2. |
point_alpha |
A numeric scalar (between 0 and 1) indicating the transparency. Default is 0.8. |
text_size |
A numeric scalar indicating the size of the label. This
is passed to |
text_color |
A string indicating the colour of the label. This is
passed to |
box.padding |
A scalar indicating the amount of padding around
bounding box, as unit or number. This is passed to |
max.overlaps |
Exclude text labels that overlap too many things.
This is passed to |
seed |
Random seed passed to |
xlab |
The title of the x-axis. Default is "Mean log-counts". |
ylab |
The title of the y-axis. Default is "Variance of log-counts". |
title |
Plot title. Default is |
theme_size |
A numeric scalar indicating the base font size. Default is 18. |
... |
Other arguments passed on to |
When the rowData
slot of the SingleCellExperiment
input
contains QC metrics for features that were returned by addPerCellQC()
or
perFeatureQCMetrics()
, this function will use detected
(percentage of
expressed features above the detection limit) to calculate pct_dropout
(percentage of dropouts) and colour the points accordingly.
A ggplot
object
I-Hsuan Lin
scater::plotRowData()
, scuttle::logNormCounts()
,
scuttle::calculateCPM()
, ggrepel::geom_text_repel()
library(SingleCellExperiment)
# Load demo dataset
data(sce)
plotVarianceVsMean(sce, title = "logcounts mean-variance plot")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.