Docsity

PHYLIP Computer Practical-Phylogentics-Handout, Exercises of Phylogenetics

Toggle sidebar
bg1
PHYLIP Computer Practical
1 Brief Background
The purpose of the PHYLIP—the Phylogeny Inference Package—package is to pro-
vide methods for inferring phylogenies. It has been distributed since 1980 and has in
the meantime grown to also include methods to compute consensus trees, compute dis-
tances between trees, draw trees, resample data sets by bootstrapping or jackknifing,
edit trees, and compute distance matrices.
Figure 1: The only illustration appearing in Charles Darwin’s Origin of Species, show-
ing an abstract example of a phylogeny.
Charles Darwin observed that species arise by descent from parental forms with
variation, where the compiled effects of the variation eventually leads to two divergent
subgroups of a species to become separate species. Recovering this tree-like structure
describing the speciation events—or possibly just the ancestral relationship in cases
where data has been sampled for multiple individuals within a species—is crucial for
understanding and further analysing the evolutionary processes.
If we for the moment assume that all splits are two ways, i.e. that a speciation event
leads to two subspecies or that a parent only has at most two offspring, it is an easy
observation that for nindividuals there are
Tu(n) =
n
Y
i=3
(2i−5) = 1 ·3·... ·(2n−5) = (2n−5)!
(n−3)!2n−3(1)
1
Docsity.com
pf3
pf4
pf5
pf8

Partial preview of the text

Download PHYLIP Computer Practical-Phylogentics-Handout and more Exercises Phylogenetics in PDF only on Docsity!

PHYLIP Computer Practical

1 Brief Background

The purpose of the PHYLIP—the Phylogeny Inference Package—package is to pro- vide methods for inferring phylogenies. It has been distributed since 1980 and has in the meantime grown to also include methods to compute consensus trees, compute dis- tances between trees, draw trees, resample data sets by bootstrapping or jackknifing, edit trees, and compute distance matrices.

Figure 1: The only illustration appearing in Charles Darwin’s Origin of Species , show- ing an abstract example of a phylogeny.

Charles Darwin observed that species arise by descent from parental forms with variation, where the compiled effects of the variation eventually leads to two divergent subgroups of a species to become separate species. Recovering this tree-like structure describing the speciation events—or possibly just the ancestral relationship in cases where data has been sampled for multiple individuals within a species—is crucial for understanding and further analysing the evolutionary processes. If we for the moment assume that all splits are two ways, i.e. that a speciation event leads to two subspecies or that a parent only has at most two offspring, it is an easy observation that for n individuals there are

Tu(n) =

∏^ n

i=

(2i − 5) = 1 · 3 ·... · (2n − 5) =

(2n − 5)! (n − 3)!2n−^3

different possible unrooted phylogenies (i.e. phylogenies where the position of the root is left unspecified). The number of rooted phylogenies is

Tr(n) = Tu(n + 1) =

∏^ n

i=

(2i − 3) = 1 · 3 ·... · (2n − 3) = (2n − 3)! (n − 2)!2n−^2

as the root can be viewed as an extra individual. These numbers grow extremely fast, so even for moderate data set sizes heuristics are often used to infer phylogenies. Usu- ally inference is based on optimising a certain criteria, like parsimony or likelihood. Heuristics are not guaranteed to find the overall optimal solution but are designed to try to find good solutions fast.

2 Using PHYLIP

Despite its many years of existence, PHYLIP hasn’t quite made it to the graphical user interface stage yet, but has to be invoked from a command line interface (DOS prompt or terminal). In general the programs in the PHYLIP package will offer an interactive textual menu from which to control the behaviour of the program. Once the parame- ters have been set, the program then tries to read data from the file infile (or queries the user for another file name if infile does not exist) and writes results to the file outfile. All the data files that you will need for this practical should be available from http://www.stats.ox.ac.uk/~lyngsoe/gulbenkian/phylip/. During this practical you will use the PHYLIP package to infer phylogenies for sam- pled nucleotide sequences based on score based as well as likelihood based criteria. You will get an opportunity to assess the confidence with which different parts of phy- logenies are supported by the input data. You will get a brief introduction to the dis- tance based methods provided by PHYLIP and to the methods for generating graphical representation of the inferred phylogenies.

3 Nucleotide Sequence Methods

Sampled data can have many forms. In particular, we could sample either protein sequences or DNA sequences. As the methods differ mostly in this one respect, i.e. the form of their input, we will be working only with DNA sequences in this practical. The main reasons for choosing DNA sequences to e.g. protein sequences is that DNA sequences are simple with only four different bases, and that DNA sequences is the class of data that have most methods available in the PHYLIP package.

3.1 DNAPARS

The dnapars program estimates phylogenies by parsimony. Parsimony is a time hon- oured principle in bioinformatics that is basicly an application of Occam’s razor: the evolutionary history postulating the fewest events is generally the most likely. Given a phylogeny it is easy to determine the number of events for each site by Fitch’s al- gorithm, or when events have different scores by Felsenstein’s peeling algorithm, as illustrated in Figure 2.

for the best tree, but in a somewhat different manner: initially dnapars builds a tree by adding species in the order they appear in the input—this option allows the order to be random and to try more than one ordering. The next three options (T, N and W) defines the score. In particular option N is worth mentioning: when this is invoked only transversions are considered while transitions are ignored—transversions happen at a slower rate than transitions so for highly divergent sequences it may be that only transversions are informative while transitions essentially only add noise. The next two options (M and I) specifies the nature and format of the input data, while the remaining options (0 through 6) controls how results are output. Play around with these options at your leisure.

B

A

D

C

Figure 3: An illustration of the long branch attraction problem. Species A and C are not clustered together, but as they are the most similar parsimony will cluster them together.

One problem with parsimony tree constructing is that there are examples where data is known to lead tree reconstruction astray. This is known as the long branch attraction problem, and the set up is illustrated in Figure 3. Data simulated from the tree in Figure 3 is available as longbranch.nuc. What phylogeny is inferred from this data? Is this different from the one in Figure 3?

3.2 DNAMOVE

The dnamove program allows you to build trees yourself, while it keeps track of the parsimony score. Moreover, you can see the inferred nucleotides at each site for the current tree. What is the largest parsimony score you can obtain for a tree on the primates.nuc data?

3.3 DNAPENNY

As previously mentioned, the rapid growth in the number of possible trees have most methods resort to heuristics that are not guaranteed to find the best possible solution. The PHYLIP package does however contain a program, dnapenny, that is guaranteed to find the best possible phylogenies. This guarantee makes the program rather slow, and as stated in the manual it should not be applied to more than 10-11 species. I

did actually successfully apply it to the dengue.nuc data set with 17 sequences, but had to increase the number of trees considered (this is the product of the values set by option H and F) to 2 , 500 , 000. Apply dnapenny to primates.nuc—do you get the same tree as from dnapars?

3.4 DNAML & DNAMLK

As discussed at the end of Section 3.1, parsimony reconstructing suffers from some rather serious theoretical problems. It is well known that a more robust criterion for phylogeny is by finding the maximum likelihood estimate according to a suitable evolutionary model, i.e. finding the phylogeny that has the highest probability given the observed data. This paradigm is implemented in the two programs dnaml and dnamlk Start by running dnaml on the primates.nuc data. Again, choosing an appropriate outgroup may result in a representation that lends itself better to interpre- tation. Is the phylogeny determined by the standard values for dnaml identical to the one reported by dnapars? One can observe that dnaml assumes a ratio between transition and transversion rates of 2. 0 as standard. In the standard parsimony infer- ence of dnapars transitions and transversions are treated identically. So try to adjust the transition/transversion rate ratios to 1. 0 and rerun dnaml. Does this change the outcome significantly? The five species in primates.nuc are sufficiently closely related that one may assume that substitution rates haven’t changed significantly since they diverged, i.e. we would expect the same rate of evolution throughout the phylogeny. If this is in fact the case the distance from the root of the tree to each of the leaves representing one of the species in the input data should be equal. Though dnaml produces unrotted trees, can you if choosing gibbon as outgroup and using the apparent root as actual root choose branch lengths within the confidence interval of each branch such that the total distance from the root to each of the five species is the same? If so, it makes sense to analyse the data using the molecular clock assumption. The molecular clock as- sumption is what has just been discussed, assuming that evolution ticks along with a certain number of substitutions in each time interval throughout the phylogeny. This will see all leaves occurring at identical distances from the root. The dnamlk program is similar to dnaml, except that it assumes a molecular clock. Apply dnamlk to the primates.nuc data set. You will note that in this case you do not have an option to select an outgroup, as the molecular clock assumption allows the inferred phylogeny to be rooted without using an outgroup. Where does the molecular clock assumption put the root in the phylogeny for these five primates? What is the difference in ln likeli- hoods of the phylogenies inferred by dnaml and by dnamlk? For the dengue.nuc data we have reason to believe that the longest distance from the root to a leaf is about twice the shortest distance from the root to a leaf. Hence the molecular clock assump- tion is far from being valid for this data set. What is the difference in ln likelihoods computed by dnaml and dnamlk for this data set? In the next computer practical, on the PAML package, we will delve deeper into comparing different hypotheses using maximum likelihood estimates. At the end of Section 3.1 we saw that parsimony had a problem with distantly related sequences being grouped together, the long branch attraction problem. This problem is not present with the maximum likelihood methods. Apply the dnaml

return to dnapars (or dnaml or dnamlk) and analyse the 100 simulated data sets— remember to specify multiple data sets using the M option. This should result in a tree for each data set being stored in outtree. Rename this to intree (or just enter outtree as input file name when queried) and run the program consense. This program finds the consensus tree of a set of trees. Furthermore, for each branch of this consensus tree it tabulates how many of the input trees that contained this bipartition of the data. If a bipartition is contained in all, or almost all, the input trees, it is not sensitive to resamplings and can thus be trusted with high confidence. Which branches are well supported in the primate phylogeny and which are not? Is this consistent with what you have seen previously in your analysis of this data set?

3.6 DNADIST

The last method we will look at in the collection of nucleotide sequence methods is dnadist. This method is used for computing the pairwise distances between se- quences in the data set. That is, this method doesn’t actually infer any phylogeny. It does, however, compute information that can be used to infer phylogenies as we will see in the next section. The distances are computed according to an evolutionary model that can be specified in the menu—the simplest model available is the Jukes-Cantor model, while the F84 and LogDet models are the most general. The interpretation of the distances is in terms of expected number of substitutions per site between the two sequences. Compute the pairwise distances for both the primates.nuc and dengue.nuc and keep them handy for the next section. How much effect does the choice of model have on the computed distances?

4 Distance Based Methods

Being able to measure the pairwise distance between objects is a quite general concept. We have just seen how dnadist allows us to compute pairwise distances between nu- cleotide sequences. In most situations one can concoct some kind of relevant measure of distance. So distance based methods for phylogeny reconstruction can be viewed as quite general. The downside is that information is of course lost when reducing dif- ferences to a single distance. Distance based methods usually attempt to reconstruct a tree where the sum of the lengths of the branches connecting any two species in the tree has the best possible fit to the input distance between the species. Methods differ in whether a molecular clock is assumed, how the goodness of fit between observed and tree distances are measured and what heuristics are applied to build trees.

4.1 NEIGHBOR

One of the most widely used methods of distance based phylogeny inference is neigh- bour joining. It is based on iteratively joining the two nearest elements remaining, introducing the root of resulting subtree as a new element, and compute distances from the remaining elements to this newly introduced element. How the new dis- tances are computed defines the particulars of the method. The program neighbor implements the standard neighbour joining method and the UPGMA method that as- sumes a molecular clock. Try running neighbor with UPGMA on the distances

from the primates.nuc data set and with neighbor-joining on the distances from the dengue.dist. If you have seen about enough trees for these two data sets, you can also have a look at the primates_ext.dist taken from the PHYLIP web site—is it reasonable to use the UPGMA method to analyse this data set? What would be the best species to use as outgroup in this data set if the neighbor-joining variant is used? Extensions to neighbour joining, both in terms of better definitions of new distances [1] and in terms of speed [2] are available from other sources.

4.2 FITCH & KITSCH

Neighbour joining and UPGMA were originally developed without a clear objective of what a best fit between input distances and tree distances are. Rather their main consideration was to find reasonable definitions of the new distances based on the perception of what the element introduced when joining two neighbours represented. The fitch program is based on minimising the sum of squared distances between input distances and tree distances. The P option determines the normalisation of the squared distances—with the standard value of 2 the choice of tree is invariant under rescaling of the distances. The kitsch program is similar, except that it restricts tree space by assuming a molecular clock. The distances from the dengue.nuc data set clearly exposes the difference by sum of squares and average percent deviations being much larger when analysed with kitsch as compared to fitch.

5 Graphical Tree Representations

So far we have been content with just viewing trees as ASCII art. Times when this was sufficient for any but the most distracted academics have long passed. The PHYLIP package also offers programs for graphical rendering of inferred trees (even format- ted for several dot matrix printers!). The two programs drawtree and drawgram produces graphical renditions of unrooted, respectively rooted trees. In whatever time you may have remaining for this practical, play around with these two programs to get an idea of what kinds of representations they can produce. You may have to download one of the six font files (named font1 through font6) and rename it to fontfile for the programs to work.

References

[1] William J. Bruno, Nicholas D. Socci, and Aaron L. Halpern. Weighted neighbor joining: A likelihood-based approach to distance-based phylogeny reconstruction. Molecular Biology and Evolution , 17(1):189–197, 2000.

[2] Thomas Mailund, Gerth Stølting Brodal, Rolf Fagerberg, Christian Nør- gaard Storm Pedersen, and Derek Phillips. Recrafting the neighbor-joining method. BMC Bioinformatics , 7:29, 2006.