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.22a4.tar.gz
.
File metadata
- Download URL: cogent3_ete3-2024.8.22a4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3bea491d6ff1b826e2d8284b2b65b1de84bb84223e9a64d8f40cee62a08ba0c |
|
MD5 | 8ec11d9c7af2ae00d44cbdea6afe2756 |
|
BLAKE2b-256 | 47026ef1588904c30153a75b5b3e76bc8ae5ee381303d352867e3c6699bfc920 |
File details
Details for the file cogent3_ete3-2024.8.22a4-py3-none-any.whl
.
File metadata
- Download URL: cogent3_ete3-2024.8.22a4-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 769193f37e85fc9e03f99ac1d493d36155a258bafe855276310b7476668db088 |
|
MD5 | a1f83392164f47c2dde0696c28101f20 |
|
BLAKE2b-256 | 4558f38f4481e333e6fca036139ed974bda9a9999e902e3a9e543c6f6f33dcaa |