phylo_to_dendrogram {spiralize} | R 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 |
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)
[Package spiralize version 1.0.6 Index]