Returns a DimPlot colored based on whether the cells fall in clusters to the left or to the right of a node split in the cluster tree.
Usage
ColorDimSplit(
object,
node,
left.color = "red",
right.color = "blue",
other.color = "grey50",
...
)Arguments
- object
Seurat object
- node
Node in cluster tree on which to base the split
- left.color
Color for the left side of the split
- right.color
Color for the right side of the split
- other.color
Color for all other cells
- ...
Arguments passed on to
DimPlotdimsDimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions
cellsVector of cells to plot (default is all cells)
colsVector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by
brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. SeeDiscretePalettefor details.pt.sizeAdjust point size for plotting
reductionWhich dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca
group.byName of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class
split.byA factor in object metadata to split the plot by, pass 'ident' to split by cell identity
shape.byIf NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells. Only applicable if
raster = FALSE.orderSpecify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top)
shuffleWhether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)
seedSets the seed if randomly shuffling the order of points.
labelWhether to label the clusters
label.sizeSets size of labels
label.colorSets the color of the label text
label.boxWhether to put a box around the label text (geom_text vs geom_label)
alphaAlpha value for plotting (default is 1)
repelRepel labels
stroke.sizeAdjust stroke (outline) size of points
cells.highlightA list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in
cols.highlightand other cells black (white if dark.theme = TRUE); will also resize to the size(s) passed tosizes.highlightcols.highlightA vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight
sizes.highlightSize of highlighted cells; will repeat to the length groups in cells.highlight. If
sizes.highlight = TRUEsize of all points will be this value.na.valueColor value for NA points when using custom scale
ncolNumber of columns for display when combining plots
combineCombine plots into a single
patchworkedggplot object. IfFALSE, return a list of ggplot objectsrasterConvert points to raster format, default is
NULLwhich automatically rasterizes if plotting more than 100,000 cellsraster.dpiPixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).
label.size.cutoffClusters with fewer cells than the cutoff are not labeled (replaced with ' ' label)
Examples
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
data("pbmc_small")
pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
PlotClusterTree(pbmc_small)
ColorDimSplit(pbmc_small, node = 5)
}
} # }