View source: R/create_cell_colors.R
create_cell_colors | R Documentation |
This function returns a character()
vector with valid R colors for a given
input character()
of unique cell types. These were colors that have been
useful in our experience.
create_cell_colors(
cell_types = c("Astro", "Micro", "Endo", "Oligo", "OPC", "Excit", "Inhib", "Other"),
pallet_name = c("classic", "gg", "tableau"),
pallet = NULL,
split = NA,
preview = FALSE
)
cell_types |
A |
pallet_name |
A
|
pallet |
A |
split |
delineating |
preview |
A |
A named character()
vector of R and hex color values compatible
with ggplot2:scale_color_manual()
.
## create cell colors with included pallets
create_cell_colors(pallet_name = "classic")
create_cell_colors(pallet_name = "classic", preview = TRUE)
create_cell_colors(pallet_name = "tableau", preview = TRUE)
## use custom colors
my_colors <- c("darkorchid4", "deeppink4", "aquamarine3", "darkolivegreen1")
create_cell_colors(cell_type = c("A", "B", "C", "D"),
pallet = my_colors,
preview = TRUE)
## use Rcolor brewer
create_cell_colors(cell_type = c("A", "B", "C"),
pallet = RColorBrewer::brewer.pal(n = 3, name = "Set1"),
previe = TRUE)
## Options for subtype handling
## Provide unique colors for cell subtypes (DEFAULT) - returns one level list
create_cell_colors(
cell_types = c("A.1", "A.2", "B.1", "C", "D"),
pallet_name = "classic",
preview = FALSE
)
## Provide gradient colors for A.1 and A.2 by using the "split" argument
## returns a nested list with broad & fine cell type colors, fine cell types
## are gradient with the top level matching the broad cell type
create_cell_colors(
cell_types = c("A.1", "A.2", "B.1", "C", "D"),
split = "\\.",
pallet_name = "classic",
preview = TRUE
)
## try with custom colors
create_cell_colors(
cell_types = c("A.1", "A.2", "B.1", "C", "D"),
split = "\\.",
pallet = my_colors,
preview = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.