Select tree branches and leaves in phytree object
S = select(
Phylogenetic tree (
Number of closest nodes to the root node.
Property to select a reference point for measuring distance.
Property to select a criteria for measuring distance.
Property to select a distance value. Nodes with distances below this value are selected.
|Property to remove (exclude) branch or leaf nodes from the
output. Enter |
|Property to select propagating nodes toward the leaves or the root.|
|Logical vector for all selected nodes.|
|Logical vector for selected leaves.|
|Logical vector for selected branches.|
a logical vector (
S = select(
S) of size
x 1] indicating the
nodes to the root node of a
phytree object (
NumNodes = NumLeaves + NumBranches. The first
criterion used is branch levels, then patristic distance (also known
as tree distance). By default,
the value of
a vector with values of
[ returns two additional logical vectors, one
for the selected leaves and one for the selected branches.
select(..., ' uses additional options specified as one or more name-value
pair arguments. Each
be enclosed in single quotation marks and is case insensitive. These
name-value pairs are as follows:
select(..., 'Reference', changes the reference point(s) to measure the closeness.
'root' (default) or
an index that points to any node of the tree. When using
a node can have multiple distances to its descendant leaves (nonultrametric
tree). If so,
select considers the minimum distance
to any descendant leaf.
select(..., 'Criteria', changes the criteria used to measure closeness. If
(default), the first criterion is branch levels
and then patristic distance. If
, the first criterion is patristic distance and
then branch levels.
select(..., 'Threshold', selects all the nodes where closeness is less than
or equal to the threshold value
You can use either
conjunction with this name-value pair. If
not specified, then
N = Inf. Otherwise you can
limit the number of selected nodes by
select(..., 'Exclude', sets a postfilter which excludes all the branch nodes
or excludes all the leave nodes when
. The default is
select(..., 'Propagate', activates a postfunctionality that propagates the
selected nodes to the leaves when
'toleaves' or toward the root finding a
common ancestor when
'toroot'. The default value is
acts after the
'Exclude' name-value pair.
% Load a phylogenetic tree created from a protein family: tr = phytreeread('pf00002.tree'); % To find close products for a given protein (e.g. vipr2_human): ind = getbyname(tr,'vipr2_human'); [sel,sel_leaves] = select(tr,'criteria','distance',... 'threshold',0.6,'reference',ind); view(tr,sel_leaves) % To find potential outliers in the tree, use [sel,sel_leaves] = select(tr,'criteria','distance',... 'threshold',.3,... 'reference','leaves',... 'exclude','leaves',... 'propagate','toleaves'); view(tr,~sel_leaves)