| Title: | Color Palettes for Mycobacterium Tuberculosis Data Visualization |
|---|---|
| Description: | 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>. |
| Authors: | Paula Ruiz-Rodriguez [aut, cre] |
| Maintainer: | Paula Ruiz-Rodriguez <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-05-12 06:56:23 UTC |
| Source: | https://github.com/cran/mycolorsTB |
An unnamed vector of 14 colors derived from the classicTB theme.
classicTBclassicTB
A character vector of 14 hex color codes.
Color palette designed by the PathoGenOmics Lab.
A named vector of 14 colors designed for visualizing Mycobacterium tuberculosis lineages.
mycolorsmycolors
A character vector of 14 hex color codes, named with lineage identifiers.
Color palette designed by the PathoGenOmics Lab.
A palette of 8 colors from the PathoGenOmics Lab theme.
pathogenomicspathogenomics
A character vector of 8 hex color codes.
Color palette designed by the PathoGenOmics Lab.
Visualizes a phylogenetic tree as a cladogram, coloring tips with the mycolors palette.
plot_tb_cladogram(newick_text)plot_tb_cladogram(newick_text)
newick_text |
A character string with the tree in Newick format. |
A ggplot object representing the phylogenetic cladogram.
tree_text <- "(L8,((L1,(L7,(L4,(L2,L3)))),(L5,((A2,(A3,A4)),(A1,(L10,(L6,L9)))))));" plot_tb_cladogram(tree_text)tree_text <- "(L8,((L1,(L7,(L4,(L2,L3)))),(L5,((A2,(A3,A4)),(A1,(L10,(L6,L9)))))));" plot_tb_cladogram(tree_text)
Reads a tree in Newick format and plots it using ggtree, coloring tips with the mycolors palette.
plot_tb_tree(newick_text)plot_tb_tree(newick_text)
newick_text |
A character string with the tree in Newick format. |
A ggplot object representing the phylogenetic tree.
tree_text <- "(L8,((L1,(L7,(L4,(L2,L3)))),(L5,((A2,(A3,A4)),(A1,(L10,(L6,L9)))))));" plot_tb_tree(tree_text)tree_text <- "(L8,((L1,(L7,(L4,(L2,L3)))),(L5,((A2,(A3,A4)),(A1,(L10,(L6,L9)))))));" plot_tb_tree(tree_text)
Applies the classicTB palette to the color aesthetic in a ggplot.
scale_color_classicTB()scale_color_classicTB()
A ggplot2 scale object.
Applies the mycolors palette to the color aesthetic in a ggplot.
scale_color_mycolors()scale_color_mycolors()
A ggplot2 scale object.
Applies the classicTB palette to the fill aesthetic in a ggplot.
scale_fill_classicTB()scale_fill_classicTB()
A ggplot2 scale object.
Applies the mycolors palette to the fill aesthetic in a ggplot.
scale_fill_mycolors()scale_fill_mycolors()
A ggplot2 scale object.
Uses color interpolation to create a custom number of colors from a given palette.
tb_palette(n, palette_name = "classicTB")tb_palette(n, palette_name = "classicTB")
n |
The number of colors to generate. |
palette_name |
The name of the palette to use ("mycolors", "classicTB", or "pathogenomics"). |
A character vector of n hex color codes.
# Generate 20 colors from the 'classicTB' palette my_custom_colors <- tb_palette(20, "classicTB") plot(1:20, 1:20, col = my_custom_colors, pch = 19, cex = 3)# Generate 20 colors from the 'classicTB' palette my_custom_colors <- tb_palette(20, "classicTB") plot(1:20, 1:20, col = my_custom_colors, pch = 19, cex = 3)
Generates a ggplot visualization of a specified package palette.
view_palette(palette_name = "mycolors")view_palette(palette_name = "mycolors")
palette_name |
The name of the palette to display ("mycolors", "classicTB", or "pathogenomics"). |
A ggplot object showing the colors of the chosen palette.
view_palette("mycolors") view_palette("classicTB")view_palette("mycolors") view_palette("classicTB")