Created
March 21, 2019 11:21
-
-
Save flashton2003/a2633c40ab683c0a02191344652ba52e to your computer and use it in GitHub Desktop.
midpoint roots a tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ete3 import Tree | |
import fileinput | |
lines = [] | |
for line in fileinput.input(): | |
lines.append(line.strip()) | |
tree = Tree(lines[0]) | |
R = tree.get_midpoint_outgroup() | |
tree.set_outgroup(R) | |
print tree.write() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment