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)
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
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f216bfc80371c5e355bfad251524b8297a2296665ddc75135661952be51cd765
|
|
| MD5 |
49b9157fea7f6f0f110b97d29945422b
|
|
| BLAKE2b-256 |
15314af9b6f1d76850ae1f14b9ce908c0edf6a49a194b093de274c17a96e2a55
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc820b01e0eaa4ad8a50d111b49057b1c6d920cd273cf39987e0c7ccf17f54db
|
|
| MD5 |
d15ff4f2a1f332a19aaf277902c689d7
|
|
| BLAKE2b-256 |
31f910714900e37e26a3cfc23e37fe3234137d6dae6a56f1d3a78445a7dc8625
|