Ancestral state reconstruction (ASR) infers states at internal phylogenetic nodes for sequences (codon, protein, nucleotide), discrete traits, continuous traits, and gene content. The choice of framework depends on the data class and inference question. For sequences, PAML codeml RateAncestor=1 (Yang 1995 Genetics 141:1641) and IQ-TREE2 --ancestral provide marginal ML reconstructions; GRASP (Foley 2022) handles indels probabilistically -- critical for protein resurrection. For discrete traits, corHMM (Boyko & Beaulieu 2021) with hidden Markov rate models supersedes simpler Mk approaches.
The most consequential mistake is reconstructing under a site-independent or trait-stationary model when the biology demands a hidden-rate / non-stationary / epistatic model -- the resulting "ancestor" is mathematically optimal under the wrong model and silently wrong.
# Sequence ASR
conda install -c bioconda paml iqtree
# RevBayes for Bayesian ASR
# https://revbayes.github.io/download
# GRASP for indel-aware protein ASR
# https://github.com/bodenlab/GRASP
# FastML
conda install -c bioconda fastml
# R packages for trait ASR
Rscript -e "install.packages(c('ape', 'phytools', 'geiger', 'corHMM', 'phangorn', 'OUwie', 'bayou', 'RERconverge'))"
Rscript -e "remotes::install_github('thej022214/hisse')"
# Python
pip install biopython ete4
Tell the AI agent what to do: - "Reconstruct the ancestral protein sequence at the mammalian root for resurrection construct design" - "Infer ancestral state of trait X using corHMM with hidden rate categories" - "Perform stochastic character mapping with 1000 simulations to get full posterior over character histories" - "Reconstruct ancestral continuous trait values along the tree under OU model with regime shifts"
"Reconstruct the ancestral cytochrome c sequence at the eukaryote root using GRASP for indel-aware ASR. Design 8 alternative constructs varying ambiguous sites (P < 0.8). Validate ML construct against extant homologs as functional baseline."
"Reconstruct ancestral states of a binary trait (flight ability) on 50 bird species. Test ER vs SYM vs ARD rate models via AIC. If rates are asymmetric, use ARD. Cross-validate against stochastic mapping with
phytools::make.simmap(nsim=5000, pi='fitzjohn')."
"Test whether a discrete trait (sociality) influences speciation/extinction across 200 species using HiSSE as the required null. BiSSE has 40% Type-I false-positive rate (Rabosky-Goldberg 2015); only conclude trait-dependent diversification if HiSSE-null is rejected."
pi='fitzjohn' root prior; >=1000 simulationscomparative-genomics/positive-selection - Branch- and site-level selection on ancestral branches comparative-genomics/ortholog-inference - Orthogroups feed sequence ASR comparative-genomics/gene-tree-species-tree-reconciliation - DTL-aware ancestral gene content comparative-genomics/whole-genome-duplication - Time scale from Ks for trait dating comparative-genomics/comparative-annotation-projection - Project ancestral CDS to descendants phylogenetics/modern-tree-inference - Rooted ML/Bayesian trees phylogenetics/bayesian-inference - RevBayes / MrBayes priors phylogenetics/divergence-dating - Time-calibrated trees for absolute-time ASR alignment/multiple-alignment - PRANK / MACSE indel-aware alignment alignment/alignment-trimming - PREQUAL / HmmCleaner filtering before ASR