Skip to main content

tree manipulation, plotting, and evolutionary analysis library

Project description

Toytree

Tree plotting with Toytree in Python

Welcome to toytree, a Python library for tree object data parsing, visualization, manipulation, and numerical and evolutionary analyses. If you are new to toytree, head to the User Guide to see examples and learn about its features.

The goal of toytree is to provide a light-weight Python equivalent to widely used tree analysis and plotting libraries in R, and in doing so, to promote further development of phylogenetic and evolutionary analysis methods in Python.

Toytree generates rich interactive figures (SVG+HTML+JS) that render in jupyter-notebooks or webpages, and can be exported as high quality SVG, PDF, or PNG figures for publications. The library is minimal dependencies, is easy to install, and can be easily incorporated into other projects.

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 at http://eaton-lab.org/toytree.

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.11.tar.gz (367.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toytree-3.0.11-py3-none-any.whl (467.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toytree-3.0.11.tar.gz
  • Upload date:
  • Size: 367.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for toytree-3.0.11.tar.gz
Algorithm Hash digest
SHA256 a117c56676889be72bdd6ce572a0bee26a299c5234d6fb6bf89dbc29bb960c12
MD5 279518e99358308e4d1ceb6730796158
BLAKE2b-256 1cbc14dc4f31f376b3a1a6b9935a96f1e76dc5f4017ba9a1a71fa73ff1931c50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toytree-3.0.11-py3-none-any.whl
  • Upload date:
  • Size: 467.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for toytree-3.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 bc9857aedc54d7ed51bb0086330324815cfc8cb35c8c151cde720a6fc62410b3
MD5 30bc029157055fc33b4dcaafe23d1007
BLAKE2b-256 2297ae64477e109d790f61e7f73694659059ece5195ece835ff67defaed3964b

See more details on using hashes here.

Supported by

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