phylo_to_dendrogram: Convert a phylo object to a dendrogram object

View source: R/dendrogram.R

phylo_to_dendrogramR Documentation

Convert a phylo object to a dendrogram object

Description

Convert a phylo object to a dendrogram object

Usage

phylo_to_dendrogram(obj, log = FALSE)

Arguments

obj

A phylo object.

log

Whether the height of the phylogenetic tree should be log-transformed (log10(x + 1)).

Details

The motivation is that phylogenetic tree may contain polytomies, which means at a certain node, there are more than two children branches. Available tools that do the conversion only support binary trees.

The returned dendrogram object is not in its standard format which means it can not be properly drawn by the plot.dendrogram function. However, you can still apply dendextend::cutree to the returned dendrogram object with no problem and the dendrogram can be properly drawn with the ComplexHeatmap package.

Value

A dendrogram object.

Examples

require(ape)
data(bird.families)
d = phylo_to_dendrogram(bird.families)

require(ComplexHeatmap)
grid.dendrogram(d, test = TRUE)

spiralize documentation built on Aug. 9, 2022, 5:09 p.m.