embeddingPlot {sccore} | R Documentation |
Plot embedding with provided labels / colors using ggplot2
Description
Plot embedding with provided labels / colors using ggplot2
Usage
embeddingPlot(
embedding,
groups = NULL,
colors = NULL,
subgroups = NULL,
plot.na = is.null(subgroups),
min.cluster.size = 0,
mark.groups = TRUE,
show.legend = FALSE,
alpha = 0.4,
size = 0.8,
title = NULL,
plot.theme = NULL,
palette = NULL,
color.range = "symmetric",
font.size = c(3, 7),
show.ticks = FALSE,
show.labels = FALSE,
legend.position = NULL,
legend.title = NULL,
gradient.range.quantile = 1,
raster = FALSE,
raster.dpi = 300,
shuffle.colors = FALSE,
keep.limits = !is.null(subgroups),
...
)
Arguments
embedding |
two-column matrix with x and y coordinates of the embedding, rownames contain cell names and are used to match coordinates with groups or colors |
groups |
vector of cluster labels, names contain cell names (default=NULL) |
colors |
vector of numbers, which must be shown with point colors, names contain cell names (default=NULL). This argument is ignored if groups are provided. |
subgroups |
subset of 'groups', selecting the cells for plot (default=NULL). Ignored if 'groups' is NULL |
plot.na |
boolean/numeric Whether to plot points, for which groups / colors are missed (default=is.null(subgroups), i.e. FALSE). If plot.na passed a numeric value below 0, the NA symbols are plotted below the cells. Otherwise if values >=0, they’re plotted above the cells. Note that this argument is FALSE if 'subgroups' is NULL |
min.cluster.size |
labels for all groups with number of cells fewer than this parameter are considered as missed (default=0). This argument is ignored if groups aren't provided |
mark.groups |
plot cluster labels above points (default=TRUE) |
show.legend |
show legend (default=FALSE) |
alpha |
opacity level [0, 1] (default=0.4) |
size |
point size (default=0.8) |
title |
plot title (default=NULL) |
plot.theme |
theme for the plot (default=NULL) |
palette |
vector or list or function (default=NULL). Accepts number of colors and return list of colors (i.e. see 'colorRampPalette') (default=NULL) |
color.range |
controls range, in which colors are estimated (default="symmetric"). Pass "all" to estimate range based on all values of "colors", pass "data" to estimate it only based on colors, presented in the embedding. Alternatively you can pass vector of length 2 with (min, max) values. |
font.size |
font size for cluster labels (default=c(3, 7)). It can either be single number for constant font size or pair (min, max) for font size depending on cluster size |
show.ticks |
show ticks and tick labels (default=FALSE) |
show.labels |
show labels (default=FALSE) |
legend.position |
vector with (x, y) positions of the legend (default=NULL) |
legend.title |
legend title (default=NULL) |
gradient.range.quantile |
Winsorization quantile for the numeric colors and gene gradient (default=1) |
raster |
boolean whether layer with the points be rasterized (default=FALSE). Setting of this argument to TRUE is useful when you need to export a plot with large number of points |
raster.dpi |
dpi of the rasterized plot. (default=300). Ignored if raster == FALSE. |
shuffle.colors |
shuffle colors (default=FALSE) |
keep.limits |
Keep axis limits from original plot (default=!is.null(subgroups)). Useful when plotting subgroups, only meaningful it plot.na=FALSE |
... |
Arguments passed on to
|
Value
ggplot2 object
Examples
library(sccore)
embeddingPlot(umapEmbedding, show.ticks=TRUE, show.labels=TRUE, title="UMAP embedding")