def fix_tree(tree, a_id_lookup, out):
if check(out) is False and check(tree) is True:<EOL><INDENT>tree = open(tree).read()<EOL>for line in open(a_id_lookup):<EOL><INDENT>id, name, header = line.strip().split('<STR_LIT:\t>')<EOL>tree = tree.replace(id+'<STR_LIT::>', name+'<STR_LIT::>')<EOL><DEDENT>out_f = open(out, '<STR_LIT:w>')<EOL>print(tree.strip(), file=out_f)<EOL><DEDENT>return out<EOL>
get the names for sequences in the raxml tree