本文整理汇总了Python中skbio.core.tree.TreeNode.append方法的典型用法代码示例。如果您正苦于以下问题:Python TreeNode.append方法的具体用法?Python TreeNode.append怎么用?Python TreeNode.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skbio.core.tree.TreeNode
的用法示例。
在下文中一共展示了TreeNode.append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_missing_tip_name
# 需要导入模块: from skbio.core.tree import TreeNode [as 别名]
# 或者: from skbio.core.tree.TreeNode import append [as 别名]
def test_missing_tip_name(self):
"""DndParser should produce the correct tree when missing a name"""
obs = TreeNode.from_newick(missing_tip_name)
exp = TreeNode()
exp.append(TreeNode())
exp.append(TreeNode())
exp.children[0].append(TreeNode(name='a'))
exp.children[0].append(TreeNode(name='b'))
exp.children[1].append(TreeNode(name='c'))
exp.children[1].append(TreeNode())
self.assertEqual(str(obs), str(exp))
示例2: test_nonames
# 需要导入模块: from skbio.core.tree import TreeNode [as 别名]
# 或者: from skbio.core.tree.TreeNode import append [as 别名]
def test_nonames(self):
"""DndParser should produce the correct tree when there are no names"""
obs = TreeNode.from_newick(no_names)
exp = TreeNode()
exp.append(TreeNode())
exp.append(TreeNode())
exp.children[0].append(TreeNode())
exp.children[0].append(TreeNode())
exp.children[1].append(TreeNode())
exp.children[1].append(TreeNode())
self.assertEqual(str(obs), str(exp))
示例3: test_gops
# 需要导入模块: from skbio.core.tree import TreeNode [as 别名]
# 或者: from skbio.core.tree.TreeNode import append [as 别名]
def test_gops(self):
"""Basic TreeNode operations should work as expected"""
p = TreeNode()
self.assertEqual(str(p), ';')
p.name = 'abc'
self.assertEqual(str(p), 'abc;')
p.length = 3
self.assertEqual(str(p), 'abc:3;') # don't suppress branch from root
q = TreeNode()
p.append(q)
self.assertEqual(str(p), '()abc:3;')
r = TreeNode()
q.append(r)
self.assertEqual(str(p), '(())abc:3;')
r.name = 'xyz'
self.assertEqual(str(p), '((xyz))abc:3;')
q.length = 2
self.assertEqual(str(p), '((xyz):2)abc:3;')
示例4: test_minimal
# 需要导入模块: from skbio.core.tree import TreeNode [as 别名]
# 或者: from skbio.core.tree.TreeNode import append [as 别名]
def test_minimal(self):
"""DndParser should produce the correct minimal tree"""
obs = TreeNode.from_newick(minimal)
exp = TreeNode()
exp.append(TreeNode())
self.assertEqual(str(obs), str(exp))