NWKIT (/njuːkit/) is a toolkit for manipulating phylogenetic trees in the Newick format.
# Installation with pip
pip install git+https://github.com/kfuku52/nwkit
# This should show complete options
nwkit -h
See Wiki for usage.
constrain: Generating a species-tree-like Newick file for topological constraintdist: Calculating topological distance between two treesdrop: Removing node and branch informationinfo: Printing tree informationintersection: Dropping non-overlapping leaves/sequences between two trees or between a tree and an alignmentlabel: Adding unique node labelsmark: Adding texts to node labels by identifying the targets with a leaf name regexmcmctree: Introducing divergence time constraints for PAML's mcmctreenhx2nwk: Generating Newick from NHXprintlabel: Searching and printing node labelsprune: Pruning leavesrescale: Rescale branch length with a given factorroot: Placing or transferring the tree rootsanitize: Eliminating non-standard Newick flavorsshuffle: Shuffling branches and/or labelsskim: Sampling leaves from clades with shared traitssubtree: Generating a subtree Newick filetransfer: Transferring information between trees
There is no published paper on NWKIT itself, but we used and cited NWKIT in several papers including Fukushima & Pollock (2023, Nat Ecol Evol 7: 155-170).
This program is BSD-licensed (3 clause). See LICENSE for details.
