3 Exploration of Visualization Types
3.1 Import data
# Load required packages
library(phyloseq)
library(tidyverse)
cat("\nSaved RData objects\n\n")
Saved RData objects
load("data/external_ps_objects.rda", verbose = T)
Loading objects:
df_GlobalPatterns
df_dietswap
df_caporaso
df_kostic_crc
ps_GlobalPatterns
ps_dietswap
ps_caporaso
ps_kostic_crc
load("data/ps_transformed.rda", verbose = T)
Loading objects:
ps_asin
ps_identity
ps_compositional
ps_z_otu
ps_z_sample
ps_log10
ps_log10p
ps_clr
ps_shift
ps_scale
load("data/bray_distances.rda", verbose = T)
Loading objects:
ps_asin_bray_dist
ps_compositional_bray_dist
ps_z_otu_bray_dist
ps_z_sample_bray_dist
ps_log10_bray_dist
ps_log10p_bray_dist
ps_clr_bray_dist
ps_shift_bray_dist
ps_scale_bray_dist
load("data/psextra_distances.rda", verbose = T)
Loading objects:
psextra_clr_asin_bray_dist
psextra_id_asin_bray_dist
psextra_log10p_asin_bray_dist
load("data/reduced_dimension.rda", verbose = T)
Loading objects:
pca_asin_bray_metrics
mds_asin_bray_metrics
pcoa_asin_bray_metrics
tsne_asin_bray_metrics
load("data/phyloseq_extra_objects.rda", verbose = T)
Loading objects:
psextra_clr_dietswap
psextra_id_dietswap
psextra_log10p_dietswap
load("data/phyloseq_raw_rel_psextra_df_objects.rda", verbose = T)
Loading objects:
ps_raw
ps_rel
psextra_raw
psextra_rel
ps_df
3.2 Major visualization R colors
In R, there are several built-in palettes that we can use for color schemes in plots. Some commonly used palettes include:
[1] "#66C2A5" "#FC8D62" "#8DA0CB" "#E78AC3" "#A6D854" "#FFD92F" "#E5C494"
[8] "#B3B3B3"
[1] "#B3B3B3" "#E5C494" "#FFD92F" "#A6D854" "#E78AC3" "#8DA0CB" "#FC8D62"
[8] "#66C2A5"
[1] "#440154FF" "#46337EFF" "#365C8DFF" "#277F8EFF" "#1FA187FF" "#4AC16DFF"
[7] "#9FDA3AFF" "#FDE725FF"
[1] "#FDE725FF" "#9FDA3AFF" "#4AC16DFF" "#1FA187FF" "#277F8EFF" "#365C8DFF"
[7] "#46337EFF" "#440154FF"
[1] "#FF0000" "#FFBF00" "#80FF00" "#00FF40" "#00FFFF" "#0040FF" "#8000FF"
[8] "#FF00BF"
[1] "#FF00BF" "#8000FF" "#0040FF" "#00FFFF" "#00FF40" "#80FF00" "#FFBF00"
[8] "#FF0000"
viridis: A perceptually uniform and colorblind-friendly palette.
magma: A palette with a dark-to-light color scheme.
inferno: A palette with a light-to-dark color scheme.
plasma: A palette with a dark-to-light color scheme.
cool: A palette with cool colors.
hot: A palette with hot colors.
terrain.colors: A palette with colors resembling a terrain map.
rainbow: A palette with colors of the rainbow.
heat.colors: A palette with colors ranging from dark red to yellow.
In ggpubr: “npg”, “aaas”, “lancet”, “jco”, “ucscgb”, “uchicago”, “simpsons” and “rickandmorty”.
3.3 Major visualization techniques
Below are some of the key visualization techniques used in microbiome research, along with their descriptions and the corresponding tools in R.
Visual Type | Description |
---|---|
Barplots | Display the relative abundances of different taxa across groups. |
Heatmaps | Represent the abundance or presence/absence of taxa across samples. |
Scatter plots | Useful for visualizing relationships between numerical variables |
Box plots | Summarize the distribution of a variable |
PCA plots | Dimensionality reduction technique for visualizing similarities or dissimilarities between samples based on their microbial composition |
Alpha diversity plots | Measure the diversity within a sample, e.g. rarefaction plot |
Beta diversity plots | Measure the dissimilarity between samples, e.g. PCoA ordination |
Line plot | Visualize changes in the abundance of specific taxa over time or across different conditions. |
Network plots | Depict interactions or associations between taxa |
Volcano plots | Identify statistically significant differences in abundance between groups |
Correlation plots | Visualize correlations between taxa or between taxa and metadata variables |
UpSet plots | Display intersections of sets and their size in a matrix layout |
Venn diagrams | Show overlap between taxa or groups |
Differential abundance plots | Visualize differences in abundance between groups while controlling for confounding factors |
Indicator species analysis plots | Identify taxa associated with specific groups or conditions |