Phylogenetics: HyPhy Lab

From EEBedia
Revision as of 17:22, 24 February 2007 by PaulLewis (Talk | contribs) (Part B: Using a codon model)

Jump to: navigation, search
Under construction.png This article is still under construction.
Expect it to change frequently until this notice is removed.
Adiantum.png EEB 349: Phylogenetics
The goal of this lab exercise is to show you how to use the HyPhy program for data exploration and hypothesis testing within a maximum likelihood framework.

Part A: Obtaining the sequences

A Nexus data file containing sequences and a tree is located here: wickett.nex. This dataset was assembled by our own Norm Wickett and contains several sequences of bryophytes, including two from a parasitic bryophyte that is non-green and does not photosynthesize. The sequences in the file you will analyze today are from a gene important to photosynthesis. The basic idea behind today's lab is to see if we can detect shifts in the evolution of these sequences at the point where these organisms became non-photosynthetic (thus presumably no longer needing genes like this).

Before going any further, you might want to review the lecture from Monday, Feb. 19 on codon models.

Part B: Using a codon model

Although HyPhy can utilize the same standard models found in PAUP*, it also lets you to do some interesting and useful things that PAUP* cannot, such as (1) use codon and secondary structure models, and (2) allow the model of evolution to change across a tree.

Loading data into HyPhy

Start HyPhy and dismiss the "Welcome to HyPhy" dialog box (if it appears) by pressing the Ok button. Choose File > Open > Open Data File, then navigate to and select the wickett.nex data file that you saved previously. You should now see the sequences appear in a window entitled "DataSet wickett". I will refer to this as the Data window from this point on.

Creating a partition

HyPhy thinks of your data as being composed of one or more partitions. Partitioning data means assigning characters (sites) into mutually-exclusive groups. For example, suppose your data set comprises two genes: you might want to assign a separate model for each gene, so in this case you would create two partitions (one for each gene).

= The word partition is used in two ways

The word partition is ambiguous: it used to mean "wall" or "divider" but with the advent of computer hard drives, it has also come to mean the space between the walls or dividers. When someone says they partitioned their data, they mean that they erected dividers, for example between the rbcL and 18S genes. When someone says they applied a GTR+I+G model to the rbcL partition, they have now switched to using the word partition to mean the sites on the rbcL side of the divider.

No partitioning implies one partition!

Even if you choose to not partition your data in HyPhy, you must go through the motions of creating a single partition because HyPhy only allows you to apply a model to a partition. To create a single partition containing all of your sites, choose Edit > Select All from the Data window menu, then choose Data > Selection->Partition to assign all the selected sites to a new partition. You should see a line appear below your sequences with a partition name "wickett_part".

Assign a data type to your partition

Now that you have a partition, you can create a model for it. Under Partition Type, choose codon (just press the Ok button in the dialog box that appears). You have now chosen to view your data as codons (i.e. three nucleotides at a time) rather than as single nucleotides. The third possible choice for Partition Type is Di-nucl., which you would use if you were planning to use a secondary structure (i.e. stem) model, which treats each sequential pair of nucleotides as a state.

Assign a tree topology to your partition

Under Tree Topology, you have several options. Because a tree topology was defined in the wickett.nex data file, this tree topology shows up in the drop-down list as wickett_tree. Choose wickett_tree as the tree topology for your partition.

Assign a substitution model to your partition

The only substitution models that show up in the drop-down list are codon models because earlier you chose to treat your data as codon sequences rather than nucleotide sequences. The substitution model you should use is MG94xHKY85_3x4. This model is like the Muse and Gaut (1994) codon model, which is the only one I discussed in lecture. You will remember (I'm sure) that the MG94 model allows substitutions to be either synonymous or non-synonymous, but does not make a distinction between transitions and transversions. The HKY85 model distinguishes between transitions and transversions (remember kappa?), but does not distinguish between synon. and non-synon. substitutions. Thus, MG94xHKY85 is a hybrid model that allows all four possibilities: synonymous transitions, synonymous transversions, nonsynonymous transitions and nonsynonymous transversions.

The 3x4 part on the end of the name means that the 61 codon frequencies are obtained by multiplying together the four nucleotide frequencies that are estimated separately for the three codon positions. Thus, the frequency for the AGT codon is obtained by multiplying together these three quantities:

  • the frequency of A nucleotides at first positions
  • the frequency of G nucleotides at second positions
  • the frequency of T nucleotides at third positions

(Note: HyPhy corrects these for the fact that the three stop codons are not included.) This involves estimating the 4 nucleotides frequencies at each of the 3 codon positions, hence the 3x4 in the name.

Local or global?

You have one last decision to make before calculating the likelihood. You must choose Local or Global from the Parameters drop-down list. Local means that HyPhy will estimate some substitution model parameters for every branch in the tree. Global means that all substitution model parameters will apply to the entire tree. In all the models discussed thus far in the course, we were effectively using the global option except for the branch lengths themselves, which are always local parameters (it doesn't usually make any sense to think of every branch having the same length).

For now, tell HyPhy to use the Global option here. We will later change this to Local for comparison.


Computing the likelihood under a codon model

Part C: Testing evolutionary phylogenetic hypotheses