Skip to main content

cogent3 plugin for ete3

Project description

Coverage Status

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:

Tree Plot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cogent3_ete3-2024.8.22a5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

cogent3_ete3-2024.8.22a5-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file cogent3_ete3-2024.8.22a5.tar.gz.

File metadata

  • Download URL: cogent3_ete3-2024.8.22a5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for cogent3_ete3-2024.8.22a5.tar.gz
Algorithm Hash digest
SHA256 87983c14dbc7e397c13a333d0e5e46cbc39bb678bd5ff81fa93f191c0f59c3aa
MD5 90aae9f3ca77d9c40abdd2498fa50dae
BLAKE2b-256 003c1597362fe8949ed1af35120b81709afc242f6463c44573d71a6befcc5e12

See more details on using hashes here.

File details

Details for the file cogent3_ete3-2024.8.22a5-py3-none-any.whl.

File metadata

File hashes

Hashes for cogent3_ete3-2024.8.22a5-py3-none-any.whl
Algorithm Hash digest
SHA256 873eea6a2225d69e4f51518ea84c5e19717354bc8b29efd6b050767fba863217
MD5 0ed7e9696729926ccf0653c9916bec0c
BLAKE2b-256 19c600256f4f12bf5807223fad92785200ba6694eb3a0c3db22cb3bae1b5edbf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page