#!/usr/bin/python
# -*- coding: utf-8 -*-
# @Date : 2017-02-08 02:04:02
# @Author : XYZ (superxyz@vip.qq.com)
# @Link : www.bubblefertilizer.com
# @Version : 1.0
def demo(x):
print('-------------------[%s]-------------------'%x)
demo('1.读取树文件')
'''
对象包含树的全局信息,如树是有根树还是无根树。
它包含一个根进化枝, 和以此往下以列表嵌套的所有进化枝,
直至叶子分支。
'''
from Bio import Phylo
tree=Phylo.read('simple.dnd','newick') #读取生成的树文件
print(tree)
Phylo.draw_ascii(tree) #建一个简单的ASCII-art(纯文本)系统发生图
tree.rooted=True #有根树
Phylo.draw(tree)
demo('2.利用matplot包做图并给树的分支上色')
tree=tree.as_phyloxml()
tree.root.color=(128,128,128) #color 颜色属性,width宽度属性
tree.root.color='#808080'