Helper function to return a number of discrete color palettes.
DiscretePalette_scCustomize(
num_colors,
palette = NULL,
shuffle_pal = FALSE,
seed = 123
)
Number of colors to be generated.
Options are "alphabet", "alphabet2", "glasbey", "polychrome", "stepped", "ditto_seq", "varibow".
randomly shuffle the outputted palette. Most useful for varibow
palette as
that is normally an ordered palette.
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)