MrModeltest: A Complete Guide to Model Selection in PhylogeneticsModel selection is a crucial step in phylogenetic analysis: choosing an appropriate substitution model affects tree topology, branch lengths, and support values. MrModeltest is one of the classic tools designed to help researchers select the best-fitting nucleotide substitution model before running phylogenetic inference (particularly for MrBayes and other programs). This article explains what MrModeltest does, how it works, how to use it effectively, alternatives and complements, and practical tips for integrating model selection into your phylogenetic workflow.
What is MrModeltest?
MrModeltest is a program that automates comparison among candidate nucleotide substitution models to recommend the model that best fits an alignment according to information criteria (commonly AIC and BIC) or likelihood-based comparisons. It was designed to streamline the step of choosing a substitution model prior to Bayesian inference with MrBayes, but its recommendations are broadly useful for maximum likelihood (ML) and Bayesian phylogenetic analyses.
MrModeltest parses output from Modeltest (or from PAUP*/PHYML depending on versions and pipelines) or directly evaluates models by fitting them to an input alignment, then ranks models using selected criteria. It summarizes parameter estimates (base frequencies, substitution rates, proportion of invariant sites, gamma shape parameter for rate heterogeneity) so recommended models can be fed into downstream programs.
Why model selection matters
Substitution models describe how nucleotide sites change over time. A poor model choice can:
- Bias branch length estimates and topology.
- Under- or overestimate support values (bootstrap/posterior probabilities).
- Produce incorrect or imprecise parameter estimates (e.g., substitution rates, divergence times).
Choosing a model that balances goodness-of-fit and complexity (penalizing over-parameterization) improves inference reliability. Information criteria such as AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) are widely used to balance fit vs. complexity.
Underlying models and model components
Most nucleotide substitution models are nested and vary by assumptions about base frequencies, substitution rates, and rate heterogeneity. Common components:
- Base frequency model: equal (e.g., JC69) or estimated empirical frequencies (e.g., GTR).
- Rate matrix symmetry: simple single-rate models (JC69), transition/transversion differences (K80), unequal rates across all pairs (GTR).
- Proportion of invariant sites (I): allows a fraction of sites to be invariable.
- Gamma-distributed rate heterogeneity (G): models rate variation among sites with a gamma distribution (shape parameter α).
Common models: JC69, K80 (K2P), HKY85, TrN, TIM, GTR, and variants with +I, +G, or +I+G.
How MrModeltest works (overview)
- Input: aligned nucleotide sequences (commonly in NEXUS or PHYLIP formats).
- Model fitting: the program fits a predefined set of candidate substitution models to the alignment, estimating parameters via maximum likelihood using an underlying engine (often interfacing with PAUP* or using internal routines depending on version).
- Ranking: models are ranked by chosen criteria (AIC, AICc, BIC, likelihood ratio tests where applicable).
- Output: a report listing models, their log-likelihoods, estimated parameters (base frequencies, rate matrix, proportion invariant, gamma α), and the recommended model(s) with suggested settings for MrBayes or other software.
Note: MrModeltest often relies on PAUP* for likelihood calculations; some workflows require running PAUP* as part of the pipeline.
Installing and running MrModeltest
MrModeltest historically exists as a Perl script or stand-alone program distributed with documentation. Exact installation steps vary by release and platform; many users run it on Unix-like systems or through graphical wrappers.
General steps:
- Obtain MrModeltest: download from the project page or from repositories where it is maintained. Check compatibility with your operating system and any dependencies (e.g., PAUP*, Perl).
- Prepare your alignment: ensure sequences are aligned and formatted correctly (NEXUS/PHYLIP). Remove ambiguous sequence names and check for characters outside A/C/G/T (or use IUPAC codes if supported).
- Configure: point MrModeltest to the alignment and, if required, to PAUP*/PHYML executables or configure parameters for which criteria to compute (AIC, BIC).
- Run: execute MrModeltest. Depending on dataset size and computing resources, model fitting can take minutes to hours.
- Read the output: identify the top-ranked model and note recommended parameters for downstream analyses.
Because MrModeltest interfaces with PAUP* in many setups, ensure you follow licensing rules for PAUP* (it is not free).
Example workflow (concise)
- Align sequences (MAFFT/MUSCLE/Clustal).
- Inspect and trim alignment; remove poorly aligned regions.
- Run MrModeltest to rank models (AIC and BIC).
- Select the best model or a small set of top models.
- Configure MrBayes or an ML program (RAxML, IQ-TREE, PhyML) with the chosen model settings:
- For MrBayes: set lset nst=6 rates=gamma; prset statefreqpr=fixed(empirical) or estimated as appropriate; include propinv if recommended.
- For ML programs: choose GTR/GTR+G models or approximations available (many ML programs offer GTR+G+I or partition-specific models).
- Run phylogenetic inference, inspect convergence/bootstraps/posterior distributions.
Interpreting MrModeltest output
- Log-likelihood: higher (less negative) is better.
- AIC/AICc/BIC: lower values indicate better balance of fit and parsimony.
- ΔAIC/ΔBIC: differences from the best model—models within ~2 units are often considered similar; larger differences indicate substantially worse fit.
- Parameter estimates: base frequencies, rate ratios, proportion invariant (I), gamma shape (α). Use these to set priors or fixed values appropriately in Bayesian analyses.
Limitations and caveats
- MrModeltest traditionally focuses on nucleotide models; for protein-coding data, consider partitioning by codon position or using codon models instead.
- Using both +I and +G simultaneously can be problematic because the invariant-sites parameter can absorb signal from a low α, creating identifiability issues; some recommend using +G alone or carefully interpreting combined estimates.
- Model choice depends on data: short or low-variation alignments may not support complex models.
- MrModeltest’s reliance on PAUP* or older engines can make it less convenient than newer tools that integrate model testing with tree search.
- Information criteria are approximations; where computationally feasible, model averaging or Bayesian model selection approaches can be considered.
Alternatives and modern tools
Several newer tools provide faster, more flexible, or better-integrated model selection:
- IQ-TREE’s ModelFinder: very fast, supports a wide model set, can do partitioned analyses, and integrates selection into ML tree search.
- jModelTest / jModelTest2: Java-based; similar goals though development has slowed relative to ModelFinder.
- ModelTest-NG: modern, efficient implementation supporting many models and criteria.
- PartitionFinder / ModelFinder for partitioned datasets: selects models and partitioning schemes simultaneously, useful for multi-gene or codon-partitioned datasets.
- PhyML and RAxML also offer model testing or simplified model options.
These tools often provide more up-to-date model sets and better speed for large datasets.
Practical tips
- Always inspect alignments before model testing (bad alignment will mislead model selection).
- For protein-coding genes, partition by codon position; consider separate models per partition.
- Use BIC if you prefer stronger penalty for complexity (useful with limited data); use AIC/AICc for a balance favoring fit.
- If inference software lacks the exact recommended model, pick the closest available (e.g., GTR instead of TIM/TM if not available) and note differences.
- Consider model adequacy checks or posterior predictive checks where possible — selecting a model that fits better by information criteria does not guarantee it adequately captures the data-generating process.
- When in doubt, run sensitivity analyses with a few top-ranked models to check robustness of tree topology and support.
Example MrBayes block from a MrModeltest recommendation
If MrModeltest recommends GTR+I+G, a basic MrBayes block might look like:
begin mrbayes; lset nst=6 rates=invgamma; prset statefreqpr=estimated; mcmc ngen=2000000 printfreq=1000 samplefreq=1000 nchains=4; sump burnin=500; sumt burnin=500; end;
Adjust ngen, burnin, and other MCMC settings depending on dataset complexity and convergence diagnostics.
Summary
MrModeltest remains a useful, well-known program for selecting nucleotide substitution models in phylogenetics, particularly for users integrating results with MrBayes. However, modern alternatives like ModelFinder and ModelTest-NG often offer faster, broader, and more convenient model selection. Good practice combines careful alignment curation, sensible partitioning, and running sensitivity checks with top-ranked models rather than blindly accepting a single recommendation.