本文整理汇总了Python中ete2.TreeStyle.root_opening_factor方法的典型用法代码示例。如果您正苦于以下问题:Python TreeStyle.root_opening_factor方法的具体用法?Python TreeStyle.root_opening_factor怎么用?Python TreeStyle.root_opening_factor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ete2.TreeStyle
的用法示例。
在下文中一共展示了TreeStyle.root_opening_factor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_example_tree
# 需要导入模块: from ete2 import TreeStyle [as 别名]
# 或者: from ete2.TreeStyle import root_opening_factor [as 别名]
def get_example_tree():
# Set dashed blue lines in all leaves
nst1 = NodeStyle()
nst1["bgcolor"] = "LightSteelBlue"
nst2 = NodeStyle()
nst2["bgcolor"] = "Moccasin"
nst3 = NodeStyle()
nst3["bgcolor"] = "DarkSeaGreen"
nst4 = NodeStyle()
nst4["bgcolor"] = "Khaki"
t = Tree("((((a1,a2),a3), ((b1,b2),(b3,b4))), ((c1,c2),c3));")
for n in t.traverse():
n.dist = 0
n1 = t.get_common_ancestor("a1", "a2", "a3")
n1.set_style(nst1)
n2 = t.get_common_ancestor("b1", "b2", "b3", "b4")
n2.set_style(nst2)
n3 = t.get_common_ancestor("c1", "c2", "c3")
n3.set_style(nst3)
n4 = t.get_common_ancestor("b3", "b4")
n4.set_style(nst4)
ts = TreeStyle()
ts.layout_fn = layout
ts.show_leaf_name = False
ts.mode = "c"
ts.root_opening_factor = 1
return t, ts
示例2: setTreeStyle
# 需要导入模块: from ete2 import TreeStyle [as 别名]
# 或者: from ete2.TreeStyle import root_opening_factor [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
示例3: NodeStyle
# 需要导入模块: from ete2 import TreeStyle [as 别名]
# 或者: from ete2.TreeStyle import root_opening_factor [as 别名]
bgcol11="#E5CCFF"
#######################################################
#~ Setting Clade Color
#~ cs1 = NodeStyle()
#~ cs1["bgcolor"] = "#FFCCCC"
#~ c1 = t.get_common_ancestor("<TaxonLabel1>", "<TaxonLabel2>")
#~ c1.set_style(cs1)
#######################################################
#Style
ts = TreeStyle()
ts.mode = "c" # draw tree in circular mode
ts.root_opening_factor = 0
#~ ts.arc_start = -180 # 0 degrees = 3 o'clock
#~ ts.arc_span = 180
#~ ts.scale = 20
ts.show_leaf_name = False
#~ ts.show_branch_length = True
#~ ts.show_branch_support = True
#~ ts.optimal_scale_level= "full"
ts.layout_fn = layout
#~ ts.min_leaf_separation = 1000
ts.force_topology=True
#~ ts.guiding_lines_type=0
t.render("image.png", w=1200, dpi=60, units="px", tree_style=ts)