A package to plot phylogenetic trees with Plotly.
Project description
Plotly PhyloTree Extension
This package extends Plotly to create interactive plots of phylogenetic trees from Newick strings. It can be used with plotly.py and can also be integrated into Dash Apps.
See also:
- Newick format - https://en.wikipedia.org/wiki/Newick_format
- Plotly - https://github.com/plotly/plotly.py
Installation
pip install plotly-phylotree
Usage
1. Basic Tree
- Labels shown by default
- No distances specified in Newick string
from phylotree import create_phylogenetic_tree
newick_str = "(A,(B,C)D)E;"
fig = create_phylogenetic_tree(newick_str)
fig.show()
2. Basic Tree with specified maximum display level
- Display level specifies level up to which tree is plotted. Defaults to np.inf.
from phylotree import create_phylogenetic_tree
newick_str = "(A,(B,C)D)E;"
fig = create_phylogenetic_tree(newick_str, display_level=1)
fig.show()
3. Tree with specified distances
- Labels shown by default
- Distances specified in Newick string
from phylotree import create_phylogenetic_tree
newick_str = "(Bovine:0.69395,(Gibbon:0.36079,(Orang-Utan:0.33636,(Gorilla:0.17147,(Chimp:0.19268,Human:0.11927):0.08386):0.06124):0.15057):0.54939,Mouse:1.21460)"
fig = create_phylogenetic_tree(newick_str)
fig.show()
4. Tree without labels
- Labels deactivated
- Distances specified
from phylotree import create_phylogenetic_tree
newick_str = "(Bovine:0.69395,(Gibbon:0.36079,(Orang-Utan:0.33636,(Gorilla:0.17147,(Chimp:0.19268,Human:0.11927):0.08386):0.06124):0.15057):0.54939,Mouse:1.21460)"
fig = create_phylogenetic_tree(newick_str, show_labels=False)
fig.show()
Contributing
Suggestions for improvement are welcome. As this is a small side project, please allow some time for answers and revision.
License
MIT License
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 plotly_phylotree-0.0.1.tar.gz.
File metadata
- Download URL: plotly_phylotree-0.0.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f2f4037c32a4891887a3a6019c5f150f483af988c1cb47dfe4d6ee890689a16
|
|
| MD5 |
8789cdc0800092ae1ee53f93382e2f10
|
|
| BLAKE2b-256 |
35da821eb6494a9448fde4615ae2c48f75bef7baf45b4e84b055dc9150eb3c1c
|
File details
Details for the file plotly_phylotree-0.0.1-py3-none-any.whl.
File metadata
- Download URL: plotly_phylotree-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a23565a802eacebedd0b17e8ea9e97d0c35240dc35601ea1e2f8541d8e83682f
|
|
| MD5 |
64c7338339ad6e26befcc93bd7cfb776
|
|
| BLAKE2b-256 |
491e416c989abca25ef444c11aadacd51aa82e47cb2d48374b98166c1be624af
|