From cbdb931660719f6729455750e01aca261da89de3 Mon Sep 17 00:00:00 2001 From: Deren Date: Tue, 14 May 2024 10:22:12 -0400 Subject: [PATCH] docs update --- docs/FAQs.md | 52 +++++ docs/command-line.md | 99 +++++++++ docs/drawing-basics.ipynb | 455 +++++++++++++++++++++++++++++++------- docs/gallery.md | 7 + docs/rooting.ipynb | 81 +++---- 5 files changed, 581 insertions(+), 113 deletions(-) create mode 100644 docs/FAQs.md create mode 100644 docs/command-line.md create mode 100644 docs/gallery.md diff --git a/docs/FAQs.md b/docs/FAQs.md new file mode 100644 index 00000000..84426395 --- /dev/null +++ b/docs/FAQs.md @@ -0,0 +1,52 @@ +--- +section: FAQs +icon: material/question +--- + +# Frequently Asked Questions + + +### How do I get help? +The first place to look for help or answers is in here in the documentation. +You can use the search bar in the navigation to search for terms or function +names. The next place is in the source documentation strings. Some of the +source code is available here in the docs, but the rest can be accessed +in an interactive environment (e.g., jupyter) by executing a function name +followed by one or two question marks. The docstrings often contain detailed +descriptions of parameters and example usage. Finally, you can seek further +help or advice by raising an Issue on GitHub. To do this, navigate to +https://github.com/eaton-lab/toytree/issues and click the green New Issue +button in the upper right. Then click on Labels on the right to select +"help wanted" or "question" as the category for your issue. + + +### How do I report bug? +If you believe you have encountered a bug in toytree please let us know by +raising an Issue on GitHub. To do this, navigate to +https://github.com/eaton-lab/toytree/issues and click the green New Issue +button in the upper right. Then click on Labels on the right to select +"bug". + + +### How can I request a new feature +We are happy to implement new useful methods in toytree that will help to +grow its userbase. To request the implementation of a new method please do so +by raising an Issue on GitHub. To do this, navigate to +https://github.com/eaton-lab/toytree/issues and click the green New Issue +button in the upper right. Then click on Labels on the right to select +"enhancement". + + +### How can I contribute to toytree +We welcome contributors! If you are interested in contributing to toytree +please first read our contributor's guide. This describes a shared framework +and style to ensure a cohesive coding style throughout the source code. Then, +you can raise an Issue on GitHub to indicate the project you are working on. +This way, you can find if others are already working on the method, or find +additional contributors for help. To do this, navigate to +https://github.com/eaton-lab/toytree/issues and click the green New Issue +button in the upper right. Then click on Labels on the right to select +"enhancement", and under Assignees, assign your self. + + + \ No newline at end of file diff --git a/docs/command-line.md b/docs/command-line.md new file mode 100644 index 00000000..e46a13c4 --- /dev/null +++ b/docs/command-line.md @@ -0,0 +1,99 @@ +# Command line + + +## `toytree` cli +Sometimes you might not be in the mood to open a jupyter notebook just to take a quick peek at a tree, in which case, the toytree command line interface (cli) provides a convenient alternative. This tool can be called from a terminal shell to execute one or more simple commands to accomplish tasks such as creating tree drawings, rooting trees, and comparing trees. + +## Subcommands +Currently three subcommands are supported in the cli: draw, root, and distance. (Please reach out and let us know if you would like to see additional toytree methods implemented in the cli.) Call the help command (-h) to see the available subcommands. + +```bash +$ toytree -h +``` + +This will bring up a help statement like below. Each subcommand also has its own help page that describes its usage and options, as demonstrated below. + +```bash +usage: toytree [-h] [-v] {draw,root,distance} ... + +toytree command line tool. Select a subcommand. + +positional arguments: + {draw,root,distance} sub-commands + draw create tree drawing + root (re)root tree and return to STDOUT + distance compute distance between trees + +options: + -h, --help show this help message and exit + -v, --version show program's version number and exit + +EXAMPLE: $ toytree draw TREE -ts o -d 400 400 -v +``` + +## toytree draw + +```bash +$ toytree draw -h +``` + +```bash +usage: toytree draw [-h] [-ts treestyle] [-d dim dim] [-o basename] [-v [app]] + [-f {html,svg,pdf}] + TREE + +positional arguments: + TREE tree newick file or string + +options: + -h, --help show this help message and exit + -ts treestyle tree style (default: n) + -d dim dim width height (px) (default: (None, None)) + -o basename output basename[.format suffix] (default: /tmp/test) + -v [app] open file with default browser or app. (default: None) + -f {html,svg,pdf} output file format (default: html) +``` + +## toytree root + +```bash +$ toytree root -h +``` + +```bash +usage: toytree root [-h] [-o O [O ...]] [-r] TREE + +positional arguments: + TREE tree newick file or string + +options: + -h, --help show this help message and exit + -o O [O ...] outgroup + -r use regex matching on outgroup string. +``` + +## toytree distance + +```bash +$ toytree distance -h +``` + +```bash +usage: toytree distance [-h] [-m {rf,rfi,rfj,qrt}] [-n] TREE1 TREE2 + +positional arguments: + TREE1 tree1 newick file or string + TREE2 tree2 newick file or string + +options: + -h, --help show this help message and exit + -m {rf,rfi,rfj,qrt} distance metric method + -n, --normalize normalize value between [0-1] +``` + +## chaining +To indicate to the draw function that the NEWICk input is the STDOUT from the previous command, use the `-` character like below. + +```bash +toytree root NEWICK | toytree draw - ... +``` diff --git a/docs/drawing-basics.ipynb b/docs/drawing-basics.ipynb index ea7807fc..e0087b22 100644 --- a/docs/drawing-basics.ipynb +++ b/docs/drawing-basics.ipynb @@ -6,13 +6,12 @@ "metadata": {}, "source": [ "# Tree Drawing basics\n", - "\n", - "One of the primary functions of `toytree` is for tree visualization. See the [Quick Guide](/quick_guide) to get started on loading or creating a `ToyTree` class object. Once you have a tree, there are many options in `toytree` for generating a tree visualization. Following our minimalist ethos, it is very simple to generate a tree drawing under a variety of styles using a single command, while at the same time, it is also possible to provide many arguments to designate a very specific and complex style to create data rich visualizations. " + "Tree visualization is a fundamental feature of `toytree`. Following our minimalist ethos, it is possible to generate a beautiful tree drawing very easily. But in addition, it is also possible to create complex and data rich visualizations using a variety of styling options." ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 27, "id": "b61b38c8-29f1-4943-81ee-7e647d2dbcc7", "metadata": {}, "outputs": [], @@ -32,31 +31,31 @@ "## Drawing class objects\n", "When you call `.draw()` on a tree it returns three objects, a `Canvas`, a `Cartesian` axes, and a `Mark`. This follows the design principle of the `toyplot` plotting library on which toytree is based. The `Canvas` describes the plot space, and the `Cartesian` coordinates define how to project `Marks` onto that space. `Marks` are used to represent data using SVG markers and shapes. One canvas can have multiple cartesian coordinates, and each cartesian axes can contain multiple marks.\n", "\n", - "It is often useful to capture these drawing objects as variables so that they can be reused to further edit or annotate drawings, and to eventually save tree drawings. However, if you are working in a jupyter notebook and only intend the drawings to be saved in the output cells, then you do not need to save the plots externally. Canvas objects will automatically render drawings in the output below a code block. This behavior can be suppressed by modifying the `.autorender` setting of a canvas. Throughout this documentation you will see many `toytree` drawing commands end with a semicolon (;), which is a simple method to hide the returned objects from being displayed in the output cell." + "It is often useful to capture these drawing objects as variables so that they can be reused to further edit or annotate drawings, and to save them. However, if you are working in a jupyter notebook and only intend the drawings to be embedded in the output cells, then you do not need to save the plots externally. Canvas objects automatically render in output cells when they are created (this option can be toggled in [Global config](#Global-config).)" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 28, "id": "d542dc63-e985-4188-a6ef-09f0ce055486", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(,\n", - " ,\n", - " )" + "(,\n", + " ,\n", + " )" ] }, - "execution_count": 2, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -71,16 +70,24 @@ "tree.draw()" ] }, + { + "cell_type": "markdown", + "id": "37f26c09-da17-4263-81b2-977de2443f90", + "metadata": {}, + "source": [ + "Throughout this documentation you will see many `toytree` drawing commands end with a semicolon (;), which is a simple method to hide the returned objects from being displayed in the output cell." + ] + }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 29, "id": "a255a060-b2ec-453c-838a-e49dd8c8145d", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -97,14 +104,14 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 30, "id": "ad38facd-2a0a-4131-bec2-a76068927965", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -119,37 +126,25 @@ "canvas, axes, mark = tree.draw()" ] }, - { - "cell_type": "code", - "execution_count": 5, - "id": "b38e86db-9ce9-4d5f-9390-1503bcb4d39c", - "metadata": {}, - "outputs": [], - "source": [ - "# store the drawing objects and suppress autorendering in notebook\n", - "canvas, axes, mark = tree.draw();\n", - "canvas.autorender(enable=False)" - ] - }, { "cell_type": "markdown", "id": "10a22b10-dd5d-4e30-96e8-9cc14895703d", "metadata": {}, "source": [ "## Builtin Tree Styles\n", - "There are innumerous ways in which to style ToyTree drawings. We provide a number of pre-built tree_styles (normal, dark, coalescent, multitree), but users can also create their own style dictionaries that can be easily reused. Below are some examples. You can use tab-completion within the draw function to see the docstring for more details on available arguments to toggle, or you can see the many style arguments associated with ToyTrees by accessing their `.style` dictionary. See the Styling chapter for more details." + "There are innumerous ways to style ToyTree drawings by combining different arguments to the `.draw` function. As a convenience, we also provide a number of pre-built tree styles that represent collections of style arguments that can be set using a single command." ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 85, "id": "7d9e8460-2b00-4a27-8779-10e8746765a6", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -161,7 +156,128 @@ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
1-14-23-21-20r0r1r2r3r4r5
" @@ -173,10 +289,10 @@ { "data": { "text/html": [ - "
r0r1r2r3r4r500.511.5
" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
r0r1r2r3r4r5
" ] }, @@ -294,7 +422,7 @@ { "data": { "text/html": [ - "
1-14-23-21-20r0r1r2r3r4r5
" @@ -306,10 +434,12 @@ ], "source": [ "# drawing with pre-built tree_styles\n", - "tree.draw(tree_style='d'); # dark-style\n", - "tree.draw(tree_style='o'); # umlaut-style\n", + "tree.draw(tree_style='s'); # simple-style\n", "tree.draw(tree_style='c'); # coalescent-style\n", - "tree.draw(tree_style='r'); # R-style" + "tree.draw(tree_style='r'); # R-style\n", + "tree.draw(tree_style='p'); # population-style\n", + "tree.draw(tree_style='d'); # dark-style\n", + "tree.draw(tree_style='o'); # umlaut-style" ] }, { @@ -322,14 +452,14 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 38, "id": "8ec6fe6d-e54c-4f9f-a4a5-95a78e6b687b", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -350,26 +480,26 @@ "id": "6fd06988-1ab6-4b0f-9cd4-3816a62a89be", "metadata": {}, "source": [ - "## Tree Style Options\n", + "## Creating Tree Styles\n", "There are a number of ways to apply individual styles to tree drawings. Which method you use may depend on whether you intend to reuse a particular tree style many times, or just once. The most common method is described below as the \"one-time\" setting, in which you enter style arguments to the `.draw()` function. You will see this used most common throughout this tutorial. However, it is also possible for users to create reusable styles similar to the builtin tree style types shown above. A final option is to modify style settings saved to the tree objects themselves. Each is demonstrated below.\n", "\n", - "### One-time settings\n", + "### One-time style setting\n", "Use tab-completion or other methods to examine the documentation string of the draw function to see the options available for styling tree drawings. " ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 39, "id": "adbe054f-0326-4faa-a1bc-47749e14d33b", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r51.510.50
" ] }, @@ -498,20 +628,20 @@ "id": "10ce68fc-0018-4e25-a07f-06d581bd3e1a", "metadata": {}, "source": [ - "### Reusable settings\n", + "### Reusable style dict\n", "You can create a custom reusable tree-style as a dictionary of key-value pairs specifying options to the draw function. To apply this to many tree drawings you can simply use variadics to expand the dictionary as a single argument to the draw function, as demonstrated below. " ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 13, "id": "dc5839e2-ca68-4b73-a602-0d1cbb59a252", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -550,20 +680,20 @@ "id": "8e98c5e1-dfa3-438f-ab11-84002ef83127", "metadata": {}, "source": [ - "### Persistent settings\n", - "Finally, you can modify the `.style` settings of a `ToyTree` object to modify its saved default drawing options. This can useful if you plan to visualize the same tree many times, or wish to save different trees with different style settings for easier comparison. This framework is also useful for learning which tree style options are available, since you can use tab-completion in an interactive environment like a jupyter notebook to explore the different setting options available. In this example, I first create a copy of our example tree object and save the new copy as *stree*. Then, I modify the the style settings of the *stree* object. Finally, we can simply call `.draw()` to draw the tree using its saved tree style. (Note that if you enter a new `tree_style` argument to the draw() function of this tree it will override the settings in the tree's `.style` settings.)" + "### Persistent style\n", + "Finally, you can modify the `.style` settings of a `ToyTree` object to modify its saved default drawing options. This can useful if you plan to visualize the same tree many times, or wish to save different trees with different style settings for easier comparison. For example, it can be used within a function to return a tree object that has a style setting saved to it which will highlight a particular feature or clade when visualized. This framework is also useful for learning which tree style options are available, since you can use tab-completion in an interactive environment to explore the different style options available. In this example, I first create a copy of our example tree object and save the new copy as *stree*. Then, I modify the the style settings of the *stree* object. Finally, we can simply call `.draw()` to draw the tree using its saved tree style. (Note that if you enter a new `tree_style` argument to the draw() function of this tree it will override the settings in the tree's `.style` settings.)" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 14, "id": "e5b10153-f4cf-40d2-af55-135e60208c26", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
012345678910r0r1r2r3r4r5
" @@ -602,34 +732,34 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 16, "id": "a6b9202b-1a2c-42f2-aed6-b6028145d547", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
idx: 6\n", + "
idx: 6\n", "dist: 0.596972495123\n", "support: nan\n", "height: 1.12630250437\n", - "tdiv: 0.596972495123\n", - "name: 1-16idx: 7\n", + "name: 1-1\n", + "tdiv: 0.5969724951236idx: 7\n", "dist: 0.0386582269365\n", "support: nan\n", "height: 0.177873309174\n", - "tdiv: 1.54540169032\n", - "name: 4-27idx: 8\n", + "name: 4-2\n", + "tdiv: 1.545401690327idx: 8\n", "dist: 0.783873618514\n", "support: nan\n", "height: 0.216531536111\n", - "tdiv: 1.50674346338\n", - "name: 3-28idx: 9\n", + "name: 3-2\n", + "tdiv: 1.506743463388idx: 9\n", "dist: 0.722869844869\n", "support: nan\n", "height: 1.00040515462\n", - "tdiv: 0.596972495123\n", - "name: 1-29r0r1r2r3r4r5
" @@ -664,14 +794,14 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 17, "id": "1ebdc961-c502-4730-9305-739f1f496d29", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -688,14 +818,37 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 82, + "id": "bcf584f6-4c1b-4784-860e-a95956f1f257", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
r0r1r2r3r4r5
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tree.draw(node_sizes=(\"height\", 5, 20));" + ] + }, + { + "cell_type": "code", + "execution_count": 77, "id": "b59ab36d-a16b-4d71-adac-e38538824df8", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
r0r1r2r3r4r5
" @@ -706,14 +859,15 @@ } ], "source": [ - "sizes = tree.get_node_data(\"height\")\n", "tree.draw(node_sizes=(\"height\",));" ] }, { "cell_type": "markdown", "id": "e53623a0-ab15-4941-9115-79fc15d864d6", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "### node_mask\n", "You will notice that the `node_sizes` argument shown above only adds node markers to the internal nodes. What if we want to choose which nodes to display markers on? In that case, you will want to use the `node_mask` argument. This accepts a boolean or array of boolean values to describe which nodes to show versus hide. There is a convenience function of tree objects named `get_node_mask` that can be used to generate a boolean mask in the correct order to designate a subset of nodes to show. Finally, there is a simplified tuple syntax that can be used to choose to display particular sets of nodes composing only the tips, only the internal nodes, or only the root. " @@ -942,14 +1096,6 @@ "tree.draw(node_sizes=15, node_markers=rects, node_labels=\"idx\");" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "d3047b5f-f68a-4111-829e-021292ce7354", - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": 58, @@ -1001,6 +1147,163 @@ "canvas, axes, mark = tree.draw();\n", "tree.annotate.add_node_markers(axes=axes, marker=\"s\", size=10, mask=mask);" ] + }, + { + "cell_type": "markdown", + "id": "8fbf2ece-54aa-4295-9a7d-df7bc033a8ae", + "metadata": {}, + "source": [ + "### node_colors\n", + "The fill color of nodes can be set in a variety of ways. The node_colors option can be used to set a single color to all nodes, or different colors to nodes. The colors can be entered manually, or they can be automatically projected from color map to data values. There is another option for setting a single color to all nodes, using node_style.fill. The node_colors argument overrides node_style.fill." + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "id": "86b278d9-fcf4-43a0-9c9f-0ccd380e7415", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
r0r1r2r3r4r5
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# set a single color to all nodes\n", + "tree.draw(node_colors='red', node_sizes=10);" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "id": "6d5d5c06-667f-40d6-865a-bfec6cf37944", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
r0r1r2r3r4r5
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# list of colors of length nnodes\n", + "colors = ['darkcyan'] * 6 + ['goldenrod'] * 5\n", + "tree.draw(node_colors=colors, node_sizes=10, node_mask=False);" + ] + }, + { + "cell_type": "markdown", + "id": "5fbca296-cf45-40db-b982-ce79f3f6f02e", + "metadata": {}, + "source": [ + "Automatically color nodes by projecting a data feature that is saved to tree object, such as the node heights, using [color-mapping](color-mapping)." + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "id": "125f2ea4-7430-410e-956c-7adb37833f59", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
r0r1r2r3r4r5
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# colormapping the 'height' feature\n", + "tree.draw(node_colors='height', node_sizes=10, node_mask=False);" + ] + }, + { + "cell_type": "markdown", + "id": "e9afc1b1-704a-401e-b073-b0bf7145539c", + "metadata": {}, + "source": [ + "## Global config\n", + "The default visualization settings in toytree are inherited from toyplot. This includes the default usage of html format for displaying plots in a notebook, and the default behavior of automatically rendering Canvas objects in a notebook cell when they are created. Both of these options can be changed in the `config` settings of the toyplot library." + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "5302184e-e2cf-413c-895a-0feb14986af1", + "metadata": {}, + "outputs": [], + "source": [ + "import toyplot\n", + "\n", + "# set config options to new settings\n", + "toyplot.config.autoformat = \"png\"\n", + "toyplot.config.autorender = False" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "b2cf2b32-4312-4398-a7ab-54ef9159f4c4", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAASwAAAETCAYAAACMUTsNAAAJMmlDQ1BkZWZhdWx0X3JnYi5pY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5bC8fR0A9/VuxEArcR7ut/P+a4IEZFp/OW4uLxy+SmCdACg7GXWzEpPWeGjy0wPj//CZ1dYsFzgMt9Y4eh/eexLzr8s+pLj681dfhUKABwp+hsO/4b/c++KVDiC9NioyGymT3JUelaYIJKZttIJHpfL9BQkR8UmRH5T8P+V/B2lR2anr0RucsomQWx0TDrzfw41MjA0BF9n8cbrS48hRv9/z2dFX73kegDYcwAg+7564ZUAdO4CQPrRV09tua+UfAA67vAzBJn/eqiVDQ0IgALoQAYoAlWgCXSBETADlsAWOAAX4AF8QRDYAPggBiQCAcgCuWAHKABFYB84CKpALWgATaAVnAad4Dy4Aq6D2+AuGAaPgRBMgpdABN6BBQiCsBAZokEykBKkDulARhAbsoYcIDfIGwqCQqFoKAnKgHKhnVARVApVQXVQE/QLdA66At2EBqGH0Dg0A/0NfYQRmATTYQVYA9aH2TAHdoV94fVwNJwK58D58F64Aq6HT8Id8BX4NjwMC+GX8BwCECLCQJQRXYSNcBEPJBiJQgTIVqQQKUfqkVakG+lD7iFCZBb5gMKgaCgmShdliXJG+aH4qFTUVlQxqgp1AtWB6kXdQ42jRKjPaDJaHq2DtkDz0IHoaHQWugBdjm5Et6OvoYfRk+h3GA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs/h/SolLUHptwa4AAAAASUVORK5CYII=", + "text/html": [ + "
r0r1r2r3r4r5
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# embed a PNG drawing in the notebook\n", + "canvas, axes, mark = tree.draw();\n", + "\n", + "# it will only display here b/c we return the Canvas\n", + "canvas" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "a766a4b7-8d37-4cad-ae0a-1efe6de6ce6e", + "metadata": {}, + "outputs": [], + "source": [ + "# set config options back to their defaults\n", + "toyplot.config.autoformat = \"html\"\n", + "toyplot.config.autorender = True" + ] } ], "metadata": { diff --git a/docs/gallery.md b/docs/gallery.md new file mode 100644 index 00000000..eb20026a --- /dev/null +++ b/docs/gallery.md @@ -0,0 +1,7 @@ +--- +section: FAQs +icon: material/portrait +--- + + +# Coming soon... \ No newline at end of file diff --git a/docs/rooting.ipynb b/docs/rooting.ipynb index 55312bf9..58ce3f5c 100644 --- a/docs/rooting.ipynb +++ b/docs/rooting.ipynb @@ -1312,35 +1312,12 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": null, "id": "21960b66-a6ae-4549-9c44-298f79348804", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
1001001009699100100100100100nan41954_cyathophylloides32082_przewalskii33588_przewalskii33413_thamno30556_thamno40578_rex35855_rex35236_rex39618_rex38362_rex29154_superba30686_cyathophylla41478_cyathophylloides
" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
100100100969910010010010010041954_cyathophylloides32082_przewalskii33588_przewalskii33413_thamno30556_thamno40578_rex35855_rex35236_rex39618_rex38362_rex29154_superba30686_cyathophylla41478_cyathophylloides
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "metadata": { + "scrolled": true + }, + "outputs": [], "source": [ "ctre = toytree.tree(\"https://eaton-lab.org/data/Cyathophora.tre\")\n", "ctre.draw(ts='r', node_labels=\"support\");\n", @@ -1353,14 +1330,14 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 56, "id": "d79c8afc-d429-4b1d-b592-5f14813bd856", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
2110033abc
" @@ -1371,19 +1348,49 @@ } ], "source": [ - "toytree.tree(\"((a[2],b[1])[3],c[100])[3];\", feature_prefix=None,).draw('r', node_mask=False, node_labels=\"label\");" + "toytree.tree(\"((a[2],b[1])[3],c[100])[4];\", feature_prefix=None,).draw('r', node_mask=False, node_labels=\"label\");" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 64, "id": "ac9283ed-ad60-4fff-941a-dbb8ff375e25", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
AmeHmaUthMurUarUmaUamTor
" @@ -1395,19 +1402,19 @@ ], "source": [ "toytree.tree(\"/home/deren/R/x86_64-pc-linux-gnu-library/4.2/phangorn/extdata/trees/RAxML_bipartitionsBranchLabels.AIs\", feature_prefix=None, \n", - " ).draw();" + " ).draw('r', node_labels=\"label\", node_hover=True);" ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 67, "id": "36dc9824-e288-4dbe-925f-88e113159554", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
AmeHmaMurUthUamUarUmaTor
" @@ -1418,7 +1425,7 @@ } ], "source": [ - "toytree.tree(\"/home/deren/R/x86_64-pc-linux-gnu-library/4.2/phangorn/extdata/trees/RAxML_bipartitions.3moles\").draw();" + "toytree.tree(\"/home/deren/R/x86_64-pc-linux-gnu-library/4.2/phangorn/extdata/trees/RAxML_bipartitions.3moles\").draw('s', node_labels=\"support\");" ] }, {