
Plot an Interactive Tree
Source:R/analysis_result_visualization_advanced.R
plot_tree_interactive.RdConvert 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_datasetobject.- tree
Tree slot to plot, either
"otu_tree"or"taxa_tree".- layout
Graph layout passed to
ggraph::ggraph().- use_link
Should explicit
*_tree_linkmetadata be used before falling back to label-based matching? Defaults toTRUE.- color_by
Optional variable mapped to node color.
- size_by
Optional variable mapped to node size.
- abundance_method
Summary used when
abundanceis mapped onto nodes.- taxonomic_rank
Taxonomic rank used when mapping abundance onto
taxa_tree. Ignored forotu_tree.- show_tip_label
Should tip labels be drawn? Defaults to
TRUE.- tip_label_size
Text size for tip labels.
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")