| Bioinformatics Toolbox™ | ![]() |
D = pdist(Tree)
[D,C] = pdist(Tree)
pdist(..., 'PropertyName', PropertyValue,...)
pdist(..., 'Nodes', NodeValue)
pdist(... , Squareform', SquareformValue)
pdist(..., 'Criteria', CriteriaValue)
| Tree | Phylogenetic tree object created with the phytree constructor function. |
| NodeValue | Property to select the nodes. Enter either 'leaves' (default) or 'all'. |
| SquareformValue | Property to control creating a square matrix. |
D = pdist(Tree) returns a vector (D) containing the patristic distances between every possible pair of leaf nodes a phylogenetic tree object (Tree). The patristic distances are computed by following paths through the branches of the tree and adding the patristic branch distances originally created with seqlinkage.
The output vector D is arranged in the order ((2,1),(3,1),..., (M,1),(3,2),...(M,3),.....(M,M-1)) (the lower-left triangle of the full M-by-M distance matrix). To get the distance between the Ith and Jth nodes (I > J), use the formula D((J-1)*(M-J/2)+I-J). M is the number of leaves.
[D,C] = pdist(Tree) returns in C the index of the closest common parent nodes for every possible pair of query nodes.
pdist(..., 'PropertyName', PropertyValue,...) defines optional properties using property name/value pairs.
pdist(..., 'Nodes', NodeValue) indicates the nodes included in the computation. When Node='leaves', the output is ordered as before, but M is the total number of nodes in the tree ( NumLeaves+NumBranches).
pdist(... , Squareform', SquareformValue), when Squareform is true, converts the output into a square formatted matrix, so that D(I,J) denotes the distance between the Ith and the Jth nodes. The output matrix is symmetric and has a zero diagonal.
pdist(..., 'Criteria', CriteriaValue) changes the criteria used to relate pairs. C can be 'distance' (default) or 'levels'.
Get a phylogenetic tree from a file.
tr = phytreeread('pf00002.tree')Calculate the tree distances between pairs of leaves.
dist = pdist(tr,'nodes','leaves','squareform',true)
Bioinformatics Toolbox™ functions: phytree (object constructor), phytreeread, phytreetool, seqlinkage, seqpdist
![]() | minspantree (biograph) | plot (clustergram) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |