Skip to main content

Simple Newick tree validator and formatter

Project description

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/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nwkfmt-0.4.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nwkfmt-0.4.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file nwkfmt-0.4.1.tar.gz.

File metadata

  • Download URL: nwkfmt-0.4.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Darwin/24.5.0

File hashes

Hashes for nwkfmt-0.4.1.tar.gz
Algorithm Hash digest
SHA256 93d3ef8f0e74ddcdeadc62ec835b68481fced6da8dd2e1dc5807f74e6dd62f39
MD5 3e873b96a34764cc064daa97a18603f4
BLAKE2b-256 9a2ada8b2e1f775cf8ccdf4c6523ec78b7296c849dc4df2193e43a032e0ae740

See more details on using hashes here.

File details

Details for the file nwkfmt-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: nwkfmt-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Darwin/24.5.0

File hashes

Hashes for nwkfmt-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e6f41f8f565aa0d91b386e32dbfe7a3b4eec99a36af96d297d78633fa59303d
MD5 7b027b5aca36dfd2a33e64b57aae30b0
BLAKE2b-256 79261e344c5562377b4e76b11e12376c412da4c7b716e5c2b516fe39f8674100

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page