Skip to contents

Thin wrapper around plot_tree() with abundance mapping enabled.

Usage

plot_tree_abundance(
  object,
  tree = c("otu_tree", "taxa_tree"),
  layout = "dendrogram",
  use_link = TRUE,
  abundance_method = c("sum", "mean", "median"),
  taxonomic_rank = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"),
  show_tip_label = TRUE,
  tip_label_size = 2.5
)

Arguments

object

A microbiome_dataset object.

tree

Tree slot to plot, either "otu_tree" or "taxa_tree".

layout

Graph layout passed to ggraph::ggraph().

Should explicit *_tree_link metadata be used before falling back to label-based matching? Defaults to TRUE.

abundance_method

Summary used when abundance is mapped onto nodes.

taxonomic_rank

Taxonomic rank used when mapping abundance onto taxa_tree. Ignored for otu_tree.

show_tip_label

Should tip labels be drawn? Defaults to TRUE.

tip_label_size

Text size for tip labels.

Value

A ggplot object.

Examples

data("global_patterns", package = "microbiomedataset")
x <- prune_taxa(global_patterns, variable_id = global_patterns@variable_info$variable_id[1:120])
x <- align_tree(x, tree = "taxa_tree")
plot_tree_abundance(x, tree = "taxa_tree", taxonomic_rank = "Phylum")
#> Warning: Ignoring empty aesthetic: `size`.