Skip to contents

Set a global colour scheme for a series of plots.

Usage

global_colour_scheme(all_taxa, unique_taxa)

Arguments

all_taxa

All taxa from the initial relative abundance table, as a character vector.

unique_taxa

The unique taxa among your subsetted/pooled relative abundance table.

Value

A named vector.

Examples

asv <- system.file("extdata/tsv", "seqtab.tsv", package = "bubbler")
taxa <- system.file("extdata/tsv", "taxa.tsv", package = "bubbler")
rel_abund <- rel_abund_tsv(asv, taxa) %>% add_other()
rel_abund_l <- rel_abund %>%
    subset_high_low(n = 10)
rel_abund_h <- rel_abund %>%
    subset_high_low(n = 50, flip = TRUE)
unique_taxa <- extract_unique_taxa(rel_abund_l, rel_abund_h)
all_taxa <- rel_abund %>% all_taxa()
#> Warning: There was 1 warning in `dplyr::mutate()`.
#>  In argument: `taxon = forcats::fct_reorder(taxon, mean)`.
#> Caused by warning:
#> ! `fct_reorder()` removing 1 missing value.
#>  Use `.na_rm = TRUE` to silence this message.
#>  Use `.na_rm = FALSE` to preserve NAs.
global_colour_scheme(all_taxa, unique_taxa)
#>   Synergistota Actinomycetota      Bacillota   Bacteroidota Pseudomonadota 
#>    "#30123BFF"    "#28BBECFF"    "#A2FC3CFF"    "#FB8022FF"    "#7A0403FF"