Ggtree
EEB 5349: Phylogenetics | |
by Kevin Keegan
Contents
Goals
To introduce you to the R package ggtree for plotting phylogenetic trees.
Introduction
Getting Started
Download the tree file (Paul can you host the treefile?)
Installing Packages
Open a terminal, start R, and install the packages we will be using. We'll be using the packages:
BiocInstaller ape Biostrings ggplot2 ggtree phytools ggrepel stringr stringi abind treeio
You can install a package like so:
install.packages("BiocInstaller")
Many of the above packages are part of the Bioconductor project (like ggtree and treeio). You can find extensive documentation on their website for packages packages associated with their project.
Read in the Tree File
We're dealing with a tree in the Newick file format:
tree <- read.newick("moth.txt")
R can handle more than just Newick formatted tree files. To see what other file formats from the various phylogenetic software that R can handle treeio
Cite ggtree
citation("ggtree")
References
Yu G, Smith D, Zhu H, Guan Y and Lam TT (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, pp. 28-36. doi: 10.1111/2041-210X.12628, http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12628/abstract.