| Bioinformatics Toolbox | ![]() |
Object constructor for a phylogenetic tree object
Tree = phytree(B) Tree = phytree(B, D) Tree = phytree(B, C) Tree = phytree(BC) Tree = phytree(..., N)
Tree = phythree(B) creates an ultrametric phylogenetic tree object.
B is a numeric array of size [NUMBRANCHES X 2] in which every row represents a branch of the tree and it contains two pointers to the branch or leave nodes which are its children.
Leaf nodes are numbered from 1 to NUMLEAVES and branch nodes are numbered from NUMLEAVES + 1 to NUMLEAVES + NUMBRANCHES. Note that because only binary trees are allowed, NUMLEAVES = NUMBRANCHES + 1.
Branches are defined in chronological order (for example, B(i,:) > NUMLEAVES + i). As a consequence, the first row can only have pointers to leaves, and the last row must represent the root branch. Parent-child distances are set to 1, unless the child is a leaf and to satisfy the ultrametric condition of the tree its distance is increased.
Given a tree with 3 leafs and 2 branches as an example.

In the MATLAB Command window, type
B = [1 2 ; 3 4] tree = phytree(B) view(tree)

Tree = phytree(B, D) creates an additive phylogenetic tree object with branch distances defined by D. D is a numeric array of size [NUMNODES X 1] with the distances of every child node (leaf or branch) to its parent branch equal to NUMNODES = NUMLEAVES + NUMBRANCHES. The last distance in D is the distance of the root node and is meaningless.
b = [1 2 ; 3 4 ]: d = [1 2 1.5 1 0] view(phytree(b,d)

Tree = phytree(B, C) creates an ultrametric phylogenetic tree object with branch distances defined by C. C is a numeric array of size [NUMBRANCHES X 1] with the coordinates of every branch node. In ultrametric trees all the leaves are at the same location (for example, same distance to the root).
b = [1 2 ; 3 4]; c = [1 4]' view(phytree(b,c))

Tree = phytree(BC) creates an ultrametric phylogenetic binary tree object with branch pointers in BC(:,[1 2]) and branch coordinates in BC(:,3). Same as phytree(B,C).
Tree = phytree(..., N) specifies the names for the leaves and/or the branches. N is a cell of strings. If NUMEL(N)==NUMLEAVES, then the names are assigned chronologically to the leaves. If NUMEL(N)==NUMBRANCHES, the names are assigned to the branch nodes. If NUMEL(N)==NUMLEAVES + NUMBRANCHES, all the nodes are named. Unassigned names default to 'Leaf #' and/or 'Branch #' as required.
Tree = phytree creates an empty phylogenetic tree object.
Create phylogenetic tree for a set of multiply aligned sequences.
Sequences = multialignread('aagag.aln')
distances = seqpdist(Sequences)
tree = seqlinkage(distances)
phytreetool(tree)
Bioinformatics Toolbox functions phytreeread, phytreetool, phytreewrite, seqlinkage, seqpdist, and the phytree object methods get (phytree), select (phytree)
| pfamhmmread | phytreeread | ![]() |
© 1994-2005 The MathWorks, Inc.