This command reroots a tree in two ways:
gotree reroot outgroup
: Using an outgroup. If the outgroup is not monophyletic, 2 possibilities: 1) By default (--strict=false
) it takes the lca of given tips to reroot the tree, and print a warning, 2) if--strict
is given, it exits with an error.gotree reroot midpoint
: At midpoint.
General command
Usage:
gotree reroot [command]
Available Commands:
midpoint Reroot trees at midpoint
outgroup Reroot trees using an outgroup
Flags:
-i, --input string Input Tree (default "stdin")
-o, --output string Rerooted output tree file (default "stdout")
- Reroot a random tree using an outgroup in a file
outgroup.txt
Tip2
Tip4
Tip7
gotree generate yuletree --seed 10 -o outtree1.nw
gotree reroot outgroup -l outgroup.txt -i outtree1.nw -o outtree2.nw
gotree draw svg -w 200 -H 200 -i outtree1.nw -o commands/reroot_1.svg
gotree draw svg -w 200 -H 200 -i outtree2.nw --with-branch-support --support-cutoff 0.5 -o commands/reroot_2.svg
Initial random Tree | Rerooted Tree |
---|---|
- Reroot a random tree using an outgroup in commandline
gotree generate yuletree --seed 10 -o outtree1.nw
gotree reroot outgroup -i outtree1.nw -o outtree2.nw Tip2 Tip4 Tip7
gotree draw svg -w 200 -H 200 -i outtree1.nw -o commands/reroot_1.svg
gotree draw svg -w 200 -H 200 -i outtree2.nw --with-branch-support --support-cutoff 0.5 -o commands/reroot_2.svg
- Reroot a random tree using an outgroup in commandline, and remove the outgroup
gotree generate yuletree --seed 10 -o outtree1.nw
gotree reroot outgroup --remove-outgroup -i outtree1.nw -o outtree2.nw Tip2 Tip4 Tip7
gotree draw svg -w 200 -H 200 -i outtree1.nw -o commands/reroot_5.svg
gotree draw svg -w 200 -H 200 -i outtree2.nw --with-branch-support --support-cutoff 0.5 -o commands/reroot_6.svg
Initial random Tree | Rerooted Tree without the outgroup |
---|---|
- Reroot a random tree at midpoint
gotree generate yuletree --seed 10 -o outtree1.nw
gotree reroot midpoint -i outtree1.nw -o outtree2.nw
gotree draw svg -w 200 -H 200 -i outtree1.nw -o commands/reroot_3.svg
gotree draw svg -w 200 -H 200 -i outtree2.nw --with-branch-support --support-cutoff 0.5 -o commands/reroot_4.svg
Initial random Tree | Rerooted Tree at Midpoint |
---|---|