Skip to content

kfuku52/nwkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

126 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Tests GitHub release Bioconda Python Platforms Downloads License

Overview

NWKIT (/njuːkit/) is a toolkit for manipulating phylogenetic trees in the Newick format.

Installation

The latest version of NWKIT is available from Bioconda. For users requiring a conda installation, please refer to Miniforge for a lightweight conda environment.

Install from Bioconda

conda install bioconda::nwkit

Verify the installation by displaying the available options

nwkit -h

(For advanced users) Install the development version from GitHub

pip install git+https://github.com/kfuku52/nwkit

Optional dependencies for image post-processing

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]"

Subcommands

See Wiki for usage.

  • constrain: Generating a species-tree-like Newick file for topological constraint
  • collapse: Collapsing internal branches by support and/or branch length
  • cladefreq: Summarizing clade frequencies across a tree collection
  • consensus: Generating a consensus tree or transferring consensus support to a reference tree
  • dist: Calculating topological distance between two trees
  • draw: Drawing a phylogenetic tree with optional speciation/duplication node markers
  • drop: Removing node and branch information
  • image: Retrieving representative species images with license-aware filtering
  • info: Printing tree information
  • intersection: Dropping non-overlapping leaves/sequences between two trees or between a tree and an alignment
  • label: Adding unique node labels
  • mark: Adding texts to node labels by identifying the targets with a leaf name regex
  • mcmctree: Introducing divergence time constraints for PAML's mcmctree
  • monophyly: Assessing whether species or trait-defined groups are monophyletic
  • nhx2nwk: Generating Newick from NHX
  • nwk2table: Converting a Newick tree into a parent-child table
  • printlabel: Searching and printing node labels
  • prune: Pruning leaves
  • rename: Renaming nodes using a TSV mapping or regular expression
  • rescale: Rescale branch length with a given factor
  • root: Placing or transferring the tree root
  • sanitize: Eliminating non-standard Newick flavors
  • shuffle: Shuffling branches and/or labels
  • skim: Sampling leaves from clades with shared traits
  • subtree: Generating a subtree Newick file
  • table2nwk: Converting a parent-child table into a Newick tree
  • transfer: Transferring information between trees
  • validate: Validating one or more Newick trees and reporting structural issues

Citation

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).

Licensing

This program is MIT-licensed. See LICENSE for details.

About

Newick tree processing

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages