Make ggplot interactive
Horizontal versions of ggplot2 geoms
Extra coordinate systems, geoms & stats
Accelarating ggplot2
Repel overlapping text labels
Plot graph-like data structures
Miscellaneous extensions to ggplot2
Network visualizations in ggplot2
Marginal density plots or histograms
Create easy animations with ggplot2
Interactive ROC plots
ggplot themes and scales
Extensions for radiation spectra
Geoms to plot networks with ggplot2
ggplot2 tech themes, scales, and geoms
radar charts with ggplot2
Time series visualisations
A phylogenetic tree viewer
Seasonal adjustment on the fly
https://bioconductor.org/packages/release/bioc/html/ggtree.html
gtree is designed for visualizing phylogenetic tree and different types of associated annotation data.
# Example from https://bioconductor.org/packages/release/bioc/html/ggtree.html
library(ggplot2)
library(ape)
library(ggtree)
file <- system.file("extdata/BEAST", "beast_mcc.tree", package="ggtree")
beast <- read.beast(file)
Users can use ggtree(beast)
to visualize the tree and add layer to annotate it.
ggtree(beast, ndigits=2, branch.length = 'none') + geom_text(aes(x=branch, label=length_0.95_HPD), vjust=-.5, color='firebrick')
To view a phylogenetic tree, we first need to parse the tree file into R
. The ggtree
package supports many file format including output files of commonly used software packages in evolutionary biology. For more details, plase refer to the Tree Data Import vignette.
library("ggtree")
nwk <- system.file("extdata", "sample.nwk", package="ggtree")
tree <- read.tree(nwk)
ggplot(tree, aes(x, y)) + geom_tree() + theme_tree()
Some of the functions in ggtree
works with clade and accepts a parameter of internal node number. To get the internal node number, user can use geom_text2
to display it:
nwk <- system.file("extdata", "sample.nwk", package="ggtree")
tree <- read.tree(nwk)
ggtree(tree) + geom_text2(aes(subset=!isTip, label=node), hjust=-.3) + geom_tiplab()
The following example use groupOTU
to display taxa classification.
data(chiroptera)
groupInfo <- split(chiroptera$tip.label, gsub("_\\w+", "", chiroptera$tip.label))
chiroptera <- groupOTU(chiroptera, groupInfo)
ggtree(chiroptera, aes(color=group), layout='circular') + geom_tiplab(size=1, aes(angle=angle))