Phyne
A high-performance Rust crate for indel-aware phylogenetic analysis and multiple sequence alignment under maximum likelihood and parsimony optimality criteria.

Current Functionality • Getting Started • Crate Features • Roadmap • Contributing • Related Projects • Support • Citation • Licence and Attributions
Current Functionality
- Maximum Likelihood Phylogenetic Analysis: Efficient implementation of phylogenetic tree inference using SPR or NNI moves using likelihood or parsimony cost functions;
- Multiple Sequence Alignment (MSA): Support for Multiple Sequence Alignment using the IndelMaP algorithm;
- Sequence Evolution Models: Support for various DNA (JC69, K80, TN93, HKY, GTR) and protein (WAG, HIVB, BLOSUM62) substitution models as well as the Poisson Indel Process (PIP) model and the TKF91/TKF92 models (the TKF models are only compatible with NNI moves, see the documentation of the
Compatible trait);
- High Performance: Optimised tree search with optional parallel processing capabilities.
Getting Started
Note: This crate is not yet published on crates.io. To use it directly from GitHub, add this to your Cargo.toml:
[dependencies]
phyne = { git = "https://github.com/acg-team/phyne", package = "phyne" }
Once published on crates.io, you’ll be able to use:
[dependencies]
phyne = "0.1.0"
Minimum Supported Rust Version: 1.88.0
MSRV detected using cargo-msrv.
Example
use phyne::likelihood::TreeSearchCost;
use phyne::optimisers::{SprOptimiser, TopologyOptimiser};
use phyne::phylo_info::PhyloInfoBuilder;
use phyne::random::FakeGenerator;
use phyne::substitution_models::{SubstModel, SubstitutionCostBuilder, K80};
use phyne::Result;
fn main() -> Result<()> {
// Note: This example uses test data from the repository
let info = PhyloInfoBuilder::new("./examples/data/K80.fasta").build()?;
let k80 = SubstModel::<K80>::default();
let c = SubstitutionCostBuilder::new(k80, info).build()?;
let unopt_cost = c.cost();
let mut rng = FakeGenerator::default();
let optimiser = TopologyOptimiser::new(c, SprOptimiser {}, &mut rng);
let result = optimiser.run()?;
assert_eq!(unopt_cost, result.initial_cost);
assert!(result.final_cost > result.initial_cost);
assert!(result.iterations <= 100);
assert_eq!(result.cost.tree().len(), 9); // The initial tree has 9 nodes, 5 leaves and 4 internal nodes, and so should the resulting tree.
Ok(())
}
Crate Features
This crate supports several optional features:
par-regraft: Enable parallel regrafting operations using Rayon;
par-regraft-chunk: Enable chunked parallel regrafting;
par-regraft-manual: Enable manual parallel regrafting control;
Test related features:
precomputed-test-results: Speed up test runs with precomputed results (for local development);
recompute-brute-force-asr: Force re-computation of brute-force ancestral sequence re-estimation in tests instead of loading precomputed results;
multithread-brute-force-asr: Parallelise brute-force ancestral sequence re-estimation computation in tests.
Enable features in your Cargo.toml:
[dependencies]
phyne = { git = "https://github.com/acg-team/phyne", package = "phyne", features = ["par-regraft"] }
Roadmap
This crate is new and in active development at the moment. The basic existing functionality is mentioned above, but the following features are being currently implemented or planned:
- Simultaneous tree and alignment estimation under the PIP model;
- Extension to the PIP model that includes long insertions (manuscript in preparation);
- Ancestral state reconstruction: using PIP (ARPIP), TKF92 and IndelMaP;
- Randomised starting trees for tree inference;
- Generalisation of the tree structure for easier use in other crates.
Other minor features/improvements are documented on the GitHub issues page.
Contributing
This is a new library that is currently in active development. Contributions are highly welcome!
API Stability: As this crate is in active development, the API may change between versions until we reach 1.0. We’ll follow semantic versioning and document breaking changes in release notes.
New Contributors
Please read our contributor guide!
Contributors:
Current
Past
Support
For questions, bug reports, or feature requests, please go to the phyne discussion page and/or open an issue on GitHub.
Citation
If you use this library in your research, please consider citing:
@software{phyne_rust,
title = {This is Phyne: a Rust crate for indel-aware phylogenetics},
author = {Pečerska, Jūlija and Mrzik, Mattes and Gil, Manuel and Anisimova, Maria},
url = {https://github.com/acg-team/phyne},
year = {2026}
}
Licence and Attributions
Licence
This project is licensed under either of
at your option.
Benchmarking Datasets
Datasets for benchmarking were taken from:
- Zhou, Xiaofan (2017). Single-gene alignments. figshare. Dataset. Link;
- Zhou, Xiaofan (2017). Supermatrices. figshare. Dataset. Link.
The datasets are licensed under CC BY 4.0.
The datasets were modified by normalising invalid/unrecognised sequence characters since the exact sequences are less relevant
for pure performance measurements.
评论