| Title: | A Self-Contained Widget for Interactive Phylogenetic Tree Visualization |
|---|---|
| Description: | Creates self-contained widgets for interactive phylogenetic tree visualization. This package wraps the 'JavaScript' 'heat-tree' package using the 'htmlwidgets' R package. |
| Authors: | Zachary Foster [aut, cre] (ORCID: <https://orcid.org/0000-0002-5075-0948>), Niklaus Grunwald [aut] (ORCID: <https://orcid.org/0000-0003-1656-7602>), USDA Agricultural Research Service [fnd] |
| Maintainer: | Zachary Foster <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.1 |
| Built: | 2026-05-08 21:09:39 UTC |
| Source: | https://github.com/grunwaldlab/heattree |
Isolate metadata from Bansal et al. 2021 (doi:10.1016/j.ygeno.2021.09.021) included for use as an example data set. This is the parsed version of the included "bansal_2021_metadata.tsv" file.
data.frame
Bansal, K., Kumar, S., Kaur, A., Singh, A. and Patil, P.B., 2021. Deep phylo-taxono genomics reveals Xylella as a variant lineage of plant associated Xanthomonas and supports their taxonomic reunification along with Stenotrophomonas and Pseudoxanthomonas. Genomics, 113(6), pp.3989-4003.
A core gene phylogeny from Bansal et al. 2021 (doi:10.1016/j.ygeno.2021.09.021) included for use as an example data set. This is the parsed version of the included "bansal_2021_tree.nwk" file.
ape::phylo
Bansal, K., Kumar, S., Kaur, A., Singh, A. and Patil, P.B., 2021. Deep phylo-taxono genomics reveals Xylella as a variant lineage of plant associated Xanthomonas and supports their taxonomic reunification along with Stenotrophomonas and Pseudoxanthomonas. Genomics, 113(6), pp.3989-4003.
Create an interactive phylogenetic tree using the javascript heat-tree package
heat_tree( tree = NULL, metadata = NULL, aesthetics = NULL, width = NULL, height = NULL, elementId = NULL, ... )heat_tree( tree = NULL, metadata = NULL, aesthetics = NULL, width = NULL, height = NULL, elementId = NULL, ... )
tree |
One or more trees to plot. Can be a raw newick-formatted string,
a |
metadata |
Metadata associated with |
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 |
An htmlwidget object of class heat_tree that renders an interactive
phylogenetic tree visualization. The object contains:
x: A list with tree data and options passed to JavaScript
width, height: Dimensions of the widget
elementId: Optional DOM element ID
The widget can be displayed in R Markdown, Quarto, or using and IDE like RStudio.
# 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') )# 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') )
Output and render functions for using heat_tree within Shiny applications and interactive Rmd documents.
heat_treeOutput(outputId, width = "100%", height = "400px") renderheat_tree(expr, env = parent.frame(), quoted = FALSE)heat_treeOutput(outputId, width = "100%", height = "400px") renderheat_tree(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a heat_tree |
env |
The environment in which to evaluate |
quoted |
Is |
heat_treeOutput() returns an output function that creates a Shiny UI element
for displaying a heat_tree widget. Used in the UI definition of a Shiny app.
renderheat_tree() returns a render function that can be assigned to an output
element in the server function of a Shiny app. It returns a Shiny render binding.
A BEAST phylogeny from Weisberg et al. 2020 (doi:10.1126/science.aba5256) included for use as an example data set. This is the parsed version of the included "weisberg_2020_beast.tre" file.
ape::phylo
Alexandra J. Weisberg et al., Unexpected conservation and global transmission of agrobacterial virulence plasmids.Science368,eaba5256(2020)
Isolate metadata from Weisberg et al. 2020 (doi:10.1126/science.aba5256) included for use as an example data set. This is the parsed version of the included "weisberg_2020_metadata.tsv" file.
data.frame
Alexandra J. Weisberg et al., Unexpected conservation and global transmission of agrobacterial virulence plasmids.Science368,eaba5256(2020)
A MLSA phylogeny from Weisberg et al. 2020 (doi:10.1126/science.aba5256) included for use as an example data set. This is the parsed version of the included "weisberg_2020_mlsa.tre" file.
ape::phylo
Alexandra J. Weisberg et al., Unexpected conservation and global transmission of agrobacterial virulence plasmids.Science368,eaba5256(2020)