本文整理汇总了Python中ete3.Tree.compare方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.compare方法的具体用法?Python Tree.compare怎么用?Python Tree.compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ete3.Tree
的用法示例。
在下文中一共展示了Tree.compare方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: compare_trees
# 需要导入模块: from ete3 import Tree [as 别名]
# 或者: from ete3.Tree import compare [as 别名]
def compare_trees(args):
tree_ref = Tree(args['ref'])
trees = []
for i in args['all']:
tree = {}
tree['name'] = i
tree['comparison'] = tree_ref.compare(Tree(i),unrooted=True)
trees.append(tree)
with open(args['output'],"w") as f_out:
f_out.write("Tree\tEffective_Tree_Size\tRF-normalized\tRF\tRF-max\t% edges in Src\t% edges in Ref\n")
for tree in trees:
f_out.write(tree['name']+"\t")
f_out.write(str(tree['comparison']['effective_tree_size'])+"\t")
f_out.write(str(tree['comparison']['norm_rf'])+"\t")
f_out.write(str(tree['comparison']['rf'])+"\t")
f_out.write(str(tree['comparison']['max_rf'])+"\t")
f_out.write(str(tree['comparison']['ref_edges_in_source'])+"\t")
f_out.write(str(tree['comparison']['source_edges_in_ref'])+"\t")
f_out.write("\n")