Skip to main content

minimalist tree plotting using toyplot

Project description

Join the chat at https://gitter.im/toytree-help/Lobby Install with conda https://travis-ci.org/eaton-lab/toytree.svg?branch=master

Tree plotting with Toytree

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.

Installation

You can install toytree and its dependencies (toyplot and numpy) with a single command using conda (preferred), or from pip.

conda install toytree -c eaton-lab

Documentation

See the full documentation to see all of the options that toytree provides. Try it out instantly in the cloud using the toytree binder.

Examples

# 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(wildcard='prz')
rtre.draw(width=400, tip_labels_align=True);

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

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

Project details


Download files

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

Files for toytree, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size toytree-0.2.0-py3-none-any.whl (83.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size toytree-0.2.0.tar.gz (108.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page