PalantiR

PalantiR simulates and visualizes complete substitution histories — every substitution event, with its time, codon, and fitness context — under time-heterogeneous mutation–selection codon substitution models and other advanced models, including site-specific fitness profiles, epistasis between sites, and changes in effective population size or fitness along a phylogeny.

For installation notes, see this page.

Details on particular models and simulation types can be found on the following pages:

Nucleotide Models

Codon Models

Temporal Heterogeneity

Features

What’s new in 1.2

Following a full source review: reproducible simulations via set_palantir_seed(); an exact time-change alternative to the segment rescaler (rescale_method = "exact"); corrected CoEvolution and Markov-modulated model semantics; input validation throughout; and repaired datasets and documentation. See NEWS.md for the complete list, including breaking changes.

Engine validation

The simulation engine is validated by a rerunnable notebook that tests branch-length calibration under each scaling mode, the stationary distribution, and the transient between two equilibria in a time-heterogeneous simulation, each against an exact expectation with a pre-stated pass criterion. Read the current validation report (all tests pass, version 1.2.1), or rerun it from a clone of the repository:

# in validation/, with PalantiR installed
rmarkdown::render("engine_validation.Rmd", params = list(seed = 1))

For a larger event-level demonstration, the GY94 history-validation report simulates 5,000 codons on a 50-taxon tree, reconstructs Goldman–Yang dN/dS from all recorded substitutions, and visualizes the branch-specific histories. The executable Jupyter notebook is retained in the repository under validation/.

Mutation-selection with epistasis Substitution histories under mutation–selection with epistasis Fitness shift A fitness shift under a time-heterogeneous mutation–selection model