Data from: Reconstructing substitution histories on phylogenies, with accuracy, precision, and coverage
Data files
Sep 09, 2026 version files 10.70 MB
-
beastmap_dryad.zip
10.69 MB
-
README.md
4.34 KB
Abstract
Ancestral sequences and substitution histories are usually averaged out in phylogenetic inference and are therefore not reported to the user. However, they can be recovered through ancestral sequence reconstruction (ASR) and stochastic character mapping. By implementing and validating a new ASR and stochastic mapping package compatible with both single-locus and multispecies coalescent analysis, we show how reconstructing substitution histories can enhance the information gained about the tempo and mode of molecular evolution. We observe that known substitution histories (simulated and empirical) are recovered more accurately and precisely on time trees compared with unconstrained and non-ultrametric substitution trees that lack temporal directionality (maximum likelihood and Bayesian). We show that codon-partition models with site-rate heterogeneity, based on the four nucleotide characters, can effectively approximate the histories of synonymous and non-synonymous change, while requiring far less runtime than computationally demanding codon models that require 61 characters. In turn, this provides low-bias estimation of dN/dS that is robust to non-stationarity in GC content, codon usage bias, and nucleotide exchangeability rates. Lastly, using three case studies, we demonstrate how the approach can recover expected patterns in molecular evolution and pathogen transmission: that i) smaller-bodied mammalian species tend to have faster synonymous substitution rates than larger relatives, ii) amino acid substitutions are correlated with 3Di structural changes in aminoacyl-tRNA synthetases, and iii) influenza A virus spread more frequently to nearby locations than distant ones, in a major H3N2 outbreak in New Zealand. These three trends were more pronounced when based on count estimates derived from stochastic mapping, relative to parametric rates and distances. Our open-source code comes with a user-friendly graphical interface, as does the BeastMap package for BEAST 2, supporting a wide range of clock, site, and tree models and data types - including insertions and deletions - within a Bayesian phylogenetic framework.
Dataset DOI: 10.5061/dryad.v15dv429q
This repository contains the simulated and biological datasets used by BeastMap.
Files and variables
Benchmark datasets: beastmap_dryad.zip
The 400 simulated datasets used for benchmarking are in the datasets subdirectory. These datasets are all specified as json and trees files that together contain the true trees, parameters, substitution counts, and simulated alignments. The json file also contains the maximum likelihood tree found by IQ-TREE.
The BEAST 2 XML files used on these datasets can be found in inference. To run the BD-R inference model on a dataset, use the following command:
~/beast/bin/beast -overwrite -df var.seq.ml.json BR-R.xml
for one of the JSON files found in datasets.
Directory tree:
benchmarking
|---- datasets
|---- BD-C
|---- rep1, rep2, ... , rep100
|---- BD-R
|---- rep1, rep2, ... , rep100
|---- GM
|---- rep1, rep2, ... , rep100
|---- ME-CG
|---- rep1, rep2, ... , rep100
|---- inference
dN/dS estimation
The four trimmed mammalian loci used here can be found in mammal as fasta files.
The 300 codon-simulated datasets are in the simulated subdirectory. These datasets are all specified as json and trees files that together contain the true trees, parameters, substitution counts, and simulated alignments. The simulated alignments are found in the json files, and for convenience are also available as fasta files.
To run the P3+R4+W4 inference model on a dataset, use the following command:
~/beast/bin/beast -overwrite -df var.seq.json P3_R4_W4.xml
for one of the JSON files found in simulated/datasets. Make sure to install the FreeRates package for BEAST 2 to use the free rate site model.
Directory tree:
dNdS
|---- mammal
|---- simulated
|---- datasets
|---- codonS
|---- rep1, rep2, ... , rep100
|---- codonN5
|---- rep1, rep2, ... , rep100
|---- codonC60
|---- rep1, rep2, ... , rep100
Case study 1: influenza
This directory contains the alignment, BEAST 2 XML file, and summary trees used in the influenza analysis. H3N2.nexus is the summary tree (binary), while H3N2.beastmap.segment.nexus is the segmented summary tree (non-binary, where each unary node describes a transition from one deme to another). Make sure to install the BEAST_CLASSIC package for BEAST 2 to enable the phylogeography analysis.
Directory tree:
influenza
Case study 2: mammals
This directory contains a StarBeast3 XML file with all 50 trimmed loci included (mammals.xml) and the summary species tree (mamals.nexus).
The sisters subdirectory contains the sister pairs for 10 randomly selected analyses (out of 10,000). Each file name contains the p-value of the analysis, and each file corresponds to a random species tree sampled from the posterior distribution. These tsv files contain the following variables:
tip1 and tip2 - the two randomly selected leaves being compared (order is random)
trait1 and trait2 - the logged and standardised body sizes of these two tips, respectively.
d1 and d2 - the number of synonymous substitutions between each tip and their MRCA on this tree.
distance - the sum of d1+d2.
mrca.age - the age of their MRCA on the species tree (in units of expected substitutions per site).
Directory tree:
mammals
|---- sisters
Case study 3: anticodon binding domain
This directory contains the amino acid and 3Di alignments (crimvlg_aa_trimmed.fasta and crimvlg_3di_trimmed), BEAST 2 XML file ( aa_3di.xml), and summary tree (crimvlg.nexus). Make sure to install the FoldBeast package for BEAST 2.
Directory tree:
anticodon
Code/software
To run these XML files, please install BEAST 2.7.8 with the BeastMap v0.0.3 package installed.
