October 2026
tree-reroot - Place the root at a selected node or branch.
tree-reroot TREE --outgroup NAME
tree-reroot TREE --taxa LIST
tree-reroot TREE --leaf NAME
tree-reroot TREE --parent-of NAME
tree-reroot TREE --branch SPLIT
Change the root of the first tree in a file and write one Newick tree to standard output. Choose an existing node with --taxa, --leaf, or --parent-of, or insert a root halfway along a branch with --outgroup or --branch.
Rerooting changes the orientation used to write the tree. It does not prune leaves or automatically suppress the former root if that node has degree two. Splitting a branch replaces its length with two equal halves, preserving leaf-to-leaf distances. The branch-splitting modes require branch lengths.
At least one selector is required. If several are supplied, the first present in this list wins: --outgroup, --taxa, --leaf, --parent-of, --branch. The other selectors are ignored.
TREE is a positional Newick or NEXUS filename; only its first tree is used. - is not a standard-input alias. Names must match the tree's taxon labels.
@ with a backslash to avoid reading a
file.
For a file tree.nwk containing
((A:1,B:1):2,C:1,D:1);:
tree-reroot tree.nwk --outgroup D > rooted.nwk
tree-reroot tree.nwk --taxa A,C,D
tree-reroot tree.nwk --parent-of A
tree-reroot tree.nwk --leaf D
tree-reroot tree.nwk --branch 'A B | C D'tree-tool(1), tree-partitions(1)
BAli-Phy online help: https://www.bali-phy.org/docs.php.
Please send bug reports to bali-phy-users@googlegroups.com.