Skip to Main Content Skip to Search
Product Documentation

subtree (phytree) - Extract phylogenetic subtree

Syntax

Tree2 = subtree(Tree1, Nodes)

Description

Tree2 = subtree(Tree1, Nodes) extracts a new subtree (Tree2) where the new root is the first common ancestor of the Nodes vector from Tree1. Nodes in the tree are indexed as [1:NUMLEAVES] for the leaves and as [NUMLEAVES+1:NUMLEAVES+NUMBRANCHES] for the branches. Nodes can also be a logical array of following sizes [NUMLEAVES+NUMBRANCHES x 1], [NUMLEAVES x 1] or [NUMBRANCHES x 1].

Examples

  1. Load a phylogenetic tree created from a protein family.

    tr = phytreeread('pf00002.tree')
  2. Get the subtree that contains the VIPS and CGRR human proteins.

    sel = getbyname(tr,{'vips_human','cgrr_human'});
    sel = any(sel,2);
    tr =  subtree(tr,sel)
    view(tr);

See Also

get | getbyname | phytree | prune | select

How To

  


Free Computational Biology Interactive Kit

See how to analyze, visualize, and model biological data and systems using MathWorks products.

Get free kit

Trials Available

Try the latest computational biology products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS