From a raw FASTA file to a properly rooted, reproducible maximum-likelihood phylogeny: ortholog curation, MAFFT alignment, substitution model selection and IQ-TREE 3 inference.
Every phylogenetic analysis begins with a FASTA file in which every sequence represents a homologous copy of the same locus or protein domain. If distant paralogs or mis-annotated viral genome segments are accidentally mixed in a database query, no downstream substitution model can rescue non-homology: the tree will separate non-homologous blocks across an extreme internal branch while compressing true evolutionary distances within each clade.
When working with GenBank, RefSeq or ENA downloads, verify three points before aligning: that all sequences share the same strand orientation (negative-sense viral assemblies are frequently deposited in reverse orientation relative to mRNA), that identifiers are unique, and that at least one outgroup taxon is included closely enough to orient the root without inducing long-branch attraction.
--adjustdirection)strandMultiple sequence alignment establishes which nucleotide or amino-acid site in one taxon is positionally homologous to another. Alignment errors manufacture false shared synapomorphies that inflate bootstrap support on incorrect branches.
Alignment is not a preliminary formality: it is the positional homology hypothesis upon which every likelihood calculation rests.
Within MAFFT 7, selecting the right algorithm depends on sequence count and indel architecture:
| MAFFT Mode | When to use it |
|---|---|
| L-INS-i | Small to medium datasets (≤ 100 sequences) of comparable length where iterative local refinement maximizes accuracy. |
| E-INS-i | Multi-domain proteins or partial gene captures where conserved blocks are separated by large unalignable insertions or deletions. |
| G-INS-i | Sequences of globally uniform end-to-end length without major terminal truncations. |
| Codon-aware (CDS) | In-frame protein-coding DNA: aligns translated amino acids and back-translates triplet by triplet without breaking the reading frame. |
| FFT-NS-2 | Hundreds or thousands of closely related sequences (e.g. viral genomic surveillance). |
After alignment, ragged sequence ends or hypervariable gappy loops introduce non-stationary noise. Conservative column trimming such as ClipKIT (smart-gap) removes gap-dominated columns while strictly retaining parsimony-informative sites.
A substitution model specifies relative exchange rates among states (for instance transition/transversion ratios in HKY or full reversibility in GTR for DNA, or empirical matrices such as LG, Q.pfam or Q.plant for proteins) alongside rate heterogeneity across sites (discrete Gamma +G4 or non-parametric FreeRate +R categories).
Rather than hard-coding a model out of habit, ModelFinder in IQ-TREE 3 evaluates candidate models and selects the one minimizing the Bayesian Information Criterion (BIC), penalizing over-parameterization. For concatenated multi-gene supermatrices, supply a partition definition and invoke MFP+MERGE so each locus - or merged subset of loci with shared evolutionary dynamics - receives its own model and relative rate.
Maximum likelihood (ML) tree search explores tree space via stochastic NNI and SPR rearrangements to identify the topology and branch lengths maximizing the probability of observing the alignment under the chosen model. Standard publication practice evaluates internal clade reliability in a single run using complementary metrics:
--bnni (1,000-2,000 replicates): ultrafast column resampling with NNI refinement on each bootstrap alignment to guard against support inflation under model misspecification.threshold ≥ 95%Always inspect IQ-TREE's compositional homogeneity χ² test as well: taxa with extreme GC or amino-acid bias violate stationarity and may cluster artificially.
Time-reversible substitution models yield unrooted trees: they specify relative relatedness, not evolutionary direction from ancestor to descendants. Three principled approaches orient the root: placing the root on a known outgroup branch (Root here), applying midpoint rooting when no outgroup is available and evolutionary rates are roughly clock-like, or calibrating tip/fossil dates with LSD2 to obtain a time-scaled chronogram.
Remember that horizontal branch lengths in a standard phylogram represent expected substitutions per site, not calendar years. When a dataset pairs a deeply divergent outgroup with a tight recent outbreak clade of nearly identical isolates, switching display scaling to square-root branch scale (√d) expands fine within-clade resolution without altering underlying branch lengths.
See our in-depth guide to UFBoot, SH-aLRT, gCF and sCF for diagnosing nodes where support statistics disagree.
How many sequences are needed to build a phylogenetic tree?
Mathematically, at least four sequences are required to evaluate an unrooted internal bipartition. In practice, assemble samples spanning the taxonomic diversity of interest plus one or two unambiguous outgroup taxa to orient the root.
When should coding DNA be aligned by codons versus as amino acids?
For conserved protein-coding sequences (CDS) across closely or moderately related taxa, codon-aware alignment preserves the reading frame without 1- or 2-bp frameshift gaps while retaining informative third-codon-position signal. Across deep evolutionary divergences where third positions are saturated, translate and analyze amino acids directly.
What is the difference between UFBoot and SH-aLRT?
UFBoot resamples alignment columns to measure clade stability (ideally with --bnni to avoid overestimating support under mild model misspecification), whereas SH-aLRT tests the log-likelihood gain of each internal branch against its two immediate NNI neighbors. A clade is considered strongly supported when UFBoot ≥ 95% and SH-aLRT ≥ 80%.
Do I need the command line to run MAFFT and IQ-TREE 3?
No. Haldane Lifeforms bundles MAFFT 7, IQ-TREE 3 and ASTRAL-IV inside a free native Windows desktop application, running the complete workflow locally without terminal commands.
Official Lifeforms Documentation - How to read UFBoot, SH-aLRT, gCF and sCF - Free phylogenetics software comparison - Free alternatives to MEGA and SnapGene - Primer design and molecular cloning
Haldane Lifeforms 2.0.3 bundles MAFFT, ClipKIT, IQ-TREE 3 (ModelFinder, LSD2, ASR) and ASTRAL-IV in a free Windows desktop suite. It auto-configures settings from your FASTA and records full SHA-256 provenance.