本文整理汇总了Python中ete3.Tree.ladderize方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.ladderize方法的具体用法?Python Tree.ladderize怎么用?Python Tree.ladderize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ete3.Tree
的用法示例。
在下文中一共展示了Tree.ladderize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_meta_new
# 需要导入模块: from ete3 import Tree [as 别名]
# 或者: from ete3.Tree import ladderize [as 别名]
mode = sys.argv[2]
metadata = {}
metadata = get_meta_new(metadata, big_tree)
colourDict = get_colours(clusters, big_tree, colours)
# remove dodgy sample
big_tree.search_nodes(name="'EBOV|EMLab-RT|IPDPFHGINSP_GUI_2015_5339||GIN|Conakry|?|MinION_LQ05|2015-04-08'")[0].delete(
preserve_branch_length=True
)
# root the same as the MCC tree
ancestor = big_tree.get_common_ancestor(
"'EBOV|EMLab|EM_079422|KR817187|GIN|Macenta|?||2014-03-27'",
"'EBOV|EMLab|Gueckedou-C05|KJ660348|GIN|Gueckedou|?||2014-03-19'",
)
big_tree.set_outgroup(ancestor)
big_tree.ladderize()
ts = TreeStyle()
ts.show_leaf_name = False
# ts.show_branch_support = True
ts.scale = 100000
if mode == "small":
ts.scale = 750000
# add legend
for each in colourDict.keys():
ts.legend.add_face(CircleFace(radius=size[mode] / 2, color=colourDict[each]), column=0)
ts.legend.add_face(TextFace(each, ftype="Helvetica", fsize=size[mode]), column=1)
ts.legend.add_face(CircleFace(radius=size[mode] / 2, color="#F1F1F1"), column=0)
ts.legend.add_face(TextFace("Guinea", ftype="Helvetica", fsize=size[mode]), column=1)
ts.legend.add_face(RectFace(width=size[mode], height=size[mode], bgcolor="#D3D3D3", fgcolor="#FFFFFF"), column=0)