Colour palettes and helper functions for visualising Mycobacterium tuberculosis genomic and epidemiological data with 'ggplot2' and 'ggtree'. The package provides predefined palettes, scale functions, tree/cladogram helpers, and convenient preview tools to ensure consistent branding in pathogen-omics visualisations. The palettes were developed as part of the 'mycolorsTB' project < https://github.com/PathoGenOmics-Lab/mycolorsTB>.
You can install the released version of mycolorsTB from GitHub with:
install.packages("devtools")
devtools::install_github("PathoGenOmics-Lab/mycolorsTB")
show(mycolorsTB::mycolors) #vector with lineage names
show(mycolorsTB::classicTB) #vector witout lineage names
library(ggplot2)
library(mycolorsTB)
# Example data
data <- data.frame(
x = 1:14,
y = rnorm(14),
group = rep(c(paste0("A", 1:4), paste0("L", 1:10)), each = 1)
)
# Fill: Plot with mycolors lineages names
ggplot(data, aes(x = x, y = y, fill = group)) +
geom_bar(stat = "identity") +
scale_fill_mycolors() + # scale_fill_manual(values = mycolors)
theme_minimal()
#d1ae00#8ef5c8#73c2ff#ff9cdb#ff3091#001aff#8a0bd2#ff0000#995200#1eb040#fbff00#ff9d00#37ff30#8fbda1(L8,((L1,(L7,(L4,(L2,L3)))),(L5,((A2,(A3,A4)),(A1,(L10,(L6,L9)))))));