TreeKnit infers reassortment from the trees of the segments of a virus, such as the HA and NA trees of influenza:
- Maximally compatible clades (MCCs) for every pair of trees: the largest sets of leaves whose subtrees have the same topology in both trees. Leaves of one MCC share their history in both segments, and a reassortment separates two MCCs
- Resolved trees: polytomies (nodes with more than two children) resolved with the splits of the other trees
- For two trees, an ancestral reassortment graph (ARG) in extended Newick: one network that holds the histories of both segments, with a hybrid node for each reassortment
This is a Rust port of TreeKnit.jl.
Install TreeKnit and run it on two trees:
pip install treeknit
treeknit ha.nwk na.nwk -o resultsThe results directory then holds:
MCCs.json: the MCCsha_resolved.nwk,na_resolved.nwk: the resolved treesARG/arg.nwk: the ARG- with
--plot: SVG figures of the tanglegram and the ARG
The links download the binaries of the latest release.
| Channel | Install |
|---|---|
| Linux x86_64 | glibc, musl* |
| Linux ARM64 | glibc, musl* |
| macOS | Apple Silicon, Intel |
| Windows | x86_64 |
| pip | pip install treeknit |
| Conda | conda install -c bioconda treeknit** |
| Docker | docker pull neherlab/treeknit |
| From source | cargo build --profile dist -p treeknit-cli, writes target/dist/treeknit |
| Docs | usage, command-line reference, for users of TreeKnit.jl, changelog |
* glibc builds need glibc 2.17 or newer. musl builds are static and run on any Linux distribution.
** Bioconda releases need manual approval and can be delayed.
The method is described in:
Barrat-Charlaix P, Vaughan TG, Neher RA (2022). TreeKnit: Inferring ancestral reassortment graphs of influenza viruses. PLOS Computational Biology 18(8): e1010394. https://doi.org/10.1371/journal.pcbi.1010394
Report bugs and ask questions in the issue tracker. CONTRIBUTING.md explains how to build, test, and change the code.