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


Python Cluster.is_singleton方法代码示例

本文整理汇总了Python中pyicoteolib.core.Cluster.is_singleton方法的典型用法代码示例。如果您正苦于以下问题:Python Cluster.is_singleton方法的具体用法?Python Cluster.is_singleton怎么用?Python Cluster.is_singleton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyicoteolib.core.Cluster的用法示例。


在下文中一共展示了Cluster.is_singleton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_is_singleton

# 需要导入模块: from pyicoteolib.core import Cluster [as 别名]
# 或者: from pyicoteolib.core.Cluster import is_singleton [as 别名]
 def test_is_singleton(self):
     self.assertFalse(self.cluster_short.is_singleton())
     self.assertTrue(self.bed_tag.is_singleton())
     cluster = Cluster(read=PK)
     cluster.read_line("chr1 1 100 100:2")
     self.assertFalse(cluster.is_singleton())
开发者ID:23Skidoo,项目名称:genomizer-server,代码行数:8,代码来源:testCore.py

示例2: test_is_singleton_error

# 需要导入模块: from pyicoteolib.core import Cluster [as 别名]
# 或者: from pyicoteolib.core.Cluster import is_singleton [as 别名]
 def test_is_singleton_error(self):
     cluster = Cluster(read=PK, write=PK)
     self.assertEqual(cluster.is_singleton(), False)
开发者ID:23Skidoo,项目名称:genomizer-server,代码行数:5,代码来源:testCore.py

示例3: TestCoreObjects

# 需要导入模块: from pyicoteolib.core import Cluster [as 别名]
# 或者: from pyicoteolib.core.Cluster import is_singleton [as 别名]

#.........这里部分代码省略.........
        cluster3 = Cluster(read=PK)
        cluster.read_line('chr1 1 15 4:1|1:2|2:1|3:4|2:5|2:2|1:1')
        cluster2.read_line('chr1 1 15 4:1|1:2|2:1|3:4|2:5|2:2|1:1')
        cluster3.read_line('chr1 1 15 4:1|1:2|2:1|3:4|2:5|2:2')
        self.assertEqual(cluster, cluster2)
        self.assertNotEqual(cluster, cluster3)

    def test_extend(self):
        cluster = Cluster(read=BED)
        cluster.read_line('chr3 1 35 noname 666 +')
        cluster2 = Cluster(read=BED)
        cluster2.read_line('chr3 56 100 noname 666 -')
        cluster.extend(100)
        cluster2.extend(100)
        self.assertEqual(cluster.write_line(), 'chr3\t1\t100\t100:1.00\t1.0\t+\t50\t100.0\n')
        self.assertEqual(cluster2.write_line(), 'chr3\t1\t100\t100:1.00\t1.0\t-\t50\t100.0\n')

    def test_extend_bug(self):
        cluster = Cluster(read=BED, write=PK)
        cluster.read_line('chr3 1 35 666 noname +')
        cluster2 = Cluster(read=BED, write=PK)
        cluster2.read_line('chr3 156 200 666 noname -')
        cluster.extend(100)
        cluster2.extend(100)
        result = cluster + cluster2
        self.assertEqual(200, len(result))

    def test_extreme_split(self):
        cluster = Cluster()
        cluster.read_line('chr3 1 35 20:5|20:0|30:4')
        clusters = cluster.absolute_split(threshold=0)
        self.assertEqual(len(clusters), 2)

    def test_is_singleton(self):
        self.assertFalse(self.cluster_short.is_singleton())
        self.assertTrue(self.bed_tag.is_singleton())
        cluster = Cluster(read=PK)
        cluster.read_line("chr1 1 100 100:2")
        self.assertFalse(cluster.is_singleton())

    def test_cluster_to_tag(self):
        self.cluster_short.set_tag_length(10)
        tags = self.cluster_short.decompose()
        for tag in range(0, len(self.tag_list_short)):
            self.assertEqual(self.tag_list_short[tag], tags[tag])

    def test_decompose_alobestia(self):
        super_cluster = Cluster(read=PK, write= BED, tag_length=130)
        super_cluster.read_line("chrX    2895999 2896606 10:1|42:2|14:6|33:7|31:10|6:9|4:10|25:9|2:10|1:12|3:13|5:14|6:15|5:12|4:13|5:14|4:13|8:15|13:16|6:18|2:19|5:16|15:17|17:18|29:17|2:16|1:14|2:13|1:16|5:15|6:14|5:13|4:12|5:11|4:12|8:10|10:9|3:11|6:9|7:8|8:7|7:10|2:9|37:10|12:12|26:9|2:8|2:10|18:12|24:12|9:9|37:8|40:6|2:4|18:2")
        tags = super_cluster.decompose()
        for tag in tags:
            self.assertEqual(len(tag), 130)


    def test_is_contiguous_wig(self):
        cluster = Cluster(read=WIG,  read_half_open=True)
        cluster.read_line('chr1    1599888 1599949 1.77')
        cluster2 = Cluster(read=WIG, write=WIG,  read_half_open=True)
        cluster2.read_line('chr1    1599949 1600001 2.65')
        #print cluster2.write_line()
        self.assertTrue(cluster.is_contiguous(cluster2))

    def test_is_contiguous_pk(self):
        cluster = Cluster(read=PK, rounding=True)
        cluster.read_line('chr1  1 100 100:1')
        cluster2 = Cluster(read=PK,rounding=True)
开发者ID:23Skidoo,项目名称:genomizer-server,代码行数:70,代码来源:testCore.py


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