Create an interactive phylogenetic tree
heat_tree.RdCreate an interactive phylogenetic tree using the javascript heat-tree package
Usage
heat_tree(
tree = NULL,
metadata = NULL,
aesthetics = NULL,
width = NULL,
height = NULL,
elementId = NULL,
...
)Arguments
- tree
One or more trees to plot. Can be a raw newick-formatted string, a
phyloobject, or a list of such inputs. If a list is provided, its names will be used to name trees.- metadata
Metadata associated with
tree. Can be adata.frameortibblewith a column containing IDs matching the tree labels. The ID column is detected automatically. If there are multiple trees (a list), then a list of tables of equal length is required. If a list is provided, its names will be used to name metadata tables.- aesthetics
A named character vector defining which metadata columns are initially used to color/size tree parts. If there are multiple trees (a list), then a list of equal length is required.
- width
Width of the widget (CSS units or number).
- height
Height of the widget (CSS units or number).
- elementId
Optional element ID for the widget.
- ...
Options passed to options parameter of the underlying
HeatTree.heatTree()javascript function to modify the initial state of the widget.
Examples
# Create an empty tree viewer for loading data interactively
heat_tree()
# Create a tree viewer with example data included with the package
data(weisberg_2020_metadata)
data(weisberg_2020_mlsa)
heat_tree(
tree = weisberg_2020_mlsa,
metadata = weisberg_2020_metadata,
aesthetics = c(tipLabelColor = 'host_type')
)