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.22a3.tar.gz (85.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cogent3_ete3-2024.8.22a3.tar.gz
  • Upload date:
  • Size: 85.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for cogent3_ete3-2024.8.22a3.tar.gz
Algorithm Hash digest
SHA256 6a1d196a20423f505e1713f5879cf2081d18868ddf7d5765d4e4488b75bf8af5
MD5 dff605215e9379d2cb2e17ac4b72d771
BLAKE2b-256 fb4d8905433f6bb00fd802de0c43ef40fb3532fca8b66dffb1475436f8442e70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogent3_ete3-2024.8.22a3-py3-none-any.whl
Algorithm Hash digest
SHA256 425b3563dd503a7724bca1e4918de2ba040f24a4527e16416763fde96f85c6d3
MD5 3107acfa3c4235ba1da85f42522f6bb2
BLAKE2b-256 18403bdd633a95ac5f23bba180bd448b4c9641be8efffe21fa4a4be9213a88c8

See more details on using hashes here.

Supported by

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