phylo_to_dendrogram | R Documentation |
Convert a phylo object to a dendrogram object
phylo_to_dendrogram(obj, log = FALSE)
obj |
A |
log |
Whether the height of the phylogenetic tree should be log-transformed (log10(x + 1)). |
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.
A dendrogram
object.
require(ape) data(bird.families) d = phylo_to_dendrogram(bird.families) require(ComplexHeatmap) grid.dendrogram(d, test = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.