Part II · Module 10 · AMAS + IQ-TREE 3

Concatenation and phylogenetic inference with IQ-TREE 3

Concatenate the filtered UCE alignments with AMAS, generate a locus-partition file, and infer a partitioned maximum-likelihood phylogeny with IQ-TREE 3.

Objective

Starting from one of the filtered UCE alignment sets generated in Module 09, create a supermatrix while preserving locus boundaries as partitions, then use IQ-TREE 3 for model selection, partition merging, maximum-likelihood inference, SH-aLRT support and ultrafast bootstrap support.

Workflow used in this module

UCE alignments → AMAS → concatenated PHYLIP + NEXUS partitions → IQ-TREE 3

1. Create a separate phylogeny environment

Keep AMAS and IQ-TREE 3 separate from the older PHYLUCE 1.7.3 environment. The current Bioconda packages provide AMAS 1.0 and IQ-TREE 3.1.4.

conda create -n uce-phylogeny \
  -c conda-forge \
  -c bioconda \
  amas=1.0 \
  iqtree=3.1.4

conda activate uce-phylogeny

Check the programs:

AMAS.py --help

iqtree3 --version

2. Choose the occupancy dataset

Select one of the filtered datasets generated in Module 09. Here, a 75% occupancy matrix is used only as an example.

PROJECT="/path/to/my_UCE_project"

DATASET="$PROJECT/taxon-sets/all"
ALIGNMENTS="$DATASET/mafft-nexus-75p"

CONCAT="$DATASET/concatenated-75p"
mkdir -p "$CONCAT"
Use the matrix chosen for your analysis

If your selected matrix is 90%, 95% or another threshold, change only the ALIGNMENTS and output directory names. The concatenation procedure remains the same.

3. Confirm the input alignments

Count the loci that will enter the supermatrix:

find "$ALIGNMENTS" \
  -maxdepth 1 \
  -name "*.nexus" \
  | wc -l

Inspect a few filenames:

find "$ALIGNMENTS" \
  -maxdepth 1 \
  -name "*.nexus" \
  | sort \
  | head

AMAS expects aligned input files. The NEXUS files produced by PHYLUCE in Module 08 satisfy this requirement.

4. Concatenate the UCE loci with AMAS

AMAS can concatenate alignments even when individual loci do not contain identical taxon sets. Missing sequences are represented as missing data in the final supermatrix.

SUPERMATRIX="$CONCAT/uce-75p.phy"
PARTITIONS="$CONCAT/uce-75p.partitions.nex"

cd "$ALIGNMENTS"

AMAS.py concat \
  -i *.nexus \
  -f nexus \
  -d dna \
  -u phylip \
  -t "$SUPERMATRIX" \
  -p "$PARTITIONS" \
  --part-format nexus
concat
Concatenates all supplied alignments into a single supermatrix.
-i *.nexus
Uses all locus-by-locus NEXUS alignments in the selected directory.
-f nexus
Specifies the input alignment format.
-d dna
Declares nucleotide sequence data.
-u phylip
Writes the concatenated alignment in sequential PHYLIP format.
-t
Names the concatenated alignment.
-p
Names the partition file.
--part-format nexus
Writes locus boundaries in NEXUS partition syntax understood by IQ-TREE.

5. Inspect the AMAS outputs

Confirm that both files were produced:

ls -lh "$SUPERMATRIX" "$PARTITIONS"

Inspect the beginning of the partition file:

head -30 "$PARTITIONS"

A typical AMAS NEXUS partition file contains one charset per UCE locus:

#NEXUS
Begin sets;
    charset uce-1 = 1-642;
    charset uce-2 = 643-1287;
    charset uce-3 = 1288-1944;
    ...
End;
Why preserve locus partitions?

UCE loci can evolve at different rates and under different substitution models. Keeping each locus as an initial partition allows IQ-TREE to model that heterogeneity rather than treating the entire supermatrix as one homogeneous block.

6. Summarize the concatenated alignment with AMAS

AMAS.py summary \
  -i "$SUPERMATRIX" \
  -f phylip \
  -d dna \
  -o "$CONCAT/uce-75p.summary.txt"

Inspect the summary:

cat "$CONCAT/uce-75p.summary.txt"

Record at least the total number of taxa, alignment length, missing-data percentage, variable sites and parsimony-informative sites.

7. Run IQ-TREE 3

IQ-TREE 3 uses -p for an edge-linked proportional partition model. With MFP+MERGE, ModelFinder evaluates substitution models and searches for a better partitioning scheme by merging compatible starting partitions.

IQTREE_OUT="$CONCAT/iqtree3"
mkdir -p "$IQTREE_OUT"

iqtree3 \
  -s "$SUPERMATRIX" \
  -p "$PARTITIONS" \
  -m MFP+MERGE \
  -B 1000 \
  -alrt 1000 \
  -T AUTO \
  --seed 12345 \
  --prefix "$IQTREE_OUT/uce75_concat"
-s
Concatenated UCE supermatrix produced by AMAS.
-p
Uses an edge-linked proportional partition model.
-m MFP+MERGE
Runs ModelFinder and searches for a merged partitioning scheme before tree inference.
-B 1000
Performs 1,000 ultrafast bootstrap replicates.
-alrt 1000
Performs 1,000 SH-like approximate likelihood ratio test replicates.
-T AUTO
Lets IQ-TREE estimate an efficient number of CPU threads.
--seed 12345
Sets an explicit random seed to improve reproducibility.
--prefix
Places all IQ-TREE output under a consistent analysis prefix.

8. Large UCE datasets: reduce partition-search cost

Thousands of initial locus partitions can make exhaustive partition merging computationally expensive. IQ-TREE provides relaxed clustering to reduce that cost.

A practical alternative for large UCE matrices is:

iqtree3 \
  -s "$SUPERMATRIX" \
  -p "$PARTITIONS" \
  -m MFP+MERGE \
  -rcluster 10 \
  -B 1000 \
  -alrt 1000 \
  -T AUTO \
  --seed 12345 \
  --prefix "$IQTREE_OUT/uce75_concat_rcluster10"

-rcluster 10 restricts the partition-merging search to a smaller subset of candidate merges and can substantially reduce computation. Because this changes the partition-search strategy, record its use explicitly in the methods.

9. Expected IQ-TREE outputs

iqtree3/
├── uce75_concat.iqtree
├── uce75_concat.log
├── uce75_concat.treefile
├── uce75_concat.contree
├── uce75_concat.ckp.gz
├── uce75_concat.best_scheme.nex
├── uce75_concat.model.gz
└── ...
*.treefile
Best maximum-likelihood tree with branch support values.
*.iqtree
Main report containing model, likelihood, partition and tree information.
*.log
Complete execution log.
*.best_scheme.nex
Best partition scheme selected after ModelFinder partition merging.
*.ckp.gz
Checkpoint file that allows interrupted analyses to resume.

10. Inspect the final tree and report

Inspect the end of the IQ-TREE report:

tail -80 "$IQTREE_OUT/uce75_concat.iqtree"

Inspect the Newick tree:

cat "$IQTREE_OUT/uce75_concat.treefile"

When SH-aLRT and ultrafast bootstrap are run together, branch labels in the final tree contain both support values. Their order is described in the IQ-TREE report.

11. Interpreting branch support in phylogenomics

Very high bootstrap support in a concatenated phylogenomic matrix does not by itself imply that all UCE loci support the same relationship. Large supermatrices can produce high support even when substantial gene-tree discordance is present.

Do not stop at bootstrap support

Treat the concatenated IQ-TREE analysis as one component of the phylogenomic inference. Gene trees, species-tree methods and concordance measures provide complementary information about conflict among loci.

12. Repeating the analysis across occupancy matrices

If both 75% and 95% matrices were retained in Module 09, run AMAS and IQ-TREE independently for each matrix rather than reusing a concatenated alignment generated from another occupancy threshold.

75% UCE alignments
    ↓
AMAS
    ↓
75% supermatrix + partitions
    ↓
IQ-TREE 3

95% UCE alignments
    ↓
AMAS
    ↓
95% supermatrix + partitions
    ↓
IQ-TREE 3

Comparing resulting topologies provides a direct way to assess sensitivity to occupancy filtering.

13. Pre-flight check

✓ The intended occupancy-filtered UCE dataset was selected.
✓ AMAS concatenated all intended NEXUS alignments.
✓ A NEXUS partition file was generated by AMAS.
✓ The concatenated alignment was summarized and inspected.
✓ IQ-TREE 3 received both the supermatrix and partition file.
✓ ModelFinder partition merging was performed with MFP+MERGE.
✓ UFBoot and SH-aLRT support were calculated.
✓ The .iqtree report, logs, partition scheme and treefile were retained.
✓ The concatenated tree will be compared with locus-based analyses.

References and official documentation

AMAS — official repository and documentation

AMAS — concatenation and partition-file usage

IQ-TREE 3 — Quick start

IQ-TREE — partitioned analyses and partition merging

IQ-TREE — command reference

IQ-TREE 3 — official releases

Software citations

Borowiec ML. 2016. AMAS: a fast tool for alignment manipulation and computing of summary statistics. PeerJ 4:e1660. doi:10.7717/peerj.1660

Minh BQ, Schmidt HA, Chernomor O, et al. 2020. IQ-TREE 2: New models and efficient methods for phylogenetic inference in the genomic era. Molecular Biology and Evolution 37:1530–1534. doi:10.1093/molbev/msaa015

Current software version

This tutorial uses IQ-TREE 3.1.4. The command syntax follows current IQ-TREE 3 documentation, including -p, -B, -T and --prefix.

← Building phylogenomic datasets Next: Gene-tree inference →