Skip to content

Subtree visualization

andrewxhill edited this page Dec 14, 2010 · 4 revisions

At times, trees will just be too large for display in the browser, or you may only be interested in displaying a small portion of a larger tree. For example,the NCBI Molluska taxonomy tree, available at http://phyloxml.org has close to 9000 nodes. PhyloBox provides a few different ways for displaying only smaller portions of this tree in both our UI and in widgets.

Methods

Subtrees can be generated using one of two methods.

  1. Using the /api/lookup/byAnnotation method, you can query a tree for a particular node based on some property of that node. You must first provide byAnnotation with a “k={yourtreekey}. Next byAnnotation accepts three parameters: category, name, and value. An example from the NCBI Mollusk tree, ”category=taxonomy&name=scientific_name&value=opisthoteuthidae“.

  2. PhyloBox assigns every node a unique ID. These IDs are available in the JSON object and through the UI. A query can be performed directly on an internal node ID to create a subtree that uses the provided ID as the deepest ancestor of the tree.

*Subtrees in Widgets*

The same functionality can be achieved using the widget, by providing two new parameters in your options object,

 method: 'byAnnotation',
 params: { category:'taxonomy', name:'scientific_name', value:'opisthoteuthidae' }
 method: 'subTree',
 params: { rootid: 7543 }

You can see an example, Subtree widget

If the tree is published as a wiki (i.e. allows anyone to add annotations and comments) and you enable annotations/commenting in your widget, those annotations will be stored on the full tree, available to anyone using that tree elsewhere.