Description Usage Arguments Value Functions Author(s) Examples
View source: R/visualization.R
Plot a reduced dimensionality embedding for a dataset
1 2 3 4 5 6 7 8 9 10 11 | plotDR(seurat, reduction = "tsne", colour_by = NULL, colours = NULL,
colour_by_type = "discrete", label = TRUE, point_size = 0.6,
alpha = 0.8, legend = ifelse((is.null(colour_by)) && (label), FALSE,
TRUE), label_repel = TRUE, label_size = 4, cells = NULL,
order_by = NULL, clusters_to_label = NULL, hide_ticks = TRUE,
title = NULL, label_short = FALSE, na_color = "gray80",
limits = NULL, constrain_scale = TRUE, dim1 = 1, dim2 = 2)
tsne(seurat, ...)
pca(seurat, ...)
|
seurat |
Seurat object, where Seurat::RunTSNE() has been applied |
reduction |
String, specifying a lot of |
colour_by |
(Optional) String, specifying the column in |
colours |
(Optional) Character vector of colours for points. If |
colour_by_type |
(Optional) String, one of "discrete" or "continuous".
If specifying |
label |
Logical, whether to plot cluster labels. Default: TRUE |
point_size |
Numeric, size of points in scatter plot. Default: 0.6 |
alpha |
Numeric, fixed alpha value for points: Default: 0.8 |
legend |
Logical, whether to plot legend. Default: FALSE if |
label_repel |
Logical, if |
label_size |
Numeric, controls the size of text labels. Default: 4. |
cells |
Character vector of cell names if only a subset of cells should be
plot (these should correspond to seurat@cell.names). Default: Plot all cells.
See the argument |
order_by |
String, corresponding to a column in seurat@meta.data, specifying
a variable to control the order in which cells are plot. (Thus, you can manually
specify the order, add it as a new column in seurat@meta.data, and pass that).
If numeric, cells with high values are plot on top. If not, the column must
be a factor, and cells will be ordered according to the levels, with cells
in the first level plot on top. Default: if a numeric column is specified
to |
clusters_to_label |
(Optional.) If |
hide_ticks |
Logical, whether to hide axis ticks. Default: FALSE |
title |
(Optional) String specifying title. |
label_short |
(Optional/Experimental!!) Logical, if TRUE, assumes cluster
names (at seurat@ident) consist of a prefix and a suffix separated by a non-alpha
numeric character ( |
na_color |
String, specifying the colour (built-in or hex code) to use to
plot points which have an NA value, for example
in the variable specified in |
limits |
Numeric vector of length two providing the lower and upper limits of the colour scale, if colouring by a continuous variable. Default: min and max of the values the variable takes on in the data. |
constrain_scale |
Logical, if plotting a subset of cells, whether to use the limits of the tSNE embedding computed on the whole dataset (useful for constraining scales across plots while only plotting specific cells). Default: TRUE |
dim1 |
Numeric, dimension of embedding to use for x-axis. Default = 1. |
dim2 |
Numeric, dimension of embedding to use for y-axis. Default = 2. |
A ggplot2 object
tsne
: Plot a tSNE embedding
pca
: Plot a PCA embedding
Selin Jessa
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.