knitr::opts_chunk$set(echo = FALSE)

Visualizing taxonomic abundances with heat trees

library(metacoder)
library(RColorBrewer)
remote_dir="https://raw.githubusercontent.com/PacktPublishing/R-Bioinformatics-Cookbook/master"

biom_file <- file.path(remote_dir, "datasets", "ch5", "rich_high_count_otu.biom")
taxdata <- parse_qiime_biom(biom_file)
str(taxdata)

Visualization

heat_tree(taxdata, node_label = taxon_names, node_size = n_obs, node_color = n_supertaxa, layout = "gem", title = "sample heat tree", node_color_axis_label = "Number of Supertaxa", node_size_axis_label = "Number of OTUs", node_color_range = brewer.pal(5, "Greens"))


eckartbindewald/bfxapps2 documentation built on Feb. 6, 2025, 3:22 a.m.