Metadata-Version: 2.4
Name: cogent3-ete3
Version: 2025.7.3
Summary: cogent3 plugin for ete3
Keywords: biology,genomics,statistics,phylogeny,evolution,bioinformatics
Author-email: Yapeng Lang <u7181074@anu.edu.au>
Requires-Python: >=3.11,<3.14
Description-Content-Type: text/markdown
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
License-File: LICENSE
Requires-Dist: cogent3>=2025.5.8a8
Requires-Dist: ete3
Requires-Dist: six
Requires-Dist: PyQt5
Requires-Dist: standard-cgi
Requires-Dist: black ; extra == "dev"
Requires-Dist: click ; extra == "dev"
Requires-Dist: docformatter ; extra == "dev"
Requires-Dist: flit ; extra == "dev"
Requires-Dist: isort ; extra == "dev"
Requires-Dist: pytest ; extra == "dev"
Requires-Dist: pytest-cov ; extra == "dev"
Requires-Dist: pytest-xdist ; extra == "dev"
Requires-Dist: nox ; extra == "dev"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Requires-Dist: pytest-xdist ; extra == "test"
Requires-Dist: nox ; extra == "test"
Project-URL: Bug Tracker, https://github.com/YapengLang/cogent3-ete3/issues
Project-URL: Source Code, https://github.com/YapengLang/cogent3-ete3
Provides-Extra: dev
Provides-Extra: test

# A plugin for converting a [cogent3](https://cogent3.org/) tree to [ete3](http://etetoolkit.org/) tree object 
[![Coverage Status](https://coveralls.io/repos/github/YapengLang/cogent3-ete3/badge.svg?branch=main)](https://coveralls.io/github/YapengLang/cogent3-ete3?branch=main)
[![Release](https://github.com/YapengLang/cogent3-ete3/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/YapengLang/cogent3-ete3/actions/workflows/release.yml)

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:

<img src="https://figshare.com/ndownloader/files/55664936" alt="tree1" width="450" />

