| Bioinformatics Toolbox | ![]() |
Remove branch nodes from phylogenetic tree
T2 = prune(T1, Nodes)
T2 = prune(T1, Nodes, 'Mode','Exclusive')
| T1 | Phylogenetic tree object. See phytree (phytree). |
| Nodes | Nodes to remove from tree. |
Mode | Property to control the method of pruning. Enter either 'Inclusive' or 'Exclusive'. The default value is 'Inclusive'. |
T2 = prune(T1, Nodes)removes the nodes listed in the vector Nodes from the tree T1. prune removes any branch or leaf node listed in Nodes and all their descendants from the tree T1, and returns the modified tree T2. The parent nodes are connected to the 'brothers' as required. Nodes in the tree are labeled as [1:numLeaves] for the leaves and as [numLeaves+1:numLeaves+numBranches] for the branches. Nodes can also be a logical array of size [numLeaves+numBranches x 1] indicating the nodes to be removed.
T2 = prune(T1, Nodes, 'Mode','Exclusive')changes the property (Mode) for pruning to 'Exclusive' and removes only the descendants of the nodes listed in the vector Nodes. Nodes that do not have a predecessor become leaves in the list Nodes. In this case, pruning is the process of reducing a tree by turning some branch nodes into leaf nodes, and removing the leaf nodes under the original branch.
Load a phylogenetic tree created from a protein family
tr = phytreeread('pf00002.tree');
view(tr)
% To :
Remove all the 'mouse' proteins use
ind = getbyname(tr,'mouse'); tr = prune(tr,ind); view(tr)
Remove potential outliers in the tree
[sel,sel_leaves] = select(tr,'criteria','distance',...
'threshold',.3,...
'reference','leaves',...
'exclude','leaves',...
'propagate','toleaves');
tr = prune(tr,~sel_leaves)
view(tr)
Bioinformatics Toolbox function phytree (phytree)
| proteinplot | quantilenorm | ![]() |
© 1994-2005 The MathWorks, Inc.