本文整理汇总了Python中ete2.TreeStyle.extra_branch_line_color方法的典型用法代码示例。如果您正苦于以下问题:Python TreeStyle.extra_branch_line_color方法的具体用法?Python TreeStyle.extra_branch_line_color怎么用?Python TreeStyle.extra_branch_line_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ete2.TreeStyle
的用法示例。
在下文中一共展示了TreeStyle.extra_branch_line_color方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setTreeStyle
# 需要导入模块: from ete2 import TreeStyle [as 别名]
# 或者: from ete2.TreeStyle import extra_branch_line_color [as 别名]
def setTreeStyle(style, layoutfunction):
#consolidate options for showing trees
#pass in string "circle" or "rect" and a layout function
I = TreeStyle()
if style == "circle":
I.tree_width = 1200
I.layout_fn = layoutfunction
I.show_branch_length = False
#I.show_branch_support = True
I.show_leaf_name = False
I.mode = "c"
I.force_topology = True
#I.legend_position = 3
I.extra_branch_line_type = 1
I.guiding_lines_type = 1
I.guiding_lines_color = "#666666"
I.extra_branch_line_color = "#666666"
I.optimal_scale_level = "full"
I.root_opening_factor = 0
elif style =="rect":
I = TreeStyle()
I.layout_fn = layoutfunction
I.show_leaf_name = False
I.force_topology = True
I.optimal_scale_level = "semi"
else:
I.layout_fn = layoutfunction
I.show_leaf_name = False
I.force_topology = True
I.optimal_scale_level = "semi"
return I
示例2: random_color
# 需要导入模块: from ete2 import TreeStyle [as 别名]
# 或者: from ete2.TreeStyle import extra_branch_line_color [as 别名]
#faces.add_face_to_node(f, node, 0, position="branch-right")
f.border.width = 0
#node.img_style["bgcolor"] = random_color()
#Tree().show()
ts = TreeStyle()
ts.mode = "c"
ts.layout_fn = layout
ts.show_leaf_name = False
ts.arc_span = 340
ts.arc_start = -70
#ts.allow_face_overlap = True
#ts.show_branch_length = True
ts.draw_guiding_lines = False
ts.optimal_scale_level = "mid"
ts.extra_branch_line_color = "red"
ts.root_opening_factor = 0.50
ts.show_border = True
ts.scale = None
t = Tree()
t.populate(200, random_branches=True, branch_range=(0, 0))
t.dist = 0.0
dists = [n.dist for n in t.traverse() if n.dist != 0]
#print max(dists), min(dists)
t.write(outfile="test.nw")
#for s in [5, None]:
# ts.scale = s
# t.render("img_scale_%s.png" %s, tree_style = ts, w=600)
t.show(tree_style=ts)