getcanonical
Calculate canonical form of phylogenetic tree
Syntax
Pointers
= getcanonical(Tree
)
[Pointers, Distances, Names
]
= getcanonical(Tree
)
Description
returns
the pointers for the canonical form of a phylogenetic tree (Pointers
= getcanonical(Tree
)Tree
).
In a canonical tree the leaves are ordered alphabetically and the
branches are ordered first by their width and then alphabetically
by their first element. A canonical tree is isomorphic to all the
trees with the same skeleton independently of the order of their leaves
and branches.
[
returns,
in addition to the pointers described above, the reordered distances
(Pointers, Distances, Names
]
= getcanonical(Tree
)Distances
) and node names (Names
).
Examples
Create two phylogenetic trees with the same skeleton but slightly different distances.
b = [1 2; 3 4; 5 6; 7 8;9 10]; tr_1 = phytree(b,[.1 .2 .3 .3 .4 ]'); tr_2 = phytree(b,[.2 .1 .2 .3 .4 ]');
Plot the trees.
plot(tr_1) plot(tr_2)
Check whether the trees have an isomorphic construction.
isequal(getcanonical(tr_1),getcanonical(tr_2)) ans = 1
Version History
Introduced before R2006a
See Also
phytree
| phytreeread
| getbyname
| select
| subtree