Simple library for manipulating phylogenetic trees
Project description
treezy
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86a1521376a579d37c3888b844ebdc906247d6060bcbf2b35215d20ed1da1a67
|
|
| MD5 |
4c3ca05e3d683b648285317406e01d74
|
|
| BLAKE2b-256 |
1baf428fd543bcfe6381e53ffbd8bc1fc3a168d3c2d61e36bc3a23972b0d682a
|
Provenance
The following attestation bundles were made for treezy-0.0.2.tar.gz:
Publisher:
release_pypi.yml on 4ment/treezy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
treezy-0.0.2.tar.gz -
Subject digest:
86a1521376a579d37c3888b844ebdc906247d6060bcbf2b35215d20ed1da1a67 - Sigstore transparency entry: 1303661351
- Sigstore integration time:
-
Permalink:
4ment/treezy@8838edc2edb6cc41deecce88d9bfc0964b7d9709 -
Branch / Tag:
refs/tags/0.0.2 - Owner: https://github.com/4ment
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_pypi.yml@8838edc2edb6cc41deecce88d9bfc0964b7d9709 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d270853382160bf9b8b64bb378e0982265846066d673445f1aff982ab51cae1
|
|
| MD5 |
5c45e15d8fb33d746a3b6e79dd785028
|
|
| BLAKE2b-256 |
41387a384083e34860d045c865542b60370b2adb8cca9939280a565ababcceec
|
Provenance
The following attestation bundles were made for treezy-0.0.2-py3-none-any.whl:
Publisher:
release_pypi.yml on 4ment/treezy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
treezy-0.0.2-py3-none-any.whl -
Subject digest:
7d270853382160bf9b8b64bb378e0982265846066d673445f1aff982ab51cae1 - Sigstore transparency entry: 1303661446
- Sigstore integration time:
-
Permalink:
4ment/treezy@8838edc2edb6cc41deecce88d9bfc0964b7d9709 -
Branch / Tag:
refs/tags/0.0.2 - Owner: https://github.com/4ment
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_pypi.yml@8838edc2edb6cc41deecce88d9bfc0964b7d9709 -
Trigger Event:
release
-
Statement type: