Using MESQUITE

Aidan Budd


Getting MESQUITE

MESQUITE is a relatively complex software package written in Java that is free to download and install for a range of different operating systems from this site.

Tutorials

There are some tutorials for MESQUITE available online:

Using MESQUITE

Mesquite is extremely flexible and therefore also inevitably rather complex. It is not designed principally as a means of estimating trees - rather for using pre-calculated trees to test hypotheses concerning the evolution of a range of different kinds of characters.

In particular, the menus available when using MESQUITE can be rather confusing, as the set of menus and options available constantlly changes depending on the context of the package. This makes it rather difficult to provide well-charted descriptions of how to carry out a particular analysis.

The notes below focus primarily on using MESQUITE to change and compare phylogenies with each other at a fairly simple level.

Different versions of MESQUITE present slightly different graphical user interfaces (GUIs) - screenshots and instructions given here are for Version 2.01 run on an OSX Macintosh machine. Be aware that things may well look different if you are running a different version and/or operating system. However, these instructions will hopefully still be valid on these other versions (I've tested them on Version 2.6, both on Linux and Mac machines, and they seemed to work fine).

MESQUITE Basics - Windows and Menus

On opening MESQUITE, several windows will appear on the screen providing information about loading of the software. We need to wait until all but one of these, the "Main Mequite Window", is open.

We usually work with several different windows in MESQUITE. Note that, sightly confusingly, in MESQUITE the "windows" provided by your operating system to interact with Mesquite often include several different regions/tabs referred to as "windows" in the MESQUITE documentation. While it is possible to put each "MESQUITE" window into a different operating-system window, I've found it easier to use the organisation provided by MESQUITE - one for the main window, and then one operating-system window per MESQUITE project.

The image below shows a screen-shot with three operating-system windows - one for the "Main Mesquite Window", one for a project called "untitled.nex", and one for a project called "fourVertebratesMesquite.nex". The fourVertebratesMesquite.nex window contains five different MESQUITE windows. The image also shows the main Menu Bar for MESQUITE.

A more detailed description of the basic organisation of MESQUITE windows (for version 2.6 - thus there are some differences to the appearance compared to the above image) is found in the MESQUITE manual.

Most MESQUITE windows have some typical fields/features/regions on them - again, a reasonably detailed description of these is given in the MESQUITE manual. The ones most relevant for our purposes are shown below for a typical window.

Changing Font Size

On some machines, the font used by MESQUITE may be too small to read easily. To change this, alter the default font size before opening any files

File->Defaults->Default Font Size->14 (for example)

Opening MESQUITE/NEXUS Format Files

There are several different ways to access information stored in files in MESQUITE - this too is somewhat complex as you could read about here. However, for our purposes, we will only be opening files prepared using MESQUITE in NEXUS format, which can be done simply using the Main Menu Bar

File->Open File

and then choosing the desired file from the drop-down menus.

Opening non-NEXUS Format Files

File->Open File

and choose the file you want to open from the menus

The "Import File" window should open, asking you to specify the format of the non-NEXUS format file you are attempting to load. Assuming we are only working with NEWICK/PHYLIP format tree files, the correct choice will be "Phylip (trees)"

MESQUITE will create a new NEXUS format file to store both the imported trees, and the results of any manipulations you make of them using MESQUITE - you will be asked to specifiy an name and location for this file.

NEWICK/PHYLIP Tree Format

MESQUITE requires that the string describing the tree only spans a single line of the file i.e. this tree file, obtained from Ensembl, will not open correctly in MESQUITE, it has to be edited like this so that the entire string is on a single line.

Creating a New Project

MESQUITE stores the results and details of your analysis in NEXUS-format files. It is possible to be using the contents of several different files at once - however, we will keep things simple by storing all our analyses in just one file. You can create this file using the Main Menu Bar

File->New

and then choosing the name and location of the file to store your project.

Then, as often when selecting an action in MESQUITE, you will be presented with an additional "Parameter Window" - in this case entitled "New File Options" concerning the information to be included in the new file. Here we choose the initial number of taxa to be included in the file, along with a name for this initial "block" of taxa.

In the image below we are naming the taxa-block "VertebrateSpecies" and beginning with 5 different taxa.

Clicking "OK" should generate a new operating-system window containing (if invoked as described above) two MESQUITE windows - a left-most "Project" window and a "Tree Window".

If we're creating a new file from scratch like this, we probably want to change the names of the taxa that come automatically ("taxon 1", "taxon 2" etc.) to more meaningful ones. We can do this by opening the Taxa window

Taxa&Trees->List of Taxa


And then using the "Edit" tool to change the names of the taxa with the Edit Tool by clicking with this pointer over the taxon names and editing them. Any name changes are then reflected in any objects containing the taxa from this block e.g. an accompanying Tree Window.

This image shows the use of the Edit Tool to change the names of the taxa.

Opening a Tree Window

If you begin your analysis by opening a file that doesn't contain any trees e.g. containing only a NEXUS taxa block, then you can open a Tree Window using

Taxa&Trees->New Tree Window

Then in the "Select" Parameter Window, choose "Default Trees" - this will create a tree based on the content of your taxa block, providing a default topology for these taxa - and click "OK". The new Tree Window should then open.

Changing how a Tree is Displayed

Square Tree with Horizontal Taxa-Names

Mesquite provides many different ways of displaying trees - below is an example of the default display.

To change the view so that the taxon-names are horizontal, with the tree drawn in "square" form (which is the way I find it easiest to examine the trees in MESQUITE).
This should give a tree that looks like the one shown below.

Rotating Branches around a Node

There isn't a simple button to press that will rotate the branches of a tree around an internal node (a purely cosmetic change to the way the tree is represented, leaving the topology intact).

Instead, this can be done using the "Interchange Branches" tool. To do this, you need to:
  1. choose one of the daughter lineages associated with the node around which you want to rotate the branches by left-clicking on it having selected the Interchange Branches tool
  2. drag the thin bar that comes out from the position of your initial click to the branch you want to swap positions with (which should also be a daughter lineage of the node you want to rotate around) - when it is ready to be interchanged with, the destination branch should be highlighted
  3. on releasing the mouse, the position of the branches should have rotated around the internal node
For example, in the set of screenshots shown below the "taxon 3" branch is rotated around the node it shares with the "taxon 1/taxon 2" parent branch.






Adding Taxa to the Taxa Block (and to the Trees)

To add extra taxa to a tree you need to first add the taxa to the Taxa Block in the following way:
In some cases, the taxa will have been automatically added as branches to your tree - if not, you will need to do the following:
This should place the two new taxa at the base of the tree.

You might want to do something like this if you initially work with hypotheses of the relationships of 5 vertebrates, but due to availability of new data want to incorporate two additional organisms in your analysis.

Editing/Changing the Structure of a Tree

Selecting/Deselecting Regions of a Tree

Several menus accessed from the Tree Window can apply actions to a selected sub-set of the tree e.g.

Tree->Alter/Transform Branch Lengths->Scale Selected Branch Lengths...

To select branches/clades use either of the following tools: Select Branch or Select Clade

To deselect a clade/branch, simply re-click the currently-selected clade.

To deselect all clades/branches, simply click the background of the Tree Window

Re-rooting the Tree

Select the "Reroot at branch" tool and select the banch to be used as the new root.

Changing the Tree Topology

There are several tools that can be used to change the topology of the tree - some of these are:

Editing Branchlengths

Changing Branchlengths One-By-One
There are two tools that can be used to edit/add branchlength information on a tree:
Below you can see branch-lengths being edited using first the "Adjust branch length" and then "Stretch branches" tools.



Changing Multiple Branchlengths at Once

If you are starting with a tree built from a newly-created project, it will usually not have any branchlenghts assigned.. Rather than altering each branch one after the other, you can change/add many branchlengths at the same time using:

Tree->Alter/Transform Branch Lengths->Assign Branch Lengths

This open a "Set branch lengths" Parameter Window. Once you have chosen the branchlength to apply to all branches in the tree, click "OK"

Note that there are various other options provided in the Tree->Alter/Transform Branch Lengths menu that can be used to make other wholescale changes to the branchlengths.

Exporting the Tree in NEWICK/PHYLIP Format

One use of the tree-editing capabilities of MESQUITE is to prepare trees for use by other software packages. Thus we need a way of exporting the new trees out of MESQUITE into an external file.

To do this we need to create a new "Tree Block" from the edited versions of the trees we have created:
  1. Tree->Store Copy of Tree As
  2. in the "Store Tree As" Parameter Window give a name for the tree you are creating, then click "OK"
  3. assuming you haven't yet created a tree block, you need to name a new one in the following "New Tree Block" Parameter Window, and then click "OK"
  4. give both the tree, and the tree block, a name and say OK
  5. now, when you use the File->Export... menu you can choose to export the tree you have built in either NEXUS or (more usually) Phylip format by selecting the format you need, clicking "OK" and choosing a name and destination for the new file.
An alternative approach is to use the Tree Window's option.

Edit->Copy Tree

This copies a NEWICK/PHYLIP format text version of the currently-viewed tree to the clipboard of your desktop - which can then be pasted into a text editor etc.

If branches on the tree have been labeled/selected, this information will be tagged up in the text that is copied to the clipboard - additionally, in many cases the end of the tree description may include additional  characters such as "<> <test = 0.2 >" which you will usually want to remove before loading a file containing the tree into another piece of software.

Removing Trees

You may find that you have created several different trees within a given tree block e.g. via repeated use of Tree->Store Tree or Tree->Store Tree As... menus.

In that case, to remove any trees you do not need:
  1. choose the Taxa&Trees->List of Trees to open the "Trees" tree-list window
  2. from this window, select the rows in the table corresponding to trees you want to delete
  3. use List->Delete Selected Trees and confirm that you do indeed want to delete these by clicking "Yes"

Add a New Taxa Block

If you want to compare trees with different sets of taxa in them (e.g. comparing a gene and a species tree) you will need to create additional Taxa Blocks to describe the additional taxa.
  1. Trees&Taxa->New Block of Taxa...
  2. In the "New Block of Taxa" Parameter Window, give a name to your new block e.g. "genes", and indicate how many taxa should be included in this tree

Add an Association Between Taxa Blocks

If we want to compare/reconcile Species and Gene trees using MESQUITE, we need to tell MESQUITE which taxa in the gene tree correspond to which taxa in the species tree. We do this using an "association".

While in many cases these mappings will be "obvious" based on their names, we still need to explicitly provide this information to MESQUITE - this of course allows for much more flexibility in setting up such mappings between taxa-blocks.

To do this, we need to have already created at least two taxa blocks in the project e.g. by starting up a new project and then adding a second taxa block
  1. Begin from either a "Taxa" or a "Tree" window
  2. Taxa&Trees->New Association
  3. In the "Select taxa" Parameter Window that should appear, choose the species tree from the list and click "OK"
  4. Give a name to the association in the "Name of Association" window, and click "OK"
  5. The window for the species-tree Taxa Block should be automatically selected, with an additional "Association Editor" panel on the right that is used to set up the association.
  6. Select (potentially mutltiple using SHIFT and CTRL) genes from the right-hand list provided in the "Association Editor" panel
  7. Select one row from the left-hand "Taxon" list BY CLICKING ON THE ROW NUMBERS TO SELECT THE WHOLE ROW - not just the name of the taxon in the first "proper" column of the list
  8. Click on the arrow at the top of the Association Editor to assign the selected "gene" taxa to the selected "species" taxon. These gene taxa should now be included in the right-most column of the species taxon table, and also they should now be coloured grey and moved to the left side of the Association Editor.
  9. All genes in the Association Panel need to be associated with a species taxon
Selecting the appropriate genes and taxa


This is how it should look after the assignment is made by clicking on the arrow above the list of gene taxa

Here is the above file as an example with a complete set of associations assigned.

Here are instructions on setting up a new association from the MESQUITE manual.

Comparing Species and Gene Trees

MESQUITE can be used to investigate the minimal set of duplication/extinction events required to reconcile a given gene-tree topology with a given species tree, as described below.
  1. Create a new MESQUITE project with the set of organisms you are interested in
  2. Open a tree window (or use an already-open tree window) and use the "Move Branches" tool to create an organism tree with the topology you want e.g. as in this file. Remember - you will need to STORE the tree you create in this way in a new tree block before being able to later use the tree in further analyses
  3. You need to create a new taxa block to contain the names of the genes that make up the gene-tree we want to reconcile with the species tree
  4. Open a second tree window for the new taxa block, and build a tree with your topology of intrest e.g. as in this file
  5. You need to tell MESQUITE which taxa from the gene Taxa Block correspond to which taxa in the species Taxa Block by creating an "Association"
  6. You are now ready to reconcile the trees by opening the Tree Window containing your species tree and doing
    1. Analysis->Visual Tree Analysis->Contained Gene (or Other) Trees
    2. Typically, in the following "Contained (gene) tree interpretation" window we
      1. leave the the "Treat contained as unrooted" box unchecked
      2. leave the "Contained polytomies auto-resolve" checked
      3. uncheck the "Use Branch lengths of Contained tree") option
    3. and then click "OK"
    4. Select "Stored Trees" as the source for the contained tree (this will be our gene tree)
    5. You may need to manipulate the resulting tree somewhat to view it more easily e.g. using the "Interchange Branches" tool to visualise relationships more easily
    6. You may also want to try changing the lengths of the branches of the tree using the "Stretch branch" tool
An example of a MESQUITE file showing the results of such an analysis is here.

Minimal Number of Duplications

The reconciled trees report the minimal number of duplication and extinction events required to account for the topology of the gene tree (given the species tree) - this is a minimum as any lineage could mask (potentially very many) cryptic successive duplication-extinction events. The image below is labeled to highlight those regions of a reconciled tree associated with gene duplication events.


Branches (labeled above in orange) where the same number of gene-tree lineages emerge from both ends did not experience any gene-duplication events.

Branches where this number is diferent (labeled above in red) indicate branches that DO experience gene duplication events - the difference in the number of these lineages indicating the number of duplication events occuring along that region of the species tree. Considering each of the red branches in turn:
Thus, the smallest number of gene-duplication events required to reconcile this gene tree with the species tree is 5.

Minimal Number of Extinctions

When comparing a bifurcating gene and bifurcating species tree, extinctions can be identified as associated with those nodes where the number of gene-tree lineages emerging along a species-tree daughter lineage is different from the number of these lineages entering the node from the parental branch. As for duplications, this is indicates the minimum number of such events that occur as there might be (potentially many) cryptic duplication/extinction events.

On the image below, those regions of the nodes where this happens are highlighted in purple.


This gives a minimum of 5 extinction events required to reconcile the species and gene trees.

Other Tree-Related Applications

MESQUITE can be used to obtain sets of trees with a range of different properties - which can then be used in a range of different applications. Some examples of these are given below. They all assume that you have already set up a tree and taxa block in a MESQUITE project, and will produce new Tree Blocks containing the new trees.

Here is an example MESQUITE file containing sets of files created using some of the analyses described below.

Obtain all Possible Rooted Trees

Taxa&Trees->Make New Trees Block from->Modify Current Tree->All Rerootings

Make All Rerootings of Clade

  1. Select the "Make All Rerootings of Clade" tool
  2. Click on clade you want to obtain all rerootings from
  3. Give a name to the block of trees you want the new trees to be storred in via the "Rerooted clade" window and click "OK"

Randomly Move Branches

Taxa&Trees->Make New Trees Block from->Randomly Modify Current Tree->Random Branch Moves

Randomly Change Branch Lengths


Back To Gibson Team Training Pages