Skip to contents

Convert plot_tree() output to an interactive plotly widget.

Usage

plot_tree_interactive(
  object,
  tree = c("otu_tree", "taxa_tree"),
  layout = "dendrogram",
  use_link = TRUE,
  color_by = NULL,
  size_by = NULL,
  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.

color_by

Optional variable mapped to node color.

size_by

Optional variable mapped to node size.

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 plotly htmlwidget.

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_interactive(x, tree = "taxa_tree", taxonomic_rank = "Phylum")
727374757677788182838485868788899091929394959697987980789101145635363233344243443738394041454647481516171819202122232425262728293031121314495051525354555657586061625963646566676831299100101102103104105106697071112113111109110107108115114116117118119120