SVDQuartets Tutorial for SSB 2018

David Swofford and Laura Kubatko
4 June 2018

Preliminaries

This tutorial assumes that you have installed PAUP* on your computer or that you are running it on a server on which PAUP* has already been installed. If you do not have the latest version of PAUP* (4.0a161) installed on your computer, you should do that first. You can obtain a free test version at http://paup.phylosolutions.com. Versions are available for macOS (10.8+), Windows 7+, and Linux (Ubuntu/Debian and CentOS/RedHat).

For consistency, the tutorial assumes you are running a command-line version of PAUP*. It is fine to use the macOS and Windows GUI versions--you can either type the commands into the area at the bottom of the main display window, or figure out how to perform the equivalent operations using the menu-dialog interface. Alternatively, you can use the command-line macOS version available at the download site, or the "console" version from the Windows installation.

In the instructions which follow, the "$" represents the Unix prompt. For example, if the instruction says:
         $ cat filename.txt
you would type "cat filename.txt" and hit return. Likewise, "paup>" represents the prompt used by the PAUP* program.

To begin the tutorial, create a new subdirectory/folder, download the data-file archive http://phylosolutions.com/tutorials/ssb2018/svdquartets_tutorial.zip, and expand it into the tutorial directory. You can do this however you like; Linux users might use the commands:

$ mkdir ssb2018
$ cd ssb2018
$ wget phylosolutions.com/tutorials/ssb2018/svdquartets_tutorial.zip
$ unzip svdquartets_tutorial.zip

Move to the directory you just created:

$ cd svdquartets_tutorial

In GUI versions, you can use the Change Default Directory command (File Menu) to make 'svdquartets_tutorial' the default directory.

Part 1: Analysis of a data set simulated from the "anomaly zone"

We will begin with an example used by Liu and Edwards (2009), calling attention to problems that can arise due to the possibility that gene trees for individual loci to conflict with the species tree due to the phenomenon of "incomplete lineage sorting" (ILS). When internal branches of the species tree are very short (or effective population sizes are extremely large), the most probable gene tree can be inconsistent with the species tree, which can cause concatenation of data across loci to fail. See Kubatko and Degnan (2007) and Liu and Edwards (2009) for details.

The data file anomaly_zone.nex represents one replicate of the simulation described in Fig. 2 in Liu and Edwards (2009). This file contains data for 10,000 loci, with 500 sites per locus. We will use PAUP* (http://paup.phylosolutions.com) to analyze this data set (PAUP* will subsequently be referred to as PAUP, without the asterisk). It is often convenient to run PAUP from a Nexus-file script containing the commands used to perform the analysis, but we will usually issue the commands interactively here for pedagogic reasons.

Start PAUP and load the data file. Using the command-line interface, type:

$ paup anomaly_zone.nex -L anomaly.log

The first command argument above is the name of the data file, and the "-L" option opens a log file that will preserve all of the output of your run (you can use any name you like for the log file).

If you are instead using the GUI interface, launch PAUP and enter the commands:

paup> log file=anomaly.log;
paup> exec anomaly_zone.nex;

Alternatively, GUI users can choose the "Log Output to File" and "Open" commands from the File menu.

We'll begin with a "concatenated" maximum-likelihood analysis to demonstrate the problem. In order to perform ML in PAUP, you first need to estimate a substitution model, which specifies the rate of substitution from each nucleotide to each other nucleotide, the equilibrium base frequencies, and the distribution of rate variation across sites. PAUP provides a tool to automatically compare models using the AIC or BIC model selection criteria. A reasonable starting tree is needed (but the details of the tree topology have little effect on the chosen model). We'll just do a quick neighbor-joining analysis using LogDet distances (which are a good general purpose distance when you don't know what else to use):

paup> dset distance=logdet;
paup> nj;
paup> automodel;

Using the default options, automodel will evaluate a set of 56 models and choose the one with that minimizes the AIC. On completion, the model parameters will be set to their maximum-likelihood estimates, and we can use this as the starting point for a maximum-likelihood search:

paup> set criterion=likelihood;
paup> hsearch;

(Note that you can abbreviate PAUP commands as long as they do not become ambiguous. For instance, instead of the above, we could have instead used set crit=like; hs;)

One way to see the tree found by the ML search is to use the describetrees command, with branch lengths drawn proportionally to the estimated number of substitutions/site:

paup> describe/plot=p;

Note the relationships among the taxa implied by the topology of this tree. Now we'll do an svdquartets analysis (Chifman and Kubatko, 2014a,b) for the same data. For any command in PAUP, you can see the available options by typing "command-name ?;"

Before we start our next analysis, look at the options available for the svdquartets command:

paup> svdquartets ?;

For example, you can see that it is possible to evaluate quartets exhaustively ("evalquartets=all") or sample quartets randomly ("evalquartets=random nquartets=n"). Typically, you will leave most options set at their default settings, and enter values only for those you wish to override. One exception is that the current default setting for evalquartets is random (this may change in a future version), so we will explicitly request evaluation of all possible quartets. We'll also do a bootstrap analysis to assess confidence in the result

paup> svdq evalq=all bootstrap;

The analysis finishes quickly and outputs the estimated tree, which is the one compatible with all 5 of the inferred quartet relationships. In fact, this is the "true" tree that generated the data (see Liu and Edwards, 2009). The concatenated ML method estimated the tree incorrectly despite the large number of sites (500,000). Write down the bootstrap proportions for the two internal nodes for discussion later.

Although not part of this abbreviated tutorial, we have a longer version here that also demonstrates an ASTRAL analysis (including the estimation of gene trees), which also recovers the correct tree.

When you reach this point, quit PAUP (so that it will forget its current settings and we can start fresh):

quit;

Part 2: Analysis of a real data set

The data set is for members of the family Canidae (dogs, wolves, coyotes, foxes, jackals, etc.). Lindblad-Toh et al. (2005) sequenced a collection of 16 nuclear loci. The alignments used here are from a *BEAST2 tutorial written by Huw Ogilvie. We reformatted them into the Nexus format and replaced the latin species names with common names.

Start PAUP again and load the canid sequence data file. With command-line versions, do:

$ paup canids.nex -L canids.log

On GUI versions, launch PAUP and use the Log and Open memu commands, or enter the following from the command line:

paup> log file=canids.log;
paup> exec canids.nex;

This file contains data for two individals from each species, so we use a taxon-partition to assign each individual tip to a species. This definition is already in the file and you do not need to type it here. It looks like this:

    taxpartition species =
        sidestriped_jackal:  sidestriped_jackal_a sidestriped_jackal_b,
        African_golden_wolf: African_golden_wolf_a African_golden_wolf_b,
        coyote:              coyote_a coyote_b,
        gray_wolf:           gray_wolf_a gray_wolf_b,
        blackbacked_jackal:  blackbacked_jackal_a blackbacked_jackal_b,
        Ethiopian_wolf:      Ethiopian_wolf_a Ethiopian_wolf_b,
        Dhole:               Dhole_a Dhole_b,
        African_wild_dog:    African_wild_dog_a African_wild_dog_b
        ;

Perform an SVDQuartets analysis, referencing this taxon partition:

paup> svdq evalq=all taxpartition=species nthreads=ncpus;

Notice that the (North American) gray wolf (Canis lupus) joins with the African golden wolf (Canis anthus) rather than the (North American) coyote (Canis latrans), unlike the result of the *BEAST tutorial (see StarBEAST2-tutorial.pdf. However, this result is not well supported, as we can see by doing a multilocus nonparametric bootstrap, which resamples (with replacement) both loci and sites within loci:

paup> svdq evalq=all taxpartition=species bootstrap=multilocus loci=combined nthreads=ncpus;

(The "combined" above is the name of the character partition defining genes in the input file.) Examining the output bootstrap consensus tree, we see that the bootstrap support for the (gray wolf, African golden wolf) grouping is weak, and many bootstrap runs will actually find the (gray wolf, coyote) grouping that is probably correct. Interestingly, the DensiTree plot in the *BEAST tutorial also demonstrates that support for this grouping is very weak.

Quit PAUP again before we begin the last part of the tutorial:

paup> quit;

Part 3: Doing your own simulations

PAUP* now supports simulating nucleotide data under the multispecies coalescent model (among other kinds of simulations). We will use the file sim-6tips.nex, and we will quickly walk you through the components of this file:

#NEXUS

begin taxa;
    dimensions ntax=6;
    taxlabels A B C D E F;
end;

begin trees;
    tree 1 = [&R] (A:40.0,((B:10.0,C:10.0):24.0,(D:32.0,(E:30.0,F:30.0):2.0):2.0):6.0);
end;

begin dnasim;
    simdata multilocus=y nloci=100 nsitesperlocus=200;
    truetree source=memory treenum=1 units=2Ngen
             scalebrlen=1
             mscoal=y Ne=100000 mu=1e-8 seed=0
             showtruetree=brlens showgenetrees=n storetruetrees=n;
    lset nst=1 basefreq=eq; [= Jukes-Cantor model]
    beginsim nreps=100 seed=0;
        svdq nthreads=ncpus;
        tally 'svdq';
    endsim;
end;

The copy of this file that you have in your directory will not run initially, because we have replaced the nloci=100, nsitesperlocus=200, and scalebrlen=1 with "@" symbols. Each of you will perform one (or more) simulation(s) by substituting values for the number of loci, number of sites per locus, and branch-length scaling factor. You should choose either 1 or 200 for nsitesperlocus. If you choose 1 site/locus, choose a value for nloci from the set {1000, 10000, 100000, or 1000000). If you choose 200 sites/locus, choose a value for nloci from the set {50, 100, 1000, or 10000}. You will now run 3 simulations, with branch-length scaling factors of 0.1 (high ILS), 1 (moderate ILS), and 10 (low ILS). (NOTE: the 10000 loci x 200 sites/locus combinationsswill take a while, so randomly choose one of the 3 scaling factors for your first simulation so that if you run out of time we'll collectively have results from all 3 ILS levels.)

Using a text editor you are comfortable with (or the built-in editor of PAUP GUI versions), replace each "@" symbol with your chosen values. After you have saved the file, execute it in PAUP:

$ paup sim-6tips.nex

(As before, use the "execute" or Open commands in GUI versions.)

As your runs complete, enter the results into the Google Sheet here: SVDQuartets results.

Feel free to run as many simulation conditions as you like, entering the results from each into the spreadsheet. We'll discuss the results once most people have entered their numbers.

References

Chifman J., Kubatko L.S. 2014. Quartet inference from SNP data under the coalescent model. 30:3317–3324.

Chifman J., Kubatko L.S. 2015. Identifiability of the unrooted species tree topology under the coalescent model with time-reversible substitution processes, site-specific rate variation, and invariable sites. J Theor Biol. 374:35–47.

Kubatko L.S., Degnan J.H. 2007. Inconsistency of phylogenetic estimates from concatenated data under coalescence. Syst Biol. 56:17–24.

Lindblad-Toh, K., Wade, C. M., Mikkelsen, T. S., Karlsson, E. K., Jaffe, D. B., Kamal, M., Clamp, M., Chang, J. L., Kulbokas, E. J., Zody, M. C., et al. 2005. Genome sequence, comparative analysis and haplotype structure of the domestic dog. Nature, 438(7069): 803–819.

Liu L., Edwards S.V. 2009. Phylogenetic analysis in the anomaly zone. Syst Biol. 58:452–460.