Skip to main content

tree manipulation, plotting, and evolutionary analysis library

Project description

Toytree

Tree plotting with Toytree in Python

Welcome to toytree, a minimalist tree manipulation and plotting library for use inside jupyter notebooks. Toytree combines a popular tree data structure based on the ete3 library with modern plotting tools based on the toyplot plotting library. The goal of toytree is to provide a light-weight Python equivalent to commonly used tree manipulation and plotting libraries in R, and in doing so, to promote further development of phylogenetic methods in Python. Toytree generates rich interactive figures (SVG+HTML+JS) that can be embedded in jupyter-notebooks or webpages, or rendered in SVG, PDF, or PNG for publications.

Current release info

Name Downloads Version Platforms
Conda Recipe Conda Downloads Conda Version Conda Platforms

Installing toytree

Toytree can be installed using conda or pip (conda preferred):

conda install toytree -c conda-forge

It is possible to list all of the versions of toytree available on your platform with:

conda search toytree --channel conda-forge

Documentation

See the full documentation to learn more about plotting options, analysis methods, and other features of toytree. You can try out toytree in the cloud before installing by visiting the toytree binder.

Example code

# import toyplot and load a newick file from a public URL
import toytree
tre = toytree.tree("https://eaton-lab.org/data/Cyathophora.tre")

# root the tree using a wildcard string matching and draw a tree figure.
rtre = tre.root('~prz')
rtre.draw(width=400, tip_labels_align=True);

# or chain a few functions together
tre.root('~prz').drop_tips("~tham").ladderize().draw();

# extensive styling options are available
rtre.draw(
    tip_labels_colors='pink',
    node_labels='support',
    node_sizes=15,
    node_colors="cyan",
    edge_style={
        "stroke": "darkgrey", 
        "stroke-width": 3,
    },
)

Example plots

./manuscript/ToyTree-figure.svg

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

toytree-3.0.6.tar.gz (323.0 kB view details)

Uploaded Source

Built Distribution

toytree-3.0.6-py3-none-any.whl (401.6 kB view details)

Uploaded Python 3

File details

Details for the file toytree-3.0.6.tar.gz.

File metadata

  • Download URL: toytree-3.0.6.tar.gz
  • Upload date:
  • Size: 323.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for toytree-3.0.6.tar.gz
Algorithm Hash digest
SHA256 505f6c678a672934556181458241c1acb4419f4e512812889eca8bea5b2d9559
MD5 abe0c03761f6982ffdb8eeeef42f1f3c
BLAKE2b-256 89ecc3a4d555b96b69dd976bfa43fbd2073f12501a3cc69aa04fd7f83bcef9ab

See more details on using hashes here.

File details

Details for the file toytree-3.0.6-py3-none-any.whl.

File metadata

  • Download URL: toytree-3.0.6-py3-none-any.whl
  • Upload date:
  • Size: 401.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for toytree-3.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9bfec00a55050bd2ea36fc9252a32322327a69a2de6e46390a928d1dc1a13094
MD5 9aed044e8796d54f1a9160c50d963b7a
BLAKE2b-256 7bdb081c0481bbc197c799ffb4c8bdeb72999176a66d1a29a35e71ec58cb1b1c

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