本文整理汇总了Python中pbcore.io.SubreadSet._index方法的典型用法代码示例。如果您正苦于以下问题:Python SubreadSet._index方法的具体用法?Python SubreadSet._index怎么用?Python SubreadSet._index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcore.io.SubreadSet
的用法示例。
在下文中一共展示了SubreadSet._index方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multi_movie_split_zmws_existing_filters
# 需要导入模块: from pbcore.io import SubreadSet [as 别名]
# 或者: from pbcore.io.SubreadSet import _index [as 别名]
def test_multi_movie_split_zmws_existing_filters(self):
N_RECORDS = 1745161
test_file_1 = ("/pbi/dept/secondary/siv/testdata/SA3-DS/lambda/"
"2372215/0007/Analysis_Results/m150404_101626_42"
"267_c100807920800000001823174110291514_s1_p0.al"
"l.subreadset.xml")
test_file_2 = ("/pbi/dept/secondary/siv/testdata/SA3-DS/lambda/"
"2590980/0008/Analysis_Results/m141115_075238_et"
"han_c100699872550000001823139203261572_s1_p0.al"
"l.subreadset.xml")
ds1 = SubreadSet(test_file_1, test_file_2)
# used to get total:
#self.assertEqual(sum(1 for _ in ds1), N_RECORDS)
self.assertEqual(len(ds1), N_RECORDS)
ds1.filters.addRequirement(
movie=[('=',
'm150404_101626_42267_c100807920800000001823174110291514_s1_p0'),
('=',
'm141115_075238_ethan_c100699872550000001823139203261572_s1_p0')],
zm=[('>', 10), ('>', 127900)])
ds1.filters.mapRequirement(
zm=[('<', 10000), ('<', 140000)])
FILT_RECORDS = 117776
self.assertEqual(len(ds1), FILT_RECORDS)
ds1._index = None
ds1.updateCounts()
self.assertEqual(len(ds1), FILT_RECORDS)
dss = ds1.split(chunks=1, zmws=True)
self.assertEqual(len(dss), 1)
self.assertEqual(len(dss[0]), FILT_RECORDS)
self.assertEqual(sum([len(ds_) for ds_ in dss]),
FILT_RECORDS)
dss = ds1.split(chunks=12, zmws=True)
self.assertEqual(len(dss), 12)
self.assertEqual(sum([len(ds_) for ds_ in dss]),
FILT_RECORDS)
self.assertEqual(
dss[0].zmwRanges,
[('m150404_101626_42267_c100807920800000001823174110291514_s1_p0',
11, 1515)])
self.assertEqual(
dss[-1].zmwRanges,
[('m141115_075238_ethan_c100699872550000001823139203261572_s1_p0',
137634, 139999)])