View source: R/Color_Palettes.R
DiscretePalette_scCustomize | R Documentation |
Helper function to return a number of discrete color palettes.
DiscretePalette_scCustomize(
num_colors,
palette = NULL,
shuffle_pal = FALSE,
seed = 123
)
num_colors |
Number of colors to be generated. |
palette |
Options are "alphabet", "alphabet2", "glasbey", "polychrome", "stepped", "ditto_seq", "varibow". |
shuffle_pal |
randomly shuffle the outputted palette. Most useful for |
seed |
random seed for the palette shuffle. Default = 123. |
A vector of colors
This function uses the paletteer package https://github.com/EmilHvitfeldt/paletteer to provide simplified access to color palettes from many different R package sources while minimizing scCustomize current and future dependencies.
The following packages & palettes are called by this function (see individual packages for palette references/citations):
pals (via paletteer) https://CRAN.R-project.org/package=pals
alphabet, alphabet2, glasbey, polychrome, and stepped.
dittoSeq https://bioconductor.org/packages/release/bioc/html/dittoSeq.html
dittoColors.
colorway https://github.com/hypercompetent/colorway
varibow
Function name and implementation modified from Seurat (License: GPL-3). https://github.com/satijalab/seurat
pal <- DiscretePalette_scCustomize(num_colors = 36, palette = "varibow")
PalettePlot(pal= pal)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.