LoginSignup
1
1

More than 5 years have passed since last update.

Bio.Phyloのdraw_ascii関数で描いた系統樹をテキスト形式で保存する

Last updated at Posted at 2016-12-07

Biopython のdraw_ascii関数で得られる系統樹が戻り値ではなく標準出力だったのでそれをテキスト形式で保存する方法についてメモ.

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()

スクリーンショット 2016-12-08 1.06.05.png

アスキーアートで描かれた系統樹を保存する利点が特に思いつかないけど...

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1