Navigation Banner
 
  HyPhy Documentation: GUI Components: Editing Trees

Selecting branches.

To select a tree branch, the user clicks on it in a tree panel. A selected tree branch is hatched. To select an entire subtree, Option click on the top branch of the subtree. To select all branches, use 'Select All' from the 'Edit' menu (Command-A). Holding down the Shift key while selecting branches will add or remove them from the current selection.

All of the following examples are done on the tree from the 'Examples/SimpleAnalyses/HKY85.bf' example analysis.
Empty Selection.
Internal labels enabled.
Click on '6767'
Shift-Option click on the branch above 'Node5' Shift click on the branches '719' and '136'.

Editing Operations.

Unless otherwise noted, operations are accessed via the 'Tree' menu or corresponding keyboard shortcuts.

Swap Subtrees
Swap subtrees starting at selected branches

Requires two branches, which are not descendants of one another to be selected. This operation is undoable. If two branches being swapped are children of the same parent, the resulting tree topology is equivalent to the original. Otherwise, the tree topology is changed. The operation is allowed on trees attached to a likelihood function.

Before Swap After Swap
Collapse Branches
Remove an internal branch and attach its children to the parent of the branch being removed.

At least one internal branch must be selected. For multiple branch selections, each internal branch is collapsed. This operation is undoable. The tree topology is always changed by this operation. The operation is allowed on trees attached to a likelihood function.

Before Collapse After Collapse
Delete Leaves/Subtrees
Remove all selected leaves, and collapse all internal branches with less than two children. Also deletes subtrees, if a subtree is selected

Activated by pressing the Delete key, or 'Delete' from the 'Edit' menu. This operation is undoable. The tree topology is always changed by this operation. The operation is allowed on trees attached to a likelihood function, if the likelihood function is not tied to an open data panel. The underlying datafilter will be shrunk to reflect the reduced number of sequences.

Before Deletion After Deletion
Graft A Tip
Add a new leaf node to each selected branch.

At least one branch must be selected. For multiple branch selections, each internal branch is collapsed. New leaves will receive default names, which can later be changed. This operation is undoable. The tree topology is always changed by this operation. The operation is allowed on trees attached to a likelihood function, if the likelihood function is not tied to an open data panel. Since the tree new tree will have more leaves than the underlying data filter, the likelihood function will be killed.

Before Graft After Graft
Reroot
Root the tree at the selected branch.

Exactly one branch must be selected. This operation is NOT undoable, but it always results in the same topology in terms of ML. The reroot can be reversed by rerooting the tree at any of the children of the previous root. The operation is allowed on trees attached to a likelihood function.

Before Reroot After Reroot
Unroot
Unroot a rooted tree.

The tree must be rooted and the selection must be empty. This operation is NOT undoable, but it always results in the same topology in terms of ML. The unroot can be reversed by rerooting the tree at any of the children of the previous root. The operation is allowed on trees attached to a likelihood function.

Before Unroot After Unroot
Balance
Reroot an unrooted tree at a 'midpoint'.

The tree must be unrooted and the selection must be empty. This operation is NOT undoable, but it always results in the same topology in terms of ML. The balance can be reversed by rerooting the tree at any of the children of the previous root. The operation is allowed on trees attached to a likelihood function. Likelihood calculations are faster on balanced trees.

Before Balance After Balance
Flip tip ordering
Swap the order of children at the selected node.

Exactly one internal branch must be selected. This operation is undoable. It always results in the same topology in terms of ML. The operation is allowed on trees attached to a likelihood function.

Before Flipping After Flipping
Subtree Move
Move the selected subtree to a different location in the tree.

A subtree (which may be a single branch) must be selected. To move the subtree, command-click on the destination branch. This operation is undoable. The operation is allowed on trees attached to a likelihood function.

Before Move After Move (target branch is highlighted)
Copy/Cut/Paste
Copy, cut and paste subtrees to the same tree or a different tree.

A subtree (which may be a single branch) must be selected for copy or cut. A target branch must be selected for paste. To move the subtree, command-click on the destination branch. The cut/paste operations are NOT undoable. The operation is allowed on trees attached to a likelihood function, except on trees tied to open data panels. Pasting will result in the deletion of the likelihood function. Cutting will shrink the corresponding datafilter. Cut and paste to the same tree is better done through subtree move. Copy and paste to the same tree renames the copies of nodes to avoid duplicate names.

Source Tree (source subtree selected) Target Tree (target branch selected).
Target tree after Paste Subtree pasted back to the source tree (target branch is highlighted).

 
Sergei L. Kosakovsky Pond and Spencer V. Muse, 1997-2002