Darwin Help

Back to Index

AllTernaryRoots

Function AllTernaryRoots - returns a set of all trees with ternary roots

Calling Sequence  AllTernaryRoots(tree)
Parameters
NameTypeDescription

tree Treethe tree structure with arbitrary root position
Return Type  set(Tree)
Synopsis Returns all posssible trees with ternary roots. For each internal node of the tree (except the original root), a tree is returned where the root is at distance 0 above the internal node. For all practical purposes (e.g. reconstruction of ancestral sequences), this has the same effect as having a ternary root (which is not possible with the Tree data structure).
Examples
> t := Tree(Tree(Leaf(A,15),5,Leaf(B,15)),0,Tree(Leaf(C,15),11,Leaf(D,15)));
t := Tree(Tree(Leaf(A,15),5,Leaf(B,15)),0,Tree(Leaf(C,15),11,Leaf(D,15)))
> AllTernaryRoots(t);
{Tree(Tree(Leaf(A,10),0,Leaf(B,10)),0,Tree(Leaf(C,20),16,Leaf(D,20))),Tree(Tree(
Leaf(A,26),16,Leaf(B,26)),0,Tree(Leaf(C,4),0,Leaf(D,4)))}
See also AllRootedTrees,   PASfromTree,   RotateTree,   Tree