SeuratColorVector: Regenerate Color Scheme for Clusters in Seurat Object as a...

View source: R/Seurat.Utils.Visualization.R

SeuratColorVectorR Documentation

Regenerate Color Scheme for Clusters in Seurat Object as a vector

Description

Extracts and optionally displays the color scheme assigned to cluster identities within a Seurat object, facilitating consistent color usage across visualizations. You can check results in a barplot with MarkdownHelpers::color_check().

Usage

SeuratColorVector(
  ident = NULL,
  obj = combined.obj,
  plot.colors = FALSE,
  simple = FALSE
)

Arguments

ident

Specific clustering identity to use for color extraction. If NULL, the active identity in obj is used. Default: NULL.

obj

Seurat object from which to extract cluster colors. Default: combined.obj.

plot.colors

If TRUE, visually displays the color scheme. Default: FALSE.

simple

If TRUE, returns only the unique set of colors used. If FALSE, returns a named vector mapping cluster identities to colors. Default: FALSE.

See Also

hue_pal

Examples

## Not run: 
# Display colors for the active identity
SeuratColorVector()
# Retrieve and plot colors for a specified clustering identity
SeuratColorVector(ident = "RNA_snn_res.1", plot.colors = TRUE)

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.