Zubair Khalid

Virologist/Molecular Biologist | Veterinarian | Bioinformatician

Conventional & Molecular Virology • Vaccine Development • Computational Biology

Dr. Zubair Khalid is a veterinarian and virologist specializing in conventional and molecular virology, vaccine development, and computational biology. Dedicated to advancing animal health through innovative research and multi-omics approaches.

Dr. Zubair Khalid - Veterinarian, Virologist, and Vaccine Development Researcher specializing in Computational Biology, Multi-omics, Animal Health, and Infectious Disease Research

Blog · Guides · Published 2026-07-12

Phylogenetic Tree Workflow: From Aligned Sequences to a Defensible Figure

This guide delivers a complete, step by step workflow for building a phylogenetic tree that withstands scientific scrutiny. It covers data selection, multiple sequence alignment, model choice, support estimation, rooting, and honest reporting of limitations. If you are a graduate student, a postdoc, or a bench scientist moving into computational phylogenetics, this article gives you the practical decisions and pitfalls to know. Start with your research question and finish with a figure you can defend. No prior bioinformatics experience is required, but a willingness to think critically about each step is essential. EMBL-EBI Training offers free courses that complement this guide, and NCBI Bookshelf provides authoritative references for the underlying biology.

At a Glance

Step Key Action Common Tools Typical Pitfall
Data selection Choose orthologous sequences and appropriate markers NCBI, SRA, BLAST Using paralogs or contaminated data
Multiple sequence alignment Align sequences with an accurate algorithm MAFFT, MUSCLE, Clustal Omega Ignoring alignment quality and trimming
Model selection Choose the best fit evolutionary model ModelTest, jModelTest, IQ-TREE Using default model without testing
Tree inference Build a tree using maximum likelihood or Bayesian methods IQ-TREE, RAxML, MrBayes Overinterpreting poorly supported branches
Support values Estimate branch confidence with bootstraps or posterior probabilities IQ-TREE, RAxML, MrBayes Reporting only raw bootstrap without cutoff
Rooting Place the root using an outgroup or other methods FigTree, Dendroscope Choosing an inappropriate outgroup
Reporting limitations State assumptions, data quality, and uncertainty Any text editor Overselling the resolution of the tree

Decision Criteria Before You Start

Phylogenetic inference begins with a clear biological question. Are you resolving deep evolutionary relationships or tracking a recent outbreak? The answer determines the genetic marker. For species level phylogenies, mitochondrial genes or ribosomal RNA often work because they evolve at moderate rates. For strain level epidemiology, whole genome SNPs or hypervariable loci give better resolution. Always verify that your sequences are orthologous and free of contamination. Use the NCBI Sequence Read Archive to retrieve raw reads for decontamination or find curated sequences in GenBank. If your data come from amplicon sequencing, a pipeline like the one described for Usutu virus surveillance can serve as a template [7]. For single specimen metabarcoding, recent work shows that phylogenetic authentication of amplicon sequence variants reduces false positives [9].

Another key decision is outgroup choice. Rooting a tree without an outgroup is speculative. The outgroup should be closely related to your ingroup but clearly outside it. Use published phylogenies or taxonomic knowledge to select a reliable outgroup. Avoid very distant outgroups because long branch attraction can mislead the inference. For example, in a study on Arcellinida amoebae, the authors used morphological and molecular data to identify the phylogenetic home of Argynnia, carefully selecting outgroup taxa from related infraorders [6].

Practical Workflow: From Sequences to a Defensible Figure

Step 1. Retrieve and Curate Your Sequences

Collect your sequences from public databases or generate them in the lab. If you use whole genome data, extract the loci of interest and ensure their coordinates are syntenic. For SRA data, assemble the reads and call variants. Then filter for length, completeness, and absence of stop codons (for protein coding genes). Make a fasta file with clear, unique identifiers that include species names and accession numbers. Document every sequence source, reproducibility demands it.

Step 2. Multiple Sequence Alignment

Alignment is the foundation of any tree. Use a progressive or iterative method such as MAFFT with the L‑INS‑i strategy for medium sized datasets or the G‑INS‑i for global alignments Galaxy Training Network. After alignment, visually inspect the result. Remove regions where the alignment is uncertain, especially highly variable loops or ambiguously aligned positions. Software like trimAl or Gblocks can automate trimming. Manual curation remains the gold standard for small datasets. A poor alignment produces a tree that is confidently wrong.

Step 3. Choose the Best Fit Evolutionary Model

All substitution models are approximations, but some approximate better than others. Use a likelihood ratio test, Akaike information criterion, or Bayesian information criterion to compare models. Free tools like ModelTest or the built in model finder in IQ‑TREE will test up to hundreds of models. Partition your data by codon position or gene if you concatenate multiple loci. The Bioconductor package phangorn provides R based model selection and tree inference for intermediate users. Do not skip this step, using a GTR model because someone else used it is a common mistake.

Step 4. Infer the Tree

Maximum likelihood (ML) is the standard for most phylogenetic studies because it is computationally efficient and statistically consistent. Run at least 1000 bootstrap replicates (or use the ultrafast bootstrap implemented in IQ‑TREE). For Bayesian inference, run two independent Markov chain Monte Carlo (MCMC) chains and check for convergence with effective sample sizes above 200. NCBI Bookshelf includes a chapter on phylogenetic methods that explains the difference between ML and Bayesian approaches. In a recent study on the yeast like symbiont of Scaphoideus titanus, a multi‑omics approach guided ML tree inference and revealed related fungal symbioses in insects [11]. For automation, a Python based pipeline that constructs trees and performs comparative statistics has been developed and validated [8].

Step 5. Assess Support Values

Report bootstrap support or posterior probabilities on the tree. Bootstrap values below 70% are generally considered unsupported, although the threshold depends on the data and method. For Bayesian posterior probabilities, values above 0.95 are considered strong. Never show a tree without support values. Also consider other measures such as transfer bootstrap expectation or gene concordance factors when analysing multi‑gene datasets. Support values measure the reproducibility of the branch, not the accuracy of the tree.

Step 6. Root the Tree

Rooting is a separate step from tree inference. Identify the outgroup branch and use it to place the root. In most software, you can specify the outgroup after the tree is built. If no reliable outgroup is available, you may consider midpoint rooting as a last resort, but this assumes a molecular clock that is rarely satisfied. A well rooted tree allows correct interpretation of ancestral states and character evolution.

Step 7. Visualize and Annotate the Figure

Use FigTree, iTOL, or ggplot2 with ggtree to produce a publication quality figure. Label branches with support values, highlight clades of interest, and include a scale bar for substitutions per site. Keep the figure uncluttered, a tree with 50 taxa can be readable, but 200 taxa requires careful layout. Save the tree file in Newick or Nexus format so others can reproduce your analysis.

Common Mistakes

  1. Using a single gene without justification. One gene tells you one gene’s history. Incomplete lineage sorting, horizontal transfer, or selection can mislead. Use multiple independent loci when possible.

  2. Ignoring alignment quality. Garbage in, garbage out. An alignment that is not inspected or trimmed produces a tree that cannot be trusted.

  3. Misapplying models. Using a simple model for a long alignment can cause underfitting. Using a complex model for a short alignment can cause overfitting. Always test.

  4. Overinterpreting low support. A branch with 60% bootstrap support is not resolved. Do not discuss it as if it were.

  5. Rooting with a distant outgroup. Very long branches attract each other. Your root may end up inside the ingroup.

  6. Reporting a tree without a scale bar. The reader needs to know branch lengths to interpret evolutionary rates.

  7. Not depositing alignments and tree files. Reproducibility requires data availability. Upload to Dryad, Figshare, or a repository linked to your publication.

Limits and Uncertainty in Phylogenetic Inference

No phylogenetic tree is absolutely correct. The method infers a hypothesis, not a fact. Several sources of uncertainty are inherent. First, evolutionary models are simplifications. They assume site independence, stationarity, and homogeneity of the substitution process. When these assumptions are violated, the tree may be biased. Second, finite sequence length means that stochastic error is unavoidable. Bootstrapping estimates this error, but cannot account for systematic errors caused by model misspecification or alignment artefacts. Third, biological processes such as incomplete lineage sorting, gene duplication and loss, and horizontal gene transfer produce gene trees that differ from the species tree. Concatenating multiple genes can mask discordance. Use species tree methods like ASTRAL or SVDquartets when analysing multi‑locus data. Finally, rooting and outgroup choice can change the topology. Perform sensitivity analyses by rooting with different outgroups or excluding the outgroup and mid‑point rooting. Report these checks in your manuscript. For example, a study on Clinostomum flukes in Nile tilapia combined morphological and molecular data and explicitly discussed the limitations of single‑marker phylogenies [10]. A defensible figure includes an honest assessment of what the data can and cannot resolve.

Frequently Asked Questions

Q: How long should my sequences be for a reliable tree?

A: There is no universal minimum. For very recent divergences, shorter hypervariable regions may suffice. For deep divergences, longer alignments (500 to 2000 bp) or multiple genes are recommended. The number of informative sites matters more than total length. A rule of thumb is to have at least 100 parsimony informative sites per branch you want to resolve.

Q: Can I combine data from different studies or gene fragments?

A: Yes, but you must ensure orthology and check for compositional heterogeneity. Concatenate only if each partition has the same underlying tree. Test for incongruence with a partition homogeneity test or by comparing single‑gene trees.

Q: Should I always use maximum likelihood over Bayesian inference?

A: Both methods are powerful. ML is faster and less sensitive to prior choice. Bayesian methods can incorporate complex models and produce posterior probabilities that are often easier to interpret. For many datasets the results are congruent. Choose the method that fits your computational resources and that your field accepts.

Q: What is the best software for visualizing trees?

A: FigTree (desktop, free) and iTOL (web, free for moderate use) are the most common. For programmatic generation in R, ggtree is excellent. Use a tool that allows direct annotation of bootstrap values and clade colours.

References and Further Reading

Related Articles