Jun 13, 2025

Public workspaceAncestral State Reconstruction

  • Dakota Betz1
  • 1ucsd
  • Rouse Lab
Icon indicating open access to content
QR code linking to this content
Protocol CitationDakota Betz 2025. Ancestral State Reconstruction. protocols.io https://dx.doi.org/10.17504/protocols.io.6qpvr6e62vmk/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: December 15, 2021
Last Modified: June 13, 2025
Protocol Integer ID: 55982
Keywords: ancestral state reconstruction, protocol, document, old version
Disclaimer
Our protocols are constantly evolving and old versions will be deleted.
The documents here are not intended to be cited in publications
Abstract
Our protocols are constantly evolving and old versions will be deleted.
The documents here are not intended to be cited in publications
Troubleshooting
Programs and Dependencies
Mesquite

RAxML-ng
GUI 2.0 (compatible with ng): https://antonellilab.github.io/raxmlGUI/

FigTree


Text Editor (options below)

Note
NOTE: This protocol assumes you already have a tree ready to import into Mesquite that you would like to use for the ancestral state reconstruction.

Tree Import
Tree import into Mesquite works best if the tree file is already in nexus or newick format. If your tree is not already in this format, open it in FigTree and select Export Trees, then choose either Nexus or Newick format and check the box to Save as currently displayed if applicable.
To import your tree into Mesquite, open Mesquite (.jar version works best). Select File > Open and choose your tree file.
Matrix Set-up
On the left side menu under Project, select Add... > New Character Matrix. This should autofill with the taxon names from your tree. Type in the number of characters you need to code for your ancestral state reconstruction and select Categorical Data.
Once the matrix is created, fill in the character labels at the top. Select Matrix > Show Matrix Info Panel. This should produce a tab on the right labeled "State Names". You can type in the character state names/labels that you'd like for your characters here (e.g. if your character is "habitat", you can add in "vent, seep, organic fall" as character states). Keep track of the numbers that apply to each state so you know which ones to enter for each of your taxa in the matrix.
Note
NOTE for character coding: if you have taxa that have multiple character states, you can use AND or OR coding. General preference is OR, which is indicated by a / between the character states in the matrix.

Ancestral State Reconstruction
Once your matrix is filled out, there are various reconstruction options. The most frequently used in our lab are parsimony reconstructions (no model applied) and likelihood ancestral states (applies a model). We'll do the latter here.
Return to the tree Window. Select Analysis:Tree > Trace Character History and select your reconstruction method: likelihood ancestral states. You can also select this from the Method submenu if you have already selected Trace Character History once and want to repeat your analysis.
Viewing the Results
Use the "balls and sticks" style to view your resulting tree. Select Display > Tree Form > Balls & Sticks
You may also want to see relative likelihoods and branch lengths. Select Display > Branches proportional to lengths to see a tree with branchlengths (note that these must have been present in the tree you imported to begin with in order to display them). Select Drawing Menu > Tree Form with line style "square" to see relative likelihoods and branch lengths.