Package 'ggtreeDendro'

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] , Shuangbin Xu [ctb] , Chuanjie Zhang [ctb]
Maintainer: Guangchuang Yu <[email protected]>
License: Artistic-2.0
Version: 1.9.0
Built: 2024-10-30 08:05:23 UTC
Source: https://github.com/bioc/ggtreeDendro

Help Index


autoplot

Description

autoplot

Usage

autoplot(object, ...)

## S3 method for class 'hclust'
autoplot(object, layout = "dendrogram", ladderize = FALSE, hang = 0.1, ...)

## S3 method for class 'linkage'
autoplot(object, layout = "dendrogram", ladderize = FALSE, hang = 0.1, ...)

## S3 method for class 'dendrogram'
autoplot(object, layout = "dendrogram", ladderize = FALSE, hang = 0.1, ...)

## S3 method for class 'agnes'
autoplot(object, layout = "dendrogram", ladderize = FALSE, hang = 0.1, ...)

## S3 method for class 'diana'
autoplot(object, layout = "dendrogram", ladderize = FALSE, hang = 0.1, ...)

## S3 method for class 'twins'
autoplot(object, layout = "dendrogram", ladderize = FALSE, hang = 0.1, ...)

## S3 method for class 'bclust'
autoplot(object, ...)

## S3 method for class 'hdbscan'
autoplot(object, ...)

## S3 method for class 'hkmeans'
autoplot(object, ...)

## S3 method for class 'dendro'
autoplot(object, ...)

## S3 method for class 'pvclust'
autoplot(
  object,
  layout = "dendrogram",
  ladderize = FALSE,
  label_edge = FALSE,
  pvrect = FALSE,
  alpha = 0.95,
  hang = 0.1,
  ...
)

## S3 method for class 'ClusterExperiment'
autoplot(object, layout = "rectangular", ...)

## S3 method for class 'genoMatriXeR'
autoplot(object, hctype = "rows", ...)

## S3 method for class 'multiLocalZScore'
autoplot(object, ...)

Arguments

object

input object

...

additional paramters that passed to ggtree

layout

layout for plotting the tree

ladderize

logical whether ladderize the tree (default FALSE)

hang

numeric The fraction of the tree plot height by which labels should hang below the rest of the plot. A negative value will cause the labels to hang down from 0.

label_edge

logical whether display the label of edge (only for pvclust object), default is FALSE.

pvrect

logical whether display the clusters with relatively high/low p-values, default is FALSE. (only for pvclust object)

alpha

numeric the threshold value for p-values, default is 0.95 (only for pvclust object).

Value

ggtree object

Examples

d <- dist(USArrests)
hc <- hclust(d, "ave")
autoplot(hc) + geom_tiplab()

geom_line_cutree

Description

geom_line_cutree

Usage

geom_line_cutree(group, linetype = "dashed", offset = 0, ...)

Arguments

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.)

Value

line layer

Examples

d <- dist(USArrests)
hc <- hclust(d, "ave")
autoplot(hc) + geom_line_cutree(4)

geom_rect_subtree

Description

geom_rect_subtree

Usage

geom_rect_subtree(group = NULL, color = "red", ...)

Arguments

group

output of cutree or number of subtree

color

border color to highlight subtrees

...

additional parameters pass to 'ggtree::hilight()'

Value

rect layer

See Also

geom_hilight;

Examples

d <- dist(USArrests)
hc <- hclust(d, "ave")
autoplot(hc) + geom_rect_subtree(4)

scale_color_subtree

Description

scale tree color by subtree (e.g., output of cutree, kmeans, or other clustering algorithm)

Usage

scale_color_subtree(group)

scale_colour_subtree(group)

Arguments

group

taxa group information

Value

updated tree view

Author(s)

Guangchuang Yu

Examples

d <- dist(USArrests)
hc <- hclust(d, "ave")
autoplot(hc) + scale_color_subtree(3)