当前位置: 首页>>代码示例>>Python>>正文


Python Tree.dist方法代码示例

本文整理汇总了Python中ete_dev.Tree.dist方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.dist方法的具体用法?Python Tree.dist怎么用?Python Tree.dist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ete_dev.Tree的用法示例。


在下文中一共展示了Tree.dist方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test

# 需要导入模块: from ete_dev import Tree [as 别名]
# 或者: from ete_dev.Tree import dist [as 别名]
    def test(self):
        # Text faces

        I = TreeImage()
        I.mode = "rect"
        I.aligned_header.add_face(self.headerF, 0)
        I.aligned_header.add_face(self.headerF, 1)
        I.aligned_header.add_face(self.headerF, 2)
        I.aligned_header.add_face(self.headerF, 3)

        I.aligned_foot.add_face(self.footF, 0)
        I.aligned_foot.add_face(self.footF, 1)
        I.aligned_foot.add_face(self.footF, 2)
        I.aligned_foot.add_face(self.footF, 3) 
        I.draw_aligned_faces_as_grid = True
        t = Tree()
        t.dist = 0
        t.populate(10)

        style = NodeStyleDict()
        style["fgcolor"] = "#ff0000"
        style["size"] = 20
        style.add_fixed_face(self.fixedF, "branch-right", 0)
        t.img_style = style
        
        t.render("./test.svg", layout=mylayout, tree_style=I)
        t.show(mylayout, tree_style=I)
        t.show(mylayout2, tree_style=I)
开发者ID:xguse,项目名称:ete,代码行数:30,代码来源:test_treeview.py

示例2: Tree

# 需要导入模块: from ete_dev import Tree [as 别名]
# 或者: from ete_dev.Tree import dist [as 别名]
# same directory in which it is
ETEPATH = os.path.abspath(os.path.split(os.path.realpath(__file__))[0]+'/../')
sys.path.insert(0, ETEPATH)

from ete_dev import Tree, TreeStyle, NodeStyle, PhyloTree, faces
from ete_dev.treeview.faces import *
from ete_dev.treeview.main import random_color, _NODE_TYPE_CHECKER, FACE_POSITIONS

sys.path.insert(0, os.path.join(ETEPATH, "examples/treeview"))
import face_grid, bubble_map, item_faces, node_style, node_background, face_positions, face_rotation, seq_motif_faces, barchart_and_piechart_faces

sys.path.insert(0, os.path.join(ETEPATH, "examples/phylogenies"))
import phylotree_visualization

main_tree = Tree()
main_tree.dist = 0

t, ts = face_grid.get_example_tree()
t_grid = TreeFace(t, ts)
n = main_tree.add_child()
n.add_face(t_grid, 0, "aligned")

t, ts = bubble_map.get_example_tree()
t_bubble = TreeFace(t, ts)
n = main_tree.add_child()
n.add_face(t_bubble, 0, "aligned")

t, ts = item_faces.get_example_tree()
t_items = TreeFace(t, ts)
n = main_tree.add_child()
n.add_face(t_items, 0, "aligned")
开发者ID:MikeTrizna,项目名称:ete,代码行数:33,代码来源:test_treeview.py

示例3: TreeStyle

# 需要导入模块: from ete_dev import Tree [as 别名]
# 或者: from ete_dev.Tree import dist [as 别名]
    #if node.is_leaf():
    #    f = faces.CircleFace(50, "red")
    #    faces.add_face_to_node(f, node, 0, position="aligned")
        

ts = TreeStyle()
ts.mode = "c"
ts.arc_span = 360
ts.layout_fn = layout 
ts.show_leaf_name = False
ts.show_border = True
ts.draw_guiding_lines = False
ts.show_scale = True
#ts.scale = 60
t = Tree()
t.dist = 0

t.size = 0,0
for x in xrange(100):
    n = t.add_child()
    n = n.add_child()
    n = n.add_child()
    n2 = n.add_child()
    n3 = n.add_child()
    n4 = n2.add_child()
    n5 = n3.add_child()
  #  n.size = (10, 10)
  #  n2.size = (10, 70)
  #  n3.size = (40, 40)
  #  n4.size = (10, 10)
    #n2.size = 10
开发者ID:MikeTrizna,项目名称:ete,代码行数:33,代码来源:test_scale.py

示例4: random_color

# 需要导入模块: from ete_dev import Tree [as 别名]
# 或者: from ete_dev.Tree import dist [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)
开发者ID:daisieh,项目名称:ete,代码行数:32,代码来源:test_circ_scale.py


注:本文中的ete_dev.Tree.dist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。