Skip to main content

Simple library for manipulating phylogenetic trees

Project description

treezy

Tests License: MIT PyPI PyPI - Python Version

treezy is a simple Python library for manipulating phylogenetic trees, including reading from and writing to files.

Features

  • Parse and manipulate phylogenetic trees
  • Read and write trees with branch annotations and comments
  • Lightweight and easy to integrate into existing Python projects

Installation

pip install treezy

To build treezy from source you can run

git clone https://github.com/4ment/treezy
pip install treezy/

Usage

from treezy.tree import Tree

newick = '((A:[&rate=0.1,cat=0]1,B:[&rate=0.1,cat=0]2):[&rate=0.2,cat=1]3,C:[&rate=0.2,cat=1]4);'
tree = Tree.from_newick(newick)
tree.parse_branch_comment({'rate': lambda rate: float(rate)})
for node in tree:
    if not node.is_root:
        node.distance *= node.branch_annotations['rate']
print(tree)
# ((A:0.1,B:0.2):0.6,C:0.8);

Contributing

Contributions are welcome! Please open issues or submit pull requests.

License

This project is licensed under the MIT License. See LICENSE for details.

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

treezy-0.0.2.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

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

treezy-0.0.2-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file treezy-0.0.2.tar.gz.

File metadata

  • Download URL: treezy-0.0.2.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for treezy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 86a1521376a579d37c3888b844ebdc906247d6060bcbf2b35215d20ed1da1a67
MD5 4c3ca05e3d683b648285317406e01d74
BLAKE2b-256 1baf428fd543bcfe6381e53ffbd8bc1fc3a168d3c2d61e36bc3a23972b0d682a

See more details on using hashes here.

Provenance

The following attestation bundles were made for treezy-0.0.2.tar.gz:

Publisher: release_pypi.yml on 4ment/treezy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file treezy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: treezy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for treezy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7d270853382160bf9b8b64bb378e0982265846066d673445f1aff982ab51cae1
MD5 5c45e15d8fb33d746a3b6e79dd785028
BLAKE2b-256 41387a384083e34860d045c865542b60370b2adb8cca9939280a565ababcceec

See more details on using hashes here.

Provenance

The following attestation bundles were made for treezy-0.0.2-py3-none-any.whl:

Publisher: release_pypi.yml on 4ment/treezy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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