Title: | Drawing 'dendrogram' using 'ggtree' |
---|---|
Description: | Offers a set of 'autoplot' methods to visualize tree-like structures (e.g., hierarchical clustering and classification/regression trees) using 'ggtree'. You can adjust graphical parameters using grammar of graphic syntax and integrate external data to the tree. |
Authors: | Guangchuang Yu [aut, cre, cph]
|
Maintainer: | Guangchuang Yu <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.7.0 |
Built: | 2024-07-22 05:33:40 UTC |
Source: | https://github.com/bioc/ggtreeDendro |
geom_line_cutree
geom_line_cutree(group, linetype = "dashed", offset = 0, ...)
geom_line_cutree(group, linetype = "dashed", offset = 0, ...)
group |
output of cutree or number of subtree |
linetype |
linetype |
offset |
offset of the line |
... |
additional parameters to set the line (e.g., color, size, etc.) |
line layer
d <- dist(USArrests) hc <- hclust(d, "ave") autoplot(hc) + geom_line_cutree(4)
d <- dist(USArrests) hc <- hclust(d, "ave") autoplot(hc) + geom_line_cutree(4)
geom_rect_subtree
geom_rect_subtree(group = NULL, color = "red", ...)
geom_rect_subtree(group = NULL, color = "red", ...)
group |
output of cutree or number of subtree |
color |
border color to highlight subtrees |
... |
additional parameters pass to 'ggtree::hilight()' |
rect layer
d <- dist(USArrests) hc <- hclust(d, "ave") autoplot(hc) + geom_rect_subtree(4)
d <- dist(USArrests) hc <- hclust(d, "ave") autoplot(hc) + geom_rect_subtree(4)
This package implements a set of 'autoplot()' methods to display tree structure. The output of it is a 'ggtree' object, which can be annotated by adding layers using 'ggplot2' syntax. Users also can integrate associated data to annotate the tree using 'ggtree' and 'ggtreeExtra' packages.
scale tree color by subtree (e.g., output of cutree, kmeans, or other clustering algorithm)
scale_color_subtree(group) scale_colour_subtree(group)
scale_color_subtree(group) scale_colour_subtree(group)
group |
taxa group information |
updated tree view
Guangchuang Yu
d <- dist(USArrests) hc <- hclust(d, "ave") autoplot(hc) + scale_color_subtree(3)
d <- dist(USArrests) hc <- hclust(d, "ave") autoplot(hc) + scale_color_subtree(3)