Skip to main content

Newick Tree Validator and Formatter

Simple utility to validate and format Newick trees.

The main use of this utility is to validate constraint trees used with IQtree2.

IQtree2 can throw hard to understand errors when using constraint trees even if the tree is technically a valid Newick tree.

This utility will catch many of those errors and provide a more detailed error message.

Installation

You can install the utility using pip:

pip install nwkfmt

Usage

Validation without formatting:

./main.py <tree.nwk>

In place formatting:

./main.py <tree.nwk> --inplace

Outputting formatted tree to a separate file:

./main.py <tree.nwk> --outfile <output.nwk>

Outputting list of terminal nodes into a text file:

./main.py <tree.nwk> --terminals <terminals.txt>

Formatting even if validation fails:

./main.py <tree.nwk> --inplace --no-validate

Release

This project uses Poetry for dependency management and packaging.

To build a release, run:

poetry build

To publish a release to PyPI, run:

poetry publish

To publish the release to Github, run:

gh release create 0.4.1 dist/*

Metadata

Release files for nwkfmt 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nwkfmt 0.4.1
File Size Uploaded
nwkfmt-0.4.1.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nwkfmt 0.4.1
File Interpreter ABI Platform
nwkfmt-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / nwkfmt-0.4.1.tar.gz

Download URL nwkfmt-0.4.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
93d3ef8f0e74ddcdeadc62ec835b68481fced6da8dd2e1dc5807f74e6dd62f39
BLAKE2b-256 checksum
How to use checksums
9a2ada8b2e1f775cf8ccdf4c6523ec78b7296c849dc4df2193e43a032e0ae740
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.11 Darwin/24.5.0

Release files / nwkfmt-0.4.1-py3-none-any.whl

Download URL nwkfmt-0.4.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e6f41f8f565aa0d91b386e32dbfe7a3b4eec99a36af96d297d78633fa59303d
BLAKE2b-256 checksum
How to use checksums
79261e344c5562377b4e76b11e12376c412da4c7b716e5c2b516fe39f8674100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.11 Darwin/24.5.0

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page