本文整理汇总了Python中skbio.Alignment.to_phylip方法的典型用法代码示例。如果您正苦于以下问题:Python Alignment.to_phylip方法的具体用法?Python Alignment.to_phylip怎么用?Python Alignment.to_phylip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skbio.Alignment
的用法示例。
在下文中一共展示了Alignment.to_phylip方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_to_phylip_no_positions
# 需要导入模块: from skbio import Alignment [as 别名]
# 或者: from skbio.Alignment import to_phylip [as 别名]
def test_to_phylip_no_positions(self):
d1 = DNASequence('', id="d1")
d2 = DNASequence('', id="d2")
a = Alignment([d1, d2])
with self.assertRaises(SequenceCollectionError):
a.to_phylip()
示例2: test_to_phylip_unequal_sequence_lengths
# 需要导入模块: from skbio import Alignment [as 别名]
# 或者: from skbio.Alignment import to_phylip [as 别名]
def test_to_phylip_unequal_sequence_lengths(self):
d1 = DNASequence('A-CT', id="d1")
d2 = DNASequence('TTA', id="d2")
d3 = DNASequence('.-AC', id="d3")
a = Alignment([d1, d2, d3])
with self.assertRaises(SequenceCollectionError):
a.to_phylip()
示例3: test_to_phylip_map_labels
# 需要导入模块: from skbio import Alignment [as 别名]
# 或者: from skbio.Alignment import to_phylip [as 别名]
def test_to_phylip_map_labels(self):
"""to_phylip functions as expected with label mapping
"""
d1 = DNASequence("..ACC-GTTGG..", id="d1")
d2 = DNASequence("TTACCGGT-GGCC", id="d2")
d3 = DNASequence(".-ACC-GTTGC--", id="d3")
a = Alignment([d1, d2, d3])
phylip_str, id_map = a.to_phylip(map_labels=True, label_prefix="s")
self.assertEqual(id_map, {"s1": "d1", "s3": "d3", "s2": "d2"})
expected = "\n".join(["3 13", "s1 ..ACC-GTTGG..", "s2 TTACCGGT-GGCC", "s3 .-ACC-GTTGC--"])
self.assertEqual(phylip_str, expected)
示例4: test_to_phylip
# 需要导入模块: from skbio import Alignment [as 别名]
# 或者: from skbio.Alignment import to_phylip [as 别名]
def test_to_phylip(self):
"""to_phylip functions as expected
"""
d1 = DNASequence("..ACC-GTTGG..", id="d1")
d2 = DNASequence("TTACCGGT-GGCC", id="d2")
d3 = DNASequence(".-ACC-GTTGC--", id="d3")
a = Alignment([d1, d2, d3])
phylip_str, id_map = a.to_phylip(map_labels=False)
self.assertEqual(id_map, {"d1": "d1", "d3": "d3", "d2": "d2"})
expected = "\n".join(["3 13", "d1 ..ACC-GTTGG..", "d2 TTACCGGT-GGCC", "d3 .-ACC-GTTGC--"])
self.assertEqual(phylip_str, expected)