View source: R/Seurat.Utils.Visualization.R
getDiscretePaletteObj | R Documentation |
Generates a discrete color palette for visualizing clusters in a Seurat object, using a specified identity column to determine the number of unique clusters.
getDiscretePaletteObj(
ident.used,
obj,
palette.used = c("alphabet", "alphabet2", "glasbey", "polychrome", "stepped")[2],
show.colors = FALSE,
seed = 1989
)
ident.used |
Identity column in the Seurat object to base the color palette on. |
obj |
Seurat object containing clustering information. |
palette.used |
The palette name to use for color generation. Options include "alphabet", "alphabet2", "glasbey", "polychrome", and "stepped". Default: "alphabet2". |
show.colors |
If TRUE, displays the generated colors. Default: |
seed |
Seed for random color generation, ensuring reproducibility. Default: 1989. |
A character vector of color values corresponding to the number of clusters.
## Not run:
if (interactive()) {
ident.used <- "resolution_1"
obj <- YourSeuratObject
colors <- getDiscretePaletteObj(ident.used = ident.used, obj = obj)
print(colors)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.