ColorDimSplit: Color dimensional reduction plot by tree split

Description Usage Arguments Value See Also Examples

View source: R/visualization.R

Description

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

1
2
3
4
5
6
7
8
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 DimPlot

dims

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

cells

Vector of cells to plot (default is all cells)

cols

Vector 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. See DiscretePalette for details.

pt.size

Adjust point size for plotting

reduction

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

group.by

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

split.by

Name of a metadata column to split plot by; see FetchData for more details

shape.by

If 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.

order

Specify 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)

shuffle

Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)

seed

Sets the seed if randomly shuffling the order of points.

label

Whether to label the clusters

label.size

Sets size of labels

label.color

Sets the color of the label text

label.box

Whether to put a box around the label text (geom_text vs geom_label)

repel

Repel labels

cells.highlight

A 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.highlight and other cells black (white if dark.theme = TRUE); will also resize to the size(s) passed to sizes.highlight

cols.highlight

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

sizes.highlight

Size of highlighted cells; will repeat to the length groups in cells.highlight

na.value

Color value for NA points when using custom scale

ncol

Number of columns for display when combining plots

combine

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

raster

Convert points to raster format, default is NULL which automatically rasterizes if plotting more than 100,000 cells

Value

Returns a DimPlot

See Also

DimPlot

Examples

1
2
3
4
5
data("pbmc_small")
pbmc_small
pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
PlotClusterTree(pbmc_small)
ColorDimSplit(pbmc_small, node = 5)

ibseq/scs-analysis documentation built on Feb. 27, 2021, 12:35 a.m.