Visualize gene markers on a reduced dimension plot (e.g. t-SNE, UMAP).
Usage
plotMarker(object, ...)
# S4 method for SingleCellExperiment
plotMarker(
object,
genes,
reduction = "UMAP",
expression = c("mean", "sum"),
color = getOption(x = "acid.continuous.color", default =
ggplot2::scale_color_gradient(low = "gray75", high = "purple")),
pointSize = getOption(x = "acid.point.size", default = 1L),
pointAlpha = getOption(x = "acid.point.alpha", default = 0.9),
pointsAsNumbers = getOption(x = "acid.points.as.numbers", default = FALSE),
label = getOption(x = "acid.label", default = FALSE),
labelSize = getOption(x = "acid.label.size", default = 6L),
dark = getOption(x = "acid.dark", default = FALSE),
legend = getOption(x = "acid.legend", default = TRUE),
labels = list(title = "auto", subtitle = NULL)
)
Arguments
- object
Object.
- genes
character
. Gene identifiers.- reduction
vector(1)
. Dimension reduction name or index position.- expression
character(1)
. Calculation to apply. Usesmatch.arg()
internally and defaults to the first argument in thecharacter
vector.- color
ScaleDiscrete
. Desired ggplot2 color scale. Must supply discrete values. When setNULL
, the default ggplot2 color palette will be used. If manual color definitions are desired, we recommend usingggplot2::scale_color_manual()
.To set the discrete color palette globally, use:
- pointSize
numeric(1)
. Point size for dots in the plot. In the range of 1-3 is generally recommended.- pointAlpha
numeric(1)
(0
-1
). Alpha transparency level.- pointsAsNumbers
logical(1)
. Plot the points as numbers (TRUE
) or dots (FALSE
).- label
logical(1)
. Superimpose sample text labels on the plot.- labelSize
integer(1)
. Size of the text label.- dark
logical(1)
. Plot against a dark background using theacid_theme_light()
ggplot2 theme.- legend
logical(1)
. Include plot legend.- labels
list
. ggplot2 labels. Seeggplot2::labs()
for details.- ...
Additional arguments.
Examples
requireNamespace("Matrix", quietly = TRUE)
requireNamespace("SingleCellExperiment", quietly = TRUE)
data(SingleCellExperiment_Seurat, package = "AcidTest")
## SingleCellExperiment ====
object <- SingleCellExperiment_Seurat
counts <- SingleCellExperiment::counts(object)
sums <- sort(Matrix::rowSums(counts), decreasing = TRUE)
genes <- names(head(sums, n = 4L))
plotMarker(
object = object,
genes = genes,
reduction = "UMAP"
)