Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

anu2018

Minh Bui edited this page Dec 4, 2018 · 3 revisions

layout: workshop title: "Tutorial for Phylogenomics Workshop using IQ-TREE (ANU 2018)" author: AUTHOR date: DATE docid: 100 tags:

  • workshop

Tutorial for Phylogenomics Workshop using IQ-TREE (ANU 2018)

Table of Contents generated with DocToc

Please first download the beta version 1.7-beta6: https://github.com/Cibiv/IQ-TREE/releases/tag/v1.7-beta6. We will use a new feature not present in the official release 1.6.

For the next steps, the folder containing your iqtree executable should be added to your PATH enviroment variable so that IQ-TREE can be invoked by simply entering iqtree at the command-line. Alternatively, you can also copy iqtree binary into your system search.

TIP: For quick overview of all supported options in IQ-TREE, run the command iqtree -h. {: .tip}

Input data

We will use a Turtle data set to demonstrate the use of IQ-TREE throughout the workshop. Please download the following input files:

  • turtle.fa: The DNA alignment (in FASTA format), which is a subset of the original Turtle data set used to assess the phylogenetic position of Turtle relative to Crocodile and Bird (Chiari et al., 2012).
  • turtle.nex: The partition file (in NEXUS format) defining 29 genes, which are a subset of 248 genes from Chiari et al., 2012.

QUESTIONS:

  • View the alignment in Jalview.
  • Can you identify the gene boundary from the viewer? Does it roughly match the partition file?
  • Is there missing data? Which taxa seem to have most missing data?
  • Does you think if missing data can be problematic? {: .tip}

Inferring the first phylogeny

You can now start to reconstruct a maximum-likelihood (ML) tree for the Turtle data set (assuming that you are in the same folder where the alignment is stored):

iqtree -s turtle.fa -bb 1000 -nt AUTO

Options explained:

  • -s turtle.fa to specify the input alignment as turtle.fa.
  • -bb 1000 to perform the ultrafast bootstrap with 1000 replicates.
  • -nt AUTO to determine the best number of CPU cores to speed up the analysis.

This simple command will perform three important steps:

  1. Model selection (with ModelFinder) to select the best-fit model to the data.
  2. Reconstruct the ML tree with the selected model.
  3. Assess branch supports with the ultrafast bootstrap.

Once the run is done, IQ-TREE will write several output files including:

  • turtle.fa.iqtree: the main report file that is self-readable. You should look at this file to see the computational results. It also contains a textual representation of the final tree.
  • turtle.fa.treefile: the ML tree in NEWICK format, which can be visualized in FigTree.
  • turtle.fa.log: log file of the entire run (also printed on the screen).
  • turtle.fa.ckp.gz: checkpoint file used to resume an interrupted analysis.
  • And a few other files.

QUESTIONS:

  • Look at the report file turtle.fa.iqtree.
  • What is the best-fit model? What do you know about this model?
  • Visualise the tree turtle.fa.treefile in FigTree.
  • Compare the tree with the published tree (Chiari et al., 2012). Are they the same or different?
  • If different, where are the difference(s)?
  • Look at the boostrap supports. Which branch(es) have a low support? {: .tip}

Further readings:

Applying partition model

We now perform a partition model analysis, where one allows each partition to have its own model:

iqtree -s turtle.fa -spp turtle.nex -bb 1000 -nt AUTO

Options explained:

  • -spp turtle.nex to specify the input partition file. It also initiates an edge-linked proportional partition model (i.e. each partition has its own evolutionary rate).

QUESTIONS:

  • Look at the report file turtle.nex.iqtree. What are the slowest- and highest-evolving genes?
  • Compare the BIC score of partition model versus un-partition model done above. Which model is better?
  • Visualise the tree turtle.nex.treefile in Figtree and compare it with the tree from the un-partitioned model. Are they the same or different? If different, where is the difference? Which tree agrees with Chiari et al., 2012?
  • Look at the boostrap supports. Which branch(es) have a low support? {: .tip}

Further readings:

Choosing the best partitioning scheme

We now perform the PartitionFinder algorithm implemented in IQ-TREE that merges partitions to reduce potential model overfitting:

iqtree -s turtle.fa -spp turtle.nex -bb 1000 -nt AUTO -m MFP+MERGE -rcluster 10 -pre turtle.merge

Options explained:

  • -m MFP+MERGE to perform PartitionFinder followed by tree reconstruction.
  • -rcluster 10 to reduce computations by only examining the top 10% partitioning schemes (relaxed clustering algorithm).
  • -pre turtle.merge to set the prefix for all output files as turtle.merge.*. This is to avoid overwriting outputs from the previous analysis.

QUESTIONS:

  • Look at the report file turtle.merge.iqtree. How many partitions do we have now?
  • What is the BIC score? Is it better or worse than those of the un-partition and partition models done previously?
  • How does the tree look like now? How high/low are the bootstrap supports? {: .tip}

Further readings:

Resampling partitions and sites (optional)

Instead of bootstrap resampling sites, it is recommended to resample partitions and then sites within resampled partitions (Gadagkar et al., 2005). This may help to reduce high supports for a wrong branch.

iqtree -s turtle.fa -spp turtle.nex -bb 1000 -nt AUTO -bsam GENESITE -pre turtle.bsam

Options explained:

  • -bsam GENESITE to turn on resampling partition and sites strategy.
  • -pre turtle.bsam to set the prefix for all output files as turtle.bsam.*. This is to avoid overwriting outputs from the previous analysis.

QUESTIONS:

  • Is there any change in tree topology?
  • Do the bootstrap support values get smaller or larger? {: .tip}

Tree topology tests

We now want to know whether the trees inferred for the Turtle data set have significantly different log-likelihoods or not. This can be conducted with Shimodaira-Hasegawa test (Shimodaira and Hasegawa, 1999), or expected likelihood weights (Strimmer and Rambaut, 2002).

First, concatenate the trees constructed by single and partition models into one file:

For Linux/MacOS:

cat turtle.fa.treefile turtle.nex.treefile >turtle.trees

For Windows:

type turtle.fa.treefile turtle.nex.treefile >turtle.trees

Now pass this file into IQ-TREE via -z option:

iqtree -s turtle.fa -spp turtle.nex.best_scheme.nex -z turtle.trees -zb 1000 -n 0 -wpl -pre turtle.test

Options explained:

  • -spp turtle.nex.best_scheme.nex to provide the partition model found previously to avoid model selection again.
  • -z turtle.trees to provide a set of trees.
  • -zb 1000 to specify 1000 boostrap replicates for tree topology tests.
  • -n 0 to avoid tree search and just perform tree topology tests.
  • -wpl to print partition-wise log likelihoods for both trees. This will be used in the next section.
  • -pre turtle.test to set the prefix for all output files as turtle.test.*.

QUESTIONS:

  • Look at the report file turtle.test.iqtree. There is a new section called USER TREES.
  • Do the two trees have significantly different log-likelihoods? {: .tip}

HINTS:

  • The KH and SH tests return p-values, thus a tree is rejected if its p-value < 0.05 (marked with a - sign).

  • bp-RELL and c-ELW return posterior weights which are not p-value. The weights sum up to 1 across the trees tested.

Identifying most influential genes (optional)

Now we want to investigate the cause for such topological difference between trees inferred by single and partition model. One way is to identify genes contributing most phylogenetic signal towards one tree but not the other.

How can one do this? Well, we can look at the gene-wise log-likelihood differences between the two trees, called T1 and T2. Those genes having the largest lnL(T1)-lnL(T2) will be in favor of T1. Whereas genes showing the largest lnL(T2)-lnL(T1) are favoring T2.

With the -wpl option done above, IQ-TREE will write partition-wise log-likelihoods into turtle.test.partlh file.

QUESTIONS:

  • Import this file into MS Excel. Compute the partition wise log-likelihood differences between two trees.
  • What are the two genes that most favor the tree inferred by single model?
  • Have a look at the paper by (Brown and Thomson, 2016). Compare the two genes you found with those from this paper. What is special about these two genes? {: .tip}

Concordance factors

Clone this wiki locally