Bio.Phylo 사용법

연구회에서의 논문 읽기에서 Talevich, Eric, et al. "Bio. Phylo: a unified toolkit for processing, analyzing and visualizing phylogenetic trees in Biopython."메모를 바.

Biopython이란?



Bioinformatics 용으로 개발 된 Python 라이브러리. Biopython Tutorial and Cookbook에서는 사용법을 설명합니다.
pip install biopython

Bio.Phylo



Bio.Phylo는 계통 나무를 만들 수 있습니다.

논문에서는 urllib2를 사용하고 있지만 python3에서는 urlopen이 urllib에 통합되어 있습니다.
# coding: utf-8

from Bio import Phylo
from urllib.request import urlopen

handle = urlopen("http://www.phyloxml.org/examples/apaf.xml")

tree = Phylo.read(handle, "phyloxml")

handle.close()

Phylo.draw(tree)


# coding: utf-8

from Bio import Phylo
from urllib.request import urlopen

handle = urlopen("http://www.phyloxml.org/examples/apaf.xml")

tree = Phylo.read(handle, "phyloxml")

handle.close()

tree.root_at_midpoint()
tree.ladderize(reverse=True)

vertebrata = tree.common_ancestor("Apaf-1_HUMAN", "15_TETNG")

vertebrata.color = "fuchsia"
vertebrata.width = 3
tree.root.color = "gray"

Phylo.draw(tree)



draw () 대신 draw_ascii ()를 사용하면 계통수를 아스키 아트로 출력합니다.
                                   _ 22_MOUSE
                                  |
                                 _| Apaf-1_HUMAN
                                | |
                               ,| | 12_CANFA
                               ||
                              _||___ 11_CHICK
                             | |
                             | |___________ 16_XENLA
                      _______|
                     |       |       , 14_FUGRU
                     |       |     __|
                     |       |____|  |__ 15_TETNG
                _____|            |
               |     |            |____ 17_BRARE
               |     |
               |     |    ______ 1_BRAFL
               |     | __|
         ______|     ||  |_________ 18_NEMVE
        |      |      |
        |      |      |____________ 23_STRPU
        |      |
       _|      |          _________ 26_STRPU
      | |      |_________|
      | |                |________ 25_STRPU
      | |
      | |                                    ___ CED4_CAEEL
      | |___________________________________|
  ____|                                     |_ 31_CAEBR
 |    |
 |    |                                ___ 28_DROPS
 |    |          _____________________|
 |    |   ______|                     |____ Dark_DROME
 |    |  |      |
 |    |__|      |_______________________ 29_AEDAE
 |       |
 |       |__________________________ 30_TRICA
 |
 |                                                           _ 34_BRAFL
 |                                 _________________________|
_|                           _____|                         |_ 35_BRAFL
 |                          |     |
 |                        __|     |_______________ 8_BRAFL
 |                       |  |
 |                       |  |        ___________________ 20_NEMVE
 |         ______________|  |_______|
 |        |              |          |__________________________ 21_NEMVE
 |        |              |
 |     ___|              |______________________________ 9_BRAFL
 |    |   |
 |    |   |                _____________ 3_BRAFL
 |    |   |          _____|
 |    |   |_________|     |_________________ 2_BRAFL
 |____|             |
      |             |_______________ 19_NEMVE
      |
      |                                     _____ 37_BRAFL
      |            ________________________|
      |___________|                        |____ 36_BRAFL
                  |
                  |______________________ 33_BRAFL

참고문헌



Talevich, Eric, et al. "Bio. Phylo: a unified toolkit for processing, analyzing and visualizing phylogenetic trees in Biopython."

좋은 웹페이지 즐겨찾기