本文整理汇总了Python中pyicoteolib.core.Cluster.decompose方法的典型用法代码示例。如果您正苦于以下问题:Python Cluster.decompose方法的具体用法?Python Cluster.decompose怎么用?Python Cluster.decompose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyicoteolib.core.Cluster
的用法示例。
在下文中一共展示了Cluster.decompose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_decompose_alobestia
# 需要导入模块: from pyicoteolib.core import Cluster [as 别名]
# 或者: from pyicoteolib.core.Cluster import decompose [as 别名]
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)
示例2: TestCoreObjects
# 需要导入模块: from pyicoteolib.core import Cluster [as 别名]
# 或者: from pyicoteolib.core.Cluster import decompose [as 别名]
#.........这里部分代码省略.........
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)
cluster2.read_line('chr1 101 200 100:1')
self.assertTrue(cluster.is_contiguous(cluster2))
def test_write_pseudoeland(self):
self.bed_tag.write_as(ELAND)
self.bed_tag.write_line()
def test_write_pk(self):
cluster = Cluster(write=PK, name='chr5', start=1, rounding=True, write_half_open=True)