phylo_to_dendrogram: Convert a phylo object to a dendrogram object

Description Usage Arguments Details Value Examples

View source: R/dendrogram.R

Description

Convert a phylo object to a dendrogram object

Usage

1

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

1
2
3
4
5
6
require(ape)
data(bird.families)
d = phylo_to_dendrogram(bird.families)

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

spiralize documentation built on Feb. 6, 2022, 1:06 a.m.