View source: R/params_functions.R View source: R/Package-Code5-Compiled.R
set_annot_cols | R Documentation |
Set colors corresponding to both sample and gene annotations stored in the annotations and annotations.genes parameters of the params list object that are passed to a variety of functions in the dataVisEasy package.
set_annot_cols(annot_cols)
annot_cols |
list for specifying colors for both annotations and annotations.genes manually. Not all annotations in these dataframes must be specified here (default colors will be supplied otherwise when necessary) but all levels of the annotations included must be designated a specific color (see examples) |
Setting up colors for annotations through use of this function allows for a wide range of versatility for all other functions in the package. The names in the list MUST match with the colnames of annotations or annotations.genes dataframes in the params list object. Setting these colors will result in these colors being present whenever the data is colored for annotations in other functions used in the package. If colors are not specified, default color values will be applied when necessary. (Not all annotations need to have custom colors, those that do not will be given default colors while those that are specified will be shown as such.) If not all of the levels of the associated annotations for samples or genes are specified with their corresponding color, they will be set to white when necessary.
Please see params for more information about accessing and setting up these variables.
~~Alison Moss~~
Add or update values with update_annot_cols
##initiate parameters and annotations
initiate_params()
set_annotations(RAGP_annots)
scatterGenes(RAGP_norm, "Th","Chat", color.by = "State")
##set up list for color annotations and set colors
state.cols <- RColorBrewer::brewer.pal(6,"Set1"); names(state.cols) <- LETTERS[1:6]
annot_cols <- list('Connectivity'=c("SAN-Projecting"="blue","Non-SAN-Projecting"="violet",
"No Info Available"="grey"),
'Animal'=c("PR1534"="#0571b0","PR1643"="#ca0020","PR1705"="#92c5de",
"PR1729"="#f4a582"),
"State"=c(state.cols))
set_annot_cols(annot_cols)
scatterGenes(RAGP_norm, "Th","Chat", color.by = "State")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.