Difference between revisions of "Ggtree"

From EEBedia
Jump to: navigation, search
(Installing Packages)
(Read in the Tree File)
Line 42: Line 42:
 
====Read in the Tree File====
 
====Read in the Tree File====
  
We're dealing with a tree in the Newick file format:
+
We're dealing with a tree in the Newick file format which the function <tt>read.newick</tt> from the package <tt>treeio</tt>:
  
 
  tree <- read.newick("moth.txt")
 
  tree <- read.newick("moth.txt")

Revision as of 15:49, 7 March 2018

Adiantum.png EEB 5349: Phylogenetics

by Kevin Keegan

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 associated with their project.

Read in the Tree File

We're dealing with a tree in the Newick file format which the function read.newick from the package treeio:

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.