Evolutionary and Ecological Analyses using Phylogenies in R

 

This page contains all the materials from the Center for Population Biology workshop that myself and Roi Holzman held in May 2009 at UC Davis over 4 days for 2 hours each time. This workshop was designed to provide a practical introduction to using phylogenies for ecological and evolutionary analyses in the open-source statistical software R. This means the theory behind the methods is glossed over, we do however provide references for people that are not familiar with the methods we describe. Please feel to use and modify these exercises, each should be roughly 1 hour. The packages used are: ape, apTreeshape, diversitree, geiger, laser, ouch and picante. Since we wrote this workshop several great new packages have been released including phytools and TreePar.


Each exercise uses the same tree and trait files: parrottree.nex and parrotfishes.txt which can be downloaded by clicking the links. If you have any questions or comments concerning these exercises please email me at the address at the bottom of the page.

Day 1

1st Session: Basic Introduction (Intro2phylo_S1.R)

  1. How to load packages

  2. Basic interface - calculations and path setting

  3. Loading data - various formats, missing data etc.

  4. Manipulation data - subsetting rows/columns


2nd Session: Introduction to using phylogenies (Intro2phylo_S2.R)

  1. Introduction to phylogenetic packages available in R

  2. Reading and manipulating trees - opening newick/nexus files, intro to the phylo format, plotting trees, pruning trees.


Day 2

1st Session: Speciation and Diversification (Intro2Phylo_S3.R - you also need richness.txt)

  1. Lineage through time plots

  2. Tree statistics - gamma statistic

  3. Simulating trees (Yule and Birth/Death)

  4. MEDUSA - shifts in diversification rates

  5. BISSE - state dependent diversification rates


2nd Session: Analysis of discrete data (Intro2Phylo_S4.R)

  1. Fitting models of evolution

  2. Ancestral state reconstruction


Day 3

1st Session: Brownian motion analyses of continuous data (Intro2Phylo_S5.R see this too Brownian trait simulations.R)

  1. Ancestral state reconstruction

  2. Fitting models of evolution

  3. Correlated evolution using Independent Contrasts

  4. Simulating traits under Brownian motion


2nd Session: Ornstein-Uhlenbeck analyses of continuous data (Intro2Phylo_S6.R)

  1. Getting your trees and data into OUCH format

  2. Comparing OU models of evolution

  3. Simulating traits under OU


Day 4

1st Session: Phyloecology (Intro2Phylo_S7.R)

  1. Testing for phylogenetic signal

  2. Calculating phylogenetic dispersion of communities

  3. Randomization tests


2nd Session: Making publication quality phylogeny figures (Intro2Phylo_S8.R)

  1. Understanding basic plotting structures

  2. Plotting simple trees with nodal values

  3. Visualizing data at the tips of trees and ancestral state reconstructions