The purpose of this example to to demonstrate how to use the CONTRAST program in PHYLIP to perform Phylogenetic Independent Contrasts analysis using continuous character data and pre-made trees. We use a real data set of 2 continuous characters amongst 49 mammal species, as well as a synthetic data set comprised of 50K-species tree and a data set for two continuous characters. This document also introduces file formats used as inputs for CONTRAST.
- Access to a unix/linux shell
- PHYLIP installed
- Access to Mesquite
- Nexus data files
Preparing the data files
- The file PDAP.nex was provided by Brian Omeara. It is a NEXUS format file that contains character data. The file header indicates it was generated by Peter Midford.
- Converting the NEXUS file to input suitable for phylip involved a few steps:
1) Load PDAP.nex into Mequite. The character data are log values of body mass and home range (sample below). 2) Export the character data File->Export->Tab delimited continuous data file->PDAP.txt
3) Export the tree data as PHYIP (Newick) format: File->Export->Phylip (trees)->PDAP.tree.fel
4) Modify the files for PHYLIP using the the ad-hoc perl script below. Two things that need to be done are to make sure the taxon labels are exactly 10 characters (required by PHYLIP) and that they correspond exactly between the character data file (PDAP.txt) and the tree file (PDAP.tree.fel)
Creating the PHYLIP infile (PDAP.fel):
- Create the command file. The series of commands below names the data and tree files and specifies the 'C' option to print out the contrast data. run_phylip.pl to execute CONTRAST and save the results as the file PDAP.contrasts.txt Use the perl script
Testing CONTRAST with a synthetic 50K data set
Original data files
- The original data files, provided by Brian Omeara, are described here. They are synthetic tree and character data.
- 50K_final_continuous.nex is the character data are in NEXUS format
- 50K_final_newick.tre is the tree file in Newick (accepted by PHYLIP) format. The tree is ultrametric (a rooted additive tree where the terminal nodes are all equally distant from the root), binary (all nodes bifurcate) and has all positive branch lengths (some methods, such as NJ, allow negative branch lengths, which are not suitable for independent contrasts).
Converting to PHYLIP formatNo modifications were made to the tree file. The character data were processed as follows:
- open 50K_final_continuous.nex in Mesquite
- export as simple text (File->Export->Tab delimited continuous data file->50K.continuous.txt)
- use ad hoc perl script to create PHYLIP file 50K.continuous.fel
Running and benchmarking CONTRAST
- It took CONTRAST ~20s to run the analysis on the 50K taxon data.
- Results are save as 50K.contrasts.txt