NWKIT (/njuːkit/) is a toolkit for manipulating phylogenetic trees in the Newick format.
The latest version of NWKIT is available from Bioconda. For users requiring a conda installation, please refer to Miniforge for a lightweight conda environment.
conda install bioconda::nwkit
nwkit -h
pip install git+https://github.com/kfuku52/nwkit
nwkit image can normalize image format, trim margins, and resize/pad output files when the optional image-processing dependencies are installed:
pip install "nwkit[image]"
See Wiki for usage.
constrain: Generating a species-tree-like Newick file for topological constraintcollapse: Collapsing internal branches by support and/or branch lengthcladefreq: Summarizing clade frequencies across a tree collectionconsensus: Generating a consensus tree or transferring consensus support to a reference treedist: Calculating topological distance between two treesdraw: Drawing a phylogenetic tree with optional speciation/duplication node markersdrop: Removing node and branch informationimage: Retrieving representative species images with license-aware filteringinfo: 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 mcmctreemonophyly: Assessing whether species or trait-defined groups are monophyleticnhx2nwk: Generating Newick from NHXnwk2table: Converting a Newick tree into a parent-child tableprintlabel: Searching and printing node labelsprune: Pruning leavesrename: Renaming nodes using a TSV mapping or regular expressionrescale: 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 filetable2nwk: Converting a parent-child table into a Newick treetransfer: Transferring information between treesvalidate: Validating one or more Newick trees and reporting structural issues
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 MIT-licensed. See LICENSE for details.
