Since the phylogenetic tree obtained by the draw_ascii function of Biopython was not the return value but the standard output, a memo about how to save it in text format.
from Bio import Phylo
import sys
f = open("output.txt","w")
sys.stdout = f
tree = Phylo.read("****.dnd", "newick")
Phylo.draw_ascii(tree)
sys.stdout.close()
I can't think of any particular advantage in preserving the phylogenetic tree drawn in ASCII art ...
Recommended Posts