Esempio n. 1
0
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