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


Python Alignment.to_phylip方法代码示例

本文整理汇总了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()
开发者ID:nbresnick,项目名称:scikit-bio,代码行数:9,代码来源:test_alignment.py

示例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()
开发者ID:nbresnick,项目名称:scikit-bio,代码行数:10,代码来源:test_alignment.py

示例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)
开发者ID:cauyrd,项目名称:scikit-bio,代码行数:14,代码来源:test_alignment.py

示例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)
开发者ID:cauyrd,项目名称:scikit-bio,代码行数:14,代码来源:test_alignment.py


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