| Primary Contact(s) | Created | Required Software | Example Datafile |
|
Samantha Price & |
2 March 2009 |
Brownie.zip |
|
| Handout | Presentation | ||
BrownieTutorial.pdf |
Brownie-RatesofEvolution.pdf |
Note on the software (March 10, 2009): If you go
here and download BrownieInstaller2.1p2.dmg, you will get the latest release with some new functionality. However, this version is in development and may not be as stable as the previous release. This exercise assumes you are running Brownie on Mac OSX with an Intel processor. Using Brownie on a PC is possible, but can be difficult. You will need to install cygwin, install the gsl, and then compile Brownie from source. See the Brownie
manual for more details on this application.
Summary
This tutorial will show you how to run analyses in
Brownie, a package designed to estimate and compare rates of character evolution under Brownian motion in different parts of a phylogeny. The newer untested methods implemented in
Brownie for discrete characters, Ornstein-Uhlenbeck models (OU) and the methods to look at rate differences in respect to the changes in a discrete character will not be covered as they are still "under construction", see the Brownie
manual for more details.
Introduction
Rates of character evolution are not only interesting in their own right but are also a useful tool for other comparative analyses such as ancestral state reconstruction and, in a morphological context, as phylogenetically corrected estimates of morphological variance (see O'Meara et al. 2004 and Hutcheon & Garland 2004). A variety of questions can be addressed by comparing and estimating rates of evolution. For example, it has been shown that the morphological disparity in sunfish is far greater than in their sister-group black basses (Collar et al. 2005) and that rate of floral evolution is much faster in Rafflesia than their relatives suggesting size constraints are not limiting this gigantic parasitic flowers (Barkman et al. 2008). We're going to use Brownie here to ask whether body size in baleen and toothed whales evolved at different rates.
Tutorial: Has body size in baleen and toothed whales evolved at different rates?
We are assessing the hypothesis that a key innovation (baleen and the ability to eat numerous nutritious prey) has lead to different rates of size evolution in baleen and toothed whales.
Prior to using Brownie
The tree and data being input into R need to be in a single nexus file with separate taxa, characters, and trees blocks, as well an optional assumptions block. Since it's unlikely that you will be starting with type of nexus file, the easiest way to get one ready for analysis with
Brownie is to use
Mesquite. In
Mesquite, you can import data from an EXCEL file containing your character data, link this to a tree file (numerous types of tree formats can be imported into
Mesquite), and save this as a nexus that contains most of the information required by
Brownie. Additional information on how to generate such a nexus file can be found [Basic ancestral reconstruction with parsimony & maximum likelihood in Mesquite" here]. Although there may be some way to add a taxset to an assumptions block in
Mesquite this can also be done by manually manipulating the assumptions block in the nexus file output by
Mesquite. Today we don’t have to worry about any of this as we are starting with a nexus formatted dataset whale.nex.
Getting started with Brownie
1. Open Terminal (Mac) and navigate to the
Brownie folder and move the nexus file with tree and data into that folder. The simplest way to do this may be to simply drag and drop the nexus files into the Brownie before opening the Terminal. Movement of files can also be done in the Termina. For example, if you want to move the file whale.nex from your desktop into a folder called Brownie that is also on your Desktop you would type:
>cd Desktop >mv whale.nex Brownie >cd Brownie
2. Once you've navigated to the folder containing Brownie you're ready to start the program and execute the example file called whale.nex. This is done using the command brownie followed by the name of the file you'd like to run.
>brownie whale.nex
Alternatively you can open Brownie by typing “brownie” and then executing the file once Brownie has started up by typing “exe whale.nex” or “execute whale.nex”.
If you downloaded BrownieInstaller2.1p2.dmg you can double click on the Brownie icon in the BrownieFolder and it should start up and ask you for the nexus file you want to execute, it will then start up Brownie in the Terminal window.
3. Check tree and data (always good practice to see if the data and tree has been read-in correctly etc.)
>showtree >blocks
4. Start a log file to store all of the output printed to your screen.
>log file=whalelog.log
5. Start echoing output to store all commands in a batch file. If you do this, you'll have a stored record of your commands that can subsequently be used to write a Brownie block in the nexus file. In this manner it will be possible to run your analyses automatically when you execute your nexus file.
>echo file=whalecommand.txt
Running a censored rate test
1. To test for different rates of morphological evolution in different parts of the tree, we need to become familiar with Brownie's ratetest command. To see the options associated with this command type ratetest ? while Brownie is open (be careful to put a space between the command and the ?):
| Keyword | Option Type | Default | ||
| Taxset | "taxset name" | None | ||
| Reps | "integer" | 0 | ||
| Treeloop | "NO/Yes" | No | ||
| Charloop | "NO/Yes" | No | ||
| File | "file name" | None |
Taxset: This command is specified in the optional assumptions block of the nexus file. One way to generate this set is to manually edit a nexus file created by Mesquite by specifying an assumption block and a taxset. To see an example of the results of such editing, scroll to the bottom of the whale.nex file in a text editor. In the context of the taxset command names one of the two groups of interest and specifies the species names belonging to that group. ratetest will automatically generate another taxset that includes all the species in the tree that are not in the specified taxset. Our example will compare rates among two monophyletic sister-clades, but it can also be used when one of the clades is paraphyletic. Brownie can also be used to create subtrees on which to run the new types of analyses available in Brownie that are specified by the continuous or discrete commands.
Reps: This command specifies how many times data should be simulated under the null model when doing a parametric bootstrap to assess the significance (p-value) of the likelihood ratio test. This is a good idea if you have small sample sizes but can take a long time for larger datasets. If you are using the model testing approach Reps is unnecessary because your inference will be based on differences in AIC or AICc scores.
Treeloop: This command is used to two Brownie if it should loop across trees (with or without weights) in a nexus file. This looping is used to account for uncertainty in tree topology and branch lengths, or even to weight the average when the output is summarized across input trees with bootstrap support or posterior probabilities.
Charloop: This command can be used to loop across the characters specified in the character block.
File: Specifies a file name in which the output should be saved.
2. Run a ratetest analysis to compare rate of size evolution in baleen and toothed whales.
>ratetest taxset=baleen reps=1000 charloop=yes file=whaleratetest.txt
3. Stop logging screen output
>log stop
4. Stop echoing commands
>echo stop
Interpreting the Output
For each test run 4 sections of output are generated.
I) This first section of output gives the parameter estimates for each clade in the 2-rate model. Anc state gives the maximum likelihood estimate of the ancestral state at the root node of each clade (Notbaleen or baleen). Rate gives the estimated Brownian motion rate for each clade and –lnL gives the likelihood of that rate.
II) The second section gives the parameter estimates for the 1-rate model. First is –lnL, the likelihood of the single-rate model, followed by two values of interest if you are using the model-fitting approach: the Akaike Information Criterion (AIC) which estimates the goodness of fit of the 1-rate model and AICc which corrects for small sample sizes. It ends with the estimated Brownian motion rate for the single-rate model.
III) This third section summarizes the overall parameters for the 2-rate model. First is –lnL, the likelihood of the two-rate model, which is the sum of the likelihoods of the baleen and Notbaleen Brownian motion models given in the first section. This is followed by the AIC and AICc values for the 2-rate model.
IV) The fourth section summarizes the results and conclusions from the various significance tests and model testing approaches: AIC differences, AICc differences, Χ2 p-value which gives the significance of a likelihood ratio test that compares the likelihood of the 2-rate model with the single-rate model and finally because we ran Reps=1000 the p-value for the parametric bootstrapping of the significance of the likelihood ratio test.
Once it has finished looping over the characters a Summary of results is printed to the screen. Brownie uses the notation A,a,B,b for strength of support for a single rate (A’s) or two rate (B’s) model with strong support indicated by CAPITALS.
1. Open output file whaleratetest.txt in Excel or your favorite program for opening tab-delimited table. This should contain the same information as the screen output. You will notice Model A is the single-rate parameter model and B is the two-rate parameter model. Taxset 1 is “NotBaleen” which are the toothed whales and Taxset 2 is “Baleen” which we defined in the assumptions block. Character 1 is Log10 Mass and character 2 is Log10 Length. The last column uses the same A-B notation as the output to the screen to indicate strength of support from each test for a 1 or 2-rate model.
2. Using the output file write the answers to the 3 questions in the exercise sheet at the end of this tutorial.
Making a batch file
This will create a file that will run the above analysis when the nexus file is executed.
1. Open in a text editor the commands that we echoed to whalecommand.txt and open the nexus datafile whale.nex. Copy all the text below #nexus in the whalecommand.txt file and paste it at the bottom of the text in the whale.nex file, save this new file as batchwhale.nex.
2. Execute the batchwhale.nex file in Brownie.
>execute batchwhale.nex
Questions to think about
1. What are the results of the analysis?
2. What is the interpretation of the results - has size evolved at different rates in baleen and toothed whales?
3. Why might our data or analyses be inappropriate for looking at the question of whether size has evolved at different rates in toothed and baleen whales? (Think about the tree topology, the reconstructed ancestral states and how the censored-rates test breaks up the tree).
4. Does the tree contain polytomies? And how might polytomies affect the rate estimates?
References
Barkman, Bendiksby, Lim, Salleh, Nais, Madulid and Schumacher (2008) Accelerated rates of floral evolution at the upper size limit for flowers. Current Biology 18(19) pg 1508-1513.
Collar, Near & Wainwright (2005) Comparative analysis of morphological diversity: does disparity accumulate at the same rate in two lineages of centrarchid fishes? Evolution 59(8) pg 1783-1794.
Hutcheon & Garland 2004. Are megabats big? Journal of Mammalian Evolution 11 (3-4), pg 257-277
O'Meara et al. 2006. Testing for different rates of continuous trait evolution using likelihood. Evolution 60(5), pg 922-933.


