本文整理汇总了Python中NewickIO.parse_simple方法的典型用法代码示例。如果您正苦于以下问题:Python NewickIO.parse_simple方法的具体用法?Python NewickIO.parse_simple怎么用?Python NewickIO.parse_simple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewickIO
的用法示例。
在下文中一共展示了NewickIO.parse_simple方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: newick_to_RBN
# 需要导入模块: import NewickIO [as 别名]
# 或者: from NewickIO import parse_simple [as 别名]
def newick_to_RBN(s):
"""
@param s: newick string
@return: directed topology, branch lengths, vertex name map
"""
tree = NewickIO.parse_simple(s, _IO_Tree())
Ftree.RB_assert_branch_lengths(tree.R, tree.B)
return tree.R, tree.B, tree.v_to_name
示例2: newick_to_TN
# 需要导入模块: import NewickIO [as 别名]
# 或者: from NewickIO import parse_simple [as 别名]
def newick_to_TN(s):
"""
Everything to do with branch lengths is ignored.
@param s: newick string
@return: undirected topology, vertex name map
"""
tree = NewickIO.parse_simple(s, _IO_Tree())
return Ftree.R_to_T(tree.R), tree.v_to_name
示例3: newick_to_TBN
# 需要导入模块: import NewickIO [as 别名]
# 或者: from NewickIO import parse_simple [as 别名]
def newick_to_TBN(s):
"""
@param s: newick string
@return: undirected topology, branch lengths, vertex name map
"""
tree = NewickIO.parse_simple(s, _IO_Tree())
T = Ftree.R_to_T(tree.R)
Ftree.TB_assert_branch_lengths(T, tree.B)
return T, tree.B, tree.v_to_name
示例4: newick_to_R
# 需要导入模块: import NewickIO [as 别名]
# 或者: from NewickIO import parse_simple [as 别名]
def newick_to_R(s, name_type=None):
tree = NewickIO.parse_simple(s, _IO_Tree())
N = get_validated_name_map(tree.v_to_name, name_type)
return set((N[a], N[b]) for a, b in tree.R)