本文へ移動
cccskills
無料GitHub で公開

bioconductor-ggtree

'ggtree' extends the 'ggplot2' plotting system which implemented the grammar of graphics. 'ggtree' is designed for visualization and annotation of phylogenetic trees and other tree-like structures with their annotation data.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md6.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

ggtree

ggtree extends the ggplot2 plotting system to implement the grammar of graphics for phylogenetic trees. It is designed for the visualization, manipulation, and annotation of phylogenetic trees and other tree-like structures with their associated multi-omics and clinical metadata.

Dependencies & Environment

Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.

  • Version: 4.2.0 · Bioconductor: 3.23 · R: ≥ 4.6
  • Imports: ape, aplot, cli, dplyr, ggfun, ggiraph, ggplot2, magrittr, purrr, rlang, scales, tidyr, tidytree, treeio, yulab.utils
  • Install: BiocManager::install("ggtree")

When to Use

  • Visualizing complex phylogenetic trees (e.g., from RAxML, IQ-TREE, or BEAST) integrated with multi-omics metadata (such as microbiome abundance, genomic features, or clinical traits).
  • Annotating tree nodes, clades, and leaves with custom shapes, colors, images, or subplots (e.g., barplots, pie charts) using the grammar of graphics.
  • Displaying circular, radial, rectangular, or slanted tree layouts for large-scale evolutionary studies containing hundreds to thousands of taxa.

When NOT to Use

  • For interactive, web-based tree exploration, use phylocanvas or iTOL instead because ggtree produces static vector graphics.
  • For simple, quick tree plotting without complex annotations, use ape::plot.phylo instead because it has zero overhead and requires no ggplot2 syntax.
  • For highly customized interactive network visualizations that are not strictly hierarchical, use ggnetwork or tidygraph instead because ggtree is optimized specifically for tree topologies.

Data Requirements

  • Input format: Tree objects of class phylo (from ape), treedata (from treeio), or standard R dendrograms.
  • Metadata: A data frame containing a column matching the tip labels of the tree.
  • Scale: Supports trees from 10 to 10,000+ tips, though rendering times scale with taxon count.

Key Parameters

  • layout ("rectangular"): Layout of the tree; options include "circular", "slanted", "fan", "radial", "unrooted", "equal_angle", or "daylight".
  • ladderize (TRUE): Logical; whether to sort the branches to make the tree look more structured.
  • branch.length ("branch.length"): Variable to determine branch lengths; set to "none" for cladograms with equal branch lengths.
  • as.Date (FALSE): Logical; whether to parse the x-axis as dates for time-resolved (chronogram) trees.
  • yscale (NULL): Variable used to scale the y-axis, useful for custom vertical spacing.

Best Practices

  • Use the treeio package to import trees from diverse software formats (e.g., BEAST, MrBayes, NHX) to preserve node-level annotations.
  • Attach external metadata using the %<+% operator to seamlessly map sample traits to tree tips or internal nodes.
  • For large trees, use layout = "circular" or layout = "fan" to maximize space efficiency and prevent text overlap.
  • Adjust label offsets and text sizes dynamically using geom_tiplab(offset = ...) to prevent labels from clipping outside the plot boundaries.

Common Pitfalls

  • Tip labels overlapping or cut off: Occurs when tree margins are too small or labels are long; fix this by adding hexpand() or xlim() to extend the plot canvas.
  • Metadata mapping failure: Occurs when the ID column in the metadata does not match the tip labels exactly; fix this by ensuring row.names or a specific ID column matches tree$tip.label.
  • Slow rendering of large trees: Occurs when adding too many individual geom layers to a tree with >10,000 tips; fix this by collapsing clades using collapse() before plotting.

Alternatives

  • ape: The foundational R phylogenetics package, faster for basic plotting but lacks ggplot2 integration.
  • ggtreeExtra: An extension of ggtree designed specifically for presenting circular layouts with multiple rings of complex genomic data.
  • phyloseq: Excellent for microbiome-specific tree plotting, but less flexible for general phylogenetic annotations than ggtree.
  • tanggle: Specifically designed for visualizing phylogenetic networks rather than strict bifurcating trees.

Citations

  • Yu, G., Smith, D. K., Zhu, H., Guan, Y., & Lam, T. T. Y. (2017). ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution, 8(1), 28-36.
  • Yu, G. (2022). Integration, Manipulation and Visualization of Phylogenetic Trees (1st ed.). Chapman and Hall/CRC.

References

<!-- biomate-cta -->

Run this on BioMate

This skill is the knowledge layer — when, why, and how to use ggtree. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.

▶ Open ggtree on BioMate →

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

The package contains functions for exploratory oligonucleotide array analysis. The dependence on tkWidgets only concerns few convenience functions. 'affy' is fully functional without it.

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

This tool uses the label-tree function from HyPhy to annotate a phylogenetic tree. It allows users to select a subset of leaves using either a regular expression or a list of sequence names, and then apply a specified label to these selecte

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

This package provides a client for the Bioconductor AnnotationHub web resource. The AnnotationHub web resource provides a central location where genomic files (e.g., VCF, bed, wig) and other resources from standard locations (e.g., UCSC, En

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

apeglm provides Bayesian shrinkage estimators for effect sizes for a variety of GLM models, using approximation of the posterior for individual coefficients.

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

ASURAT is a software for single-cell data analysis. Using ASURAT, one can simultaneously perform unsupervised clustering and biological interpretation in terms of cell type, disease, biological process, and signaling pathway activity. Inputting a single-cell RNA-seq data and knowledge-based databases, such as Cell Ontology, Gene Ontology, KEGG, etc., ASURAT transforms gene expression tables into original multivariate tables, termed sign-by-sample matrices (SSMs).

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

AUCell allows to identify cells with active gene sets (e.g. signatures, gene modules...) in single-cell RNA-seq data. AUCell uses the "Area Under the Curve" (AUC) to calculate whether a critical subset of the input gene set is enriched with

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

bioMate-AI のスキルをすべて見る

このスキルの問題を報告する