Unformatted text preview:

Integrative Biology 200B University of California, Berkeley Spring 2011 "Ecology and Evolution" NM Hallinan, updated by Nick Matzke Lab 12: Lineages Through Time Today we will analyze changes in diversification that effect all the organisms in a clade at once. We will use lineage-through-time plots (LTT plots) to get a sense of the overall pattern of diversification. We will compare these to a null distribution in order to find significant deviations from our expectations. We will also explore a couple of likelihood methods for testing for shifts in diversification with time. As a first step we'll simulate trees in R. Load the ape, laser, and geiger packages before you start. Simulating Trees in R You did some of this in the tree-balance lab. There are several methods for simulating trees in R. We will look at a few of these. The ape package has two functions for simulating trees, rtree and rcoal. Both create trees with equal branching, but neither one gives us useful branch lengths for our current purposes. A more useful function is birthdeath.tree in the geiger package. This function simulates trees by the birth death (BD) process, starting from 2 lineages. The user inputs a birth rate, a death rate and a time or final number of taxa for the process. If this function just runs the BD process for the given amount of time, it will produce trees with different numbers of final taxa. If it runs until it reaches a given number of taxa, then it will take different amounts of time. Load the geiger package. tree1<-birthdeath.tree(0.3,0,10) This will make a tree with λ=0.3, and µ=0 (speciation and extinction, respectively) by running the process for 10 time units. The expectation is that this tree will have 2*exp(0.3*10)=40 taxa, but it could have more or less. Let's see what that looks like: plot(tree1) axisPhylo() Oh, it looks like crap. Wait, we can fix that: tree1<-reorder(tree1) plot(tree1) axisPhylo() Does your tree have about 40 taxa? Does it have depth 10? Let's make another tree but with a non-0 µ (extinction rate). We will set λ=0.35, and µ=0.05, so that r remains 0.3. tree2<-reorder(birthdeath.tree(0.35,0.05,10)) plot(tree2) axisPhylo() You'll notice that this tree has both living and extinct lineages. We did not get any extinctionlast time, because µ was 0. We can remove the extinct lineages as follows: tree2.pruned<-prune.extinct.taxa(tree2) plot(tree2.pruned) axisPhylo() There we are; that is the tree you would expect with only the extant taxa. We can also make a tree with a specific number of taxa. tree3<-reorder(birthdeath.tree(0.35,0.05,taxa.stop=40)) plot(tree3) axisPhylo() There you go, exactly 40 taxa. You may have slightly more than 40 numbered lineages, because there are several extinct lineages, and this process stopped when there were 40 extant lineages. The amount of time this process took is randomly distributed. You may notice that the last duplication occurs in the present. This is cause the process stopped when it reached 40 living taxa. That may not give you an honest distribution of 40 taxa trees, as you could have 40 taxa again after this time. We won't deal with fixing this problem. Now we are going to use my function rbdtree.n. This function can take a λ, a µ, a time, and a final number of taxa and give you a random tree for those sets of parameters. It can also have λ and µ vary with time. You should note that this function will give you a set of branch lengths even if it is highly unlikely that the rates you chose would produce as many taxa as you chose, so it is important to pick a reasonable set of rates. Download rbdtree.n3.R from the website, and/or source it remotely: source(“http://ib.berkeley.edu/courses/ib200b/labs/lab12/rbdtree.n3.R”) Then, run the function rbdtree.n: tree4<-rbdtree.n(40,10,0.35,0.05) plot(tree4) axisPhylo() That's cool. This probably fits our null distribution better for the tests we are about to run, as it holds the final number of taxa and the time constant, and both those factors can have a large impact on an the distribution of lineages through time. Nevertheless, there may be situations in which the other assumptions are more appropriate. Lineage-through-time Plots Now we will make some lineage-through-time plots. These are plots of the number of lineages in a clade that have any living descendants against time. The expectation is that these plots will show exponential growth, if µ=0 and λ is constant. Significant deviations from this expectation indicate that diversification is changing with time. We will use some ape functions for making these plots. ltt.plot(tree1)It is common practice to log-transform the y-axis. We will use the general R plotting command log=“y”, which will only change the way the values are plotted, and will not change the values themselves. ltt.plot(tree1,log=“y”) For a log transformed plot our expectation is a straight line, so we can add that line to our plot and compare it: lines(c(-10,0), c(2,total number of taxa), lty=2) That should look like a pretty good fit. You can also add other lineage-through-time lines to this plot. ltt.lines(tree2,col=2) OK, that looks a little weird, cause we have different numbers of final taxa. We can plot all our trees at once: mltt.plot(tree1,tree2,tree3,tree4) Null distributions for lineage-through-time plots In order to understand how variation in the diversity parameters effects lineage-through-time plots, we have to understand what these plots would like under a null hypothesis. Let's start with the null hypothesis of a pure birth process that proceeds for a given amount of time. trees.yule <- replicate(100, birthdeath.tree(0.3,0,10), simplify=FALSE) This creates a list of trees by repeating our function 100 times. Let's make the lineage-through-times plot of our data. mltt.plot(trees.yule, legend=FALSE) The problem with that is all the trees have different numbers of taxa, and most of what you see is that those that start out with more taxa end to end up with more taxa. If you had a constant number of taxa, but variation in time, you would have a similar problem. Let's make trees with all those factors in common. trees.yule2<-replicate(100, rbdtree.n(40,10,0.3,0), simplify=FALSE) mltt.plot(trees.yule2, legend=FALSE, log=“y”) We can see the general distribution of Yule trees


View Full Document

Berkeley INTEGBI 200B - Lab 12 Lineages Through Time

Documents in this Course
Quiz 2

Quiz 2

4 pages

Quiz 1

Quiz 1

4 pages

Quiz 1

Quiz 1

4 pages

Quiz

Quiz

2 pages

Quiz 1

Quiz 1

4 pages

Quiz

Quiz

4 pages

Load more
Download Lab 12 Lineages Through Time
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab 12 Lineages Through Time and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 12 Lineages Through Time 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?