Skip to contents

Create 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 phylo object, 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 a data.frame or tibble with a "node_id" column. If there are multiple trees (a list), then a list of table 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 tree_path <- system.file('extdata', 'example_tree_1.treefile', package = 'heattree') meta_path <- system.file('extdata', 'example_metadata_1.tsv', package = 'heattree') heat_tree(tree_path, metadata = meta_path, aesthetics = c(tipLabelColor = 'source'))