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)
for node in tree:
    if not node.is_root:
        node.parse_branch_comment({'rate': lambda rate: float(rate)})
        node.distance *= node.branch_annotation('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.1.tar.gz (18.4 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.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: treezy-0.0.1.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for treezy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f216bfc80371c5e355bfad251524b8297a2296665ddc75135661952be51cd765
MD5 49b9157fea7f6f0f110b97d29945422b
BLAKE2b-256 15314af9b6f1d76850ae1f14b9ce908c0edf6a49a194b093de274c17a96e2a55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: treezy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for treezy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc820b01e0eaa4ad8a50d111b49057b1c6d920cd273cf39987e0c7ccf17f54db
MD5 d15ff4f2a1f332a19aaf277902c689d7
BLAKE2b-256 31f910714900e37e26a3cfc23e37fe3234137d6dae6a56f1d3a78445a7dc8625

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