Skip to content

Commit

Permalink
test link fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eaton-lab committed May 14, 2024
1 parent eb782d2 commit 8dd6947
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ icon: material/table-edit
# Welcome to toytree

Welcome to **toytree**, a Python library for tree visualization, manipulation,
and numerical and evolutionary analyses.
and numerical and evolutionary analyses. If you are new to toytree, head to
the [User Guide](/toytree/quick_guide/) to see examples and learn about its features.

## History
`toytree` is an object-oriented library built to meet the desire for a framework
Expand Down
6 changes: 3 additions & 3 deletions docs/parse_trees.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
"metadata": {},
"source": [
"### Internal labels as support\n",
"In contrast to the example above, you can see that the internal labels here are numeric and have thus been stored as \"support\" features instead of \"name\", and the internal nodes have names set to the default empty strings. This is the typical format of a Newick string generated by phylogenetic inference software, usually representing some kind of support values. Note that tip nodes/edges do not have support values, nor does the root edge. Support values are actually features of edges, not nodes. This is important for how they are re-oriented when trees are re-rooted (see [Edge Features](edge-features))."
"In contrast to the example above, you can see that the internal labels here are numeric and have thus been stored as \"support\" features instead of \"name\", and the internal nodes have names set to the default empty strings. This is the typical format of a Newick string generated by phylogenetic inference software, usually representing some kind of support values. Note that tip nodes/edges do not have support values, nor does the root edge. Support values are actually features of edges, not nodes. This is important for how they are re-oriented when trees are re-rooted (see [Edge Features](/toytree/edge-features))."
]
},
{
Expand Down Expand Up @@ -581,7 +581,7 @@
"\n",
"The `toytree.tree()` function will automatically detect if square brackets are present in a Newick string and parse the associated metadata. It is important to note that different programs sometimes vary in the way that they store data inside of the square brackets, and so `toytree.tree` takes a number of additional optional arguments that can be entered to properly parse the NHX metadata. Below are some examples.\n",
"\n",
"Finally, NHX format has the advantage over Newick in that it can distinguish between data that is assigned to Nodes versus Edges in a tree. Data on edges, such as support values, are treated differently than data on nodes, such as trait values, when re-rooting trees (See [Data/Features](Data/Features) for more on this)."
"Finally, NHX format has the advantage over Newick in that it can distinguish between data that is assigned to Nodes versus Edges in a tree. Data on edges, such as support values, are treated differently than data on nodes, such as trait values, when re-rooting trees (See [Data/Features](/toytree/data) for more on this)."
]
},
{
Expand Down Expand Up @@ -981,7 +981,7 @@
"metadata": {},
"source": [
"## Parsing MultiTrees\n",
"Sometimes data from multiple trees are stored together in a single file, such as the results of a bootstrap analysis, or a posterior distribution of trees from a Bayesian phylogenetic inference. `toytree` can parse and load all trees in a multiple tree input using the `toytree.mtree` function. This returns a `MultiTree` object (see [MultiTree](MultiTree)), which has methods that can apply to sets of trees, and from which individual `ToyTrees` can be indexed and extracted. "
"Sometimes data from multiple trees are stored together in a single file, such as the results of a bootstrap analysis, or a posterior distribution of trees from a Bayesian phylogenetic inference. `toytree` can parse and load all trees in a multiple tree input using the `toytree.mtree` function. This returns a `MultiTree` object (see [MultiTree](/toytree/multitree)), which has methods that can apply to sets of trees, and from which individual `ToyTrees` can be indexed and extracted. "
]
},
{
Expand Down
20 changes: 10 additions & 10 deletions docs/quick_guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
"metadata": {},
"source": [
"## A simple example\n",
"The code block below contains three lines of code to parse a tree object from data, modify it, and generate a tree drawing, respectively. This simple operation demonstrates several key features of `toytree` functionality and design. The first line uses the method `toytree.tree` (see [Tree Parsing (i/o)](/parse_trees/)) to parse tree data (in this case from a public URL) into a `ToyTree` class object, and store it to the variable name *tree*. \n",
"The code block below contains three lines of code to parse a tree object from data, modify it, and generate a tree drawing, respectively. This simple operation demonstrates several key features of `toytree` functionality and design. The first line uses the method `toytree.tree` (see [Tree Parsing (i/o)](/toytree/parse_trees/)) to parse tree data (in this case from a public URL) into a `ToyTree` class object, and store it to the variable name *tree*. \n",
"\n",
"The next line of code calls a method of the `ToyTree` object to root the tree on a specified edge. The `ToyTree` class object is the main class for representing trees in `toytree` and has many methods associated with it. In this case, we enter \"~prz\" as an argument to `.root()`, which is interpreted as a regular expression to match any names on the tree containing \"prz\" (See [Node/Name Query](/query/)), as a convenient method to select an internal edge on which to root the tree.\n",
"The next line of code calls a method of the `ToyTree` object to root the tree on a specified edge. The `ToyTree` class object is the main class for representing trees in `toytree` and has many methods associated with it. In this case, we enter \"~prz\" as an argument to `.root()`, which is interpreted as a regular expression to match any names on the tree containing \"prz\" (See [Node/Name Query](/toytree/query/)), as a convenient method to select an internal edge on which to root the tree.\n",
"\n",
"Finally, the last code line calls the `.draw()` method of the `ToyTree` to generate a tree drawing (See [Tree Drawing](/drawing-basics)). The drawing is automatically displayed in the notebook output cell, and can be optionally stored as a variable and further modified, or saved to disk in a variety of formats. We provide arguments to align the tip names and show markers at the nodes with interactive tooltip information (try it by hovering your cursor over the nodes)."
"Finally, the last code line calls the `.draw()` method of the `ToyTree` to generate a tree drawing (See [Tree Drawing](/toytree/drawing-basics)). The drawing is automatically displayed in the notebook output cell, and can be optionally stored as a variable and further modified, or saved to disk in a variety of formats. We provide arguments to align the tip names and show markers at the nodes with interactive tooltip information (try it by hovering your cursor over the nodes)."
]
},
{
Expand Down Expand Up @@ -288,7 +288,7 @@
"id": "d38cb571-6373-4042-bded-54a4f2abfc65",
"metadata": {},
"source": [
"The data that make up a tree can be easily accessed in a number of ways, including during tree visualization. Here a number of options are provided to the `.draw()` function to style the drawing. The \"node_labels\" option is set to \"idx\", which matches one of the features in the tree data, and so the data (numeric labels) are mapped to the appropriate nodes in the tree. Similarly, the \"edge_colors\" option is set to \"dist\" which automatically applies a colormapping to values of the \"dist\" data in the tree. This approach of assigning data to Nodes of the tree and then mapping these values to a drawing is more secure than trying to correctly order and enter values as a list. See [Data/Features](/data/) for more details."
"The data that make up a tree can be easily accessed in a number of ways, including during tree visualization. Here a number of options are provided to the `.draw()` function to style the drawing. The \"node_labels\" option is set to \"idx\", which matches one of the features in the tree data, and so the data (numeric labels) are mapped to the appropriate nodes in the tree. Similarly, the \"edge_colors\" option is set to \"dist\" which automatically applies a colormapping to values of the \"dist\" data in the tree. This approach of assigning data to Nodes of the tree and then mapping these values to a drawing is more secure than trying to correctly order and enter values as a list. See [Data/Features](/toytree/data/) for more details."
]
},
{
Expand Down Expand Up @@ -437,15 +437,15 @@
"source": [
"## Class objects\n",
"\n",
"The main Class objects in `toytree` are structured as a nested hierarchy. At the lowest level are [`toytree.Node`](/node/) class objects. A collection of connected `Nodes` form the data for a [`toytree.ToyTree`](/tree/) class object. This is the primary class in `toytree`. In addition, a collection of trees can form the data of a higher-level class object, called a [`toytree.MultiTree`](/multitree/). Each object type contains attributes and methods that are designed for its specific place in the hierarchy. For example, nodes contain attributes and methods for extracting information about a specific `Node` and its connections (edges) to other nodes. A `ToyTree` contains attributes and methods for extracting information about an entire tree of connected nodes, including emergent properties of these collections, and methods for operating on them. Finally, a `MultiTree` contains attributes and methods for operating on collections of trees, such as consensus tree inference and methods for drawing multiple trees together."
"The main Class objects in `toytree` are structured as a nested hierarchy. At the lowest level are [`toytree.Node`](/toytree/node/) class objects. A collection of connected `Nodes` form the data for a [`toytree.ToyTree`](/toytree/tree/) class object. This is the primary class in `toytree`. In addition, a collection of trees can form the data of a higher-level class object, called a [`toytree.MultiTree`](/toytree/multitree/). Each object type contains attributes and methods that are designed for its specific place in the hierarchy. For example, nodes contain attributes and methods for extracting information about a specific `Node` and its connections (edges) to other nodes. A `ToyTree` contains attributes and methods for extracting information about an entire tree of connected nodes, including emergent properties of these collections, and methods for operating on them. Finally, a `MultiTree` contains attributes and methods for operating on collections of trees, such as consensus tree inference and methods for drawing multiple trees together."
]
},
{
"cell_type": "markdown",
"id": "d6220f09-05c5-436c-816f-6869f816d6fd",
"metadata": {},
"source": [
"**Node**: See the [Node class](/node/) documentation. Users primarily interact with Node objects by selecting them from a tree through indexing, slicing, or traversal methods. Nodes are used to store the basic data that makes up a tree, such as the connections between nodes and their distances. In addition, nodes can be used to store any additional arbitrary data. Each `Node` in a `ToyTree` has a unique ID assigned to it referred to as its `idx` label, and which represents its order in a tip-to-root traversal of the tree (see [Traversal and Node selection](/traversal/)). "
"**Node**: See the [Node class](/toytree/node/) documentation. Users primarily interact with Node objects by selecting them from a tree through indexing, slicing, or traversal methods. Nodes are used to store the basic data that makes up a tree, such as the connections between nodes and their distances. In addition, nodes can be used to store any additional arbitrary data. Each `Node` in a `ToyTree` has a unique ID assigned to it referred to as its `idx` label, and which represents its order in a tip-to-root traversal of the tree (see [Traversal and Node selection](/toytree/traversal/)). "
]
},
{
Expand Down Expand Up @@ -585,7 +585,7 @@
"id": "b25ed489-b69a-4342-bd42-222923771cfb",
"metadata": {},
"source": [
"**ToyTree**: See the [ToyTree class](/tree/) documentation. A `ToyTree` stores a cached representation of the connections among a set of `Node` objects in memory and contains numerous methods for operating on these data. As we saw above, `ToyTree` class objects are usually created by parsing tree data from newick strings. However, a `ToyTree` can also be created by passing a `Node` object as the root of a new tree, as shown below. This makes clear that a `ToyTree` is a container for `Node` objects. They also contain functions for modifying the connections and data of nodes such as rooting trees, pruning, grafting, modifying edge lengths or support values, and storing new data, to name a few. If an operation changes the tree structure the `ToyTree` will automatically store a new cached representation of the tree traversal, assigning new `idx` labels to nodes. This allows for very fast retrieval of information from nodes, and to store cached tree attributes that are emergent properties of the collection of tree, such as node heights, and the number of tips and nodes. "
"**ToyTree**: See the [ToyTree class](/toytree/tree/) documentation. A `ToyTree` stores a cached representation of the connections among a set of `Node` objects in memory and contains numerous methods for operating on these data. As we saw above, `ToyTree` class objects are usually created by parsing tree data from newick strings. However, a `ToyTree` can also be created by passing a `Node` object as the root of a new tree, as shown below. This makes clear that a `ToyTree` is a container for `Node` objects. They also contain functions for modifying the connections and data of nodes such as rooting trees, pruning, grafting, modifying edge lengths or support values, and storing new data, to name a few. If an operation changes the tree structure the `ToyTree` will automatically store a new cached representation of the tree traversal, assigning new `idx` labels to nodes. This allows for very fast retrieval of information from nodes, and to store cached tree attributes that are emergent properties of the collection of tree, such as node heights, and the number of tips and nodes. "
]
},
{
Expand Down Expand Up @@ -760,7 +760,7 @@
"id": "8fde00ac-5122-43b9-bf9b-feaa1339b649",
"metadata": {},
"source": [
"**MultiTree**: See the [MultiTree](/multitree/) documentation. A `MultiTree` object is a container type for multiple `ToyTree` objects. It has a number of attributes and methods specific to operating on and visualizing sets of trees. The `toytree.mtree()` function can be used to parse multiple input types similar to the `toytree.tree()` method for parsing trees from data for individual trees. Also, `toytree.MultiTree()` can accept a collection of `ToyTree` objects as input, demonstrating that multitrees are collections of trees. "
"**MultiTree**: See the [MultiTree](/toytree/multitree/) documentation. A `MultiTree` object is a container type for multiple `ToyTree` objects. It has a number of attributes and methods specific to operating on and visualizing sets of trees. The `toytree.mtree()` function can be used to parse multiple input types similar to the `toytree.tree()` method for parsing trees from data for individual trees. Also, `toytree.MultiTree()` can accept a collection of `ToyTree` objects as input, demonstrating that multitrees are collections of trees. "
]
},
{
Expand Down Expand Up @@ -976,7 +976,7 @@
"## Selecting nodes\n",
"Many methods in `toytree` require selecting one or more nodes from a tree to operate on. This can often be challenging since most nodes in a tree usually do not have unique names assigned to them, and selecting nodes by a numeric indexing method can be error-prone if the indices change. We have tried to design the node query and selection methods in toytree to be maximally flexible to allow for ease-of-use when selecting nodes while also trying to prevent users from making simple and common mistakes.\n",
"\n",
"The `get_nodes` and `get_mrca_node` methods of `ToyTree` objects provide a flexible approach to selecting one or more nodes either by name or by their unique integer indices. See the [Node Query/Selection](/query/) documentation section for details."
"The `get_nodes` and `get_mrca_node` methods of `ToyTree` objects provide a flexible approach to selecting one or more nodes either by name or by their unique integer indices. See the [Node Query/Selection](/toytree/query/) documentation section for details."
]
},
{
Expand Down Expand Up @@ -2039,7 +2039,7 @@
"metadata": {},
"source": [
"## Tree drawings\n",
"When you call `.draw()` on a tree it returns three objects, a Canvas, Cartesian, and Mark. This follows the design principle of the [toyplot](toyplot.rtfd.io) plotting library that `toytree` uses as its default plotting backend. The Canvas describes the dimensions of the plot space, the Cartesian coordinates define how to project points onto that space, and a Mark represents plotted data. One Canvas can have multiple Cartesian coordinates, and each Cartesian object can have multiple Marks. After a plot is generated, each of these objects can be interacted with to set additional styling to axes, ticks, font sizes, etc. The three returned objects can be seen in the output field of the cell below."
"When you call `.draw()` on a tree it returns three objects, a Canvas, Cartesian, and Mark. This follows the design principle of the [toyplot](https://toyplot.rtfd.io) plotting library that `toytree` uses as its default plotting backend. The Canvas describes the dimensions of the plot space, the Cartesian coordinates define how to project points onto that space, and a Mark represents plotted data. One Canvas can have multiple Cartesian coordinates, and each Cartesian object can have multiple Marks. After a plot is generated, each of these objects can be interacted with to set additional styling to axes, ticks, font sizes, etc. The three returned objects can be seen in the output field of the cell below."
]
},
{
Expand Down

0 comments on commit 8dd6947

Please sign in to comment.