cogent3 plugin for ete3
Project description
A plugin for converting a cogent3 tree to ete3 tree object
Developed an app that takes a cogent3 PhyloNode
then returns an ete3 PhyloTree
, plus an app for edge colouring.
cogent3 to ete3 tree
from cogent3 import load_tree, get_app
from cogent3_ete3.style import show_legend
tree = load_tree("data/tree_large_scale.newick")
conv = get_app("cogent3_to_ete3")
t = conv(tree)
t
is an ete3 PhyloTree
.
colour edges by a mapping
The ete3_colour_edge
app allows you to colour information on selected edges. The app applies a colour to named edges. This means for colouring internal edges the node must have names.
edge_to_cat = {"Vombatidae_Vombatus_ursinus": "A",
"Dasyuridae_Sarcophilus_harrisii": "B",
"Peramelidae_Echymipera_kalubu" : "C",
"Pseudochiridae_Pseudochirulus_forbesi": "D"}
cat_to_colour={"A":"blue",
"B":"blue",
"C":"red",
"D":"orange"}
cl = get_app("ete3_colour_edge", edge_to_cat=edge_to_cat, cat_to_colour=cat_to_colour)
t = cl(t)
You can use the convenient function to show a legend.
show_legend(t, cat_to_colour, legend_title="Your Category")
In the pop-up window, you can explore further and render the tree in a file as you progress:
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
File details
Details for the file cogent3_ete3-2024.8.22a6.tar.gz
.
File metadata
- Download URL: cogent3_ete3-2024.8.22a6.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34f9605106b6d7cb9666fa01271a1f1d856dae4f1792f6e9e07f9d48f4a3674 |
|
MD5 | 2a346048711d43b1e89d8d009e2d844a |
|
BLAKE2b-256 | 54fac8e173251ef60df15595e5d15579bc613d4fbb2d3c1422a4aae444d7cb0f |
File details
Details for the file cogent3_ete3-2024.8.22a6-py3-none-any.whl
.
File metadata
- Download URL: cogent3_ete3-2024.8.22a6-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 077498ada241d88d8a62a94378bb0d97eaeb6a321dc051db7dbe8b5c2a74e7f9 |
|
MD5 | 47278fdec4440e679120994a5b81ee14 |
|
BLAKE2b-256 | 951923e28836d814c2db8329435a983f8a0be1c6eb98163e4a18ad35a47ebaac |