本文整理汇总了Python中pbcore.io.SubreadSet.filters方法的典型用法代码示例。如果您正苦于以下问题:Python SubreadSet.filters方法的具体用法?Python SubreadSet.filters怎么用?Python SubreadSet.filters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcore.io.SubreadSet
的用法示例。
在下文中一共展示了SubreadSet.filters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_barcode_split_cornercases
# 需要导入模块: from pbcore.io import SubreadSet [as 别名]
# 或者: from pbcore.io.SubreadSet import filters [as 别名]
def test_barcode_split_cornercases(self):
fn = ('/pbi/dept/secondary/siv/testdata/'
'pblaa-unittest/Sequel/Phi29/m54008_160219_003234'
'.tiny.subreadset.xml')
sset = SubreadSet(fn)
ssets = sset.split(chunks=3, barcodes=True)
self.assertEqual([str(ss.filters) for ss in ssets],
["( bc = [0, 0] )",
"( bc = [1, 1] )",
"( bc = [2, 2] )"])
sset = SubreadSet(fn)
self.assertEqual(len(sset), 15133)
sset.filters = None
self.assertEqual(str(sset.filters), "")
sset.updateCounts()
self.assertEqual(len(sset), 2667562)
sset.filters.addRequirement(bc=[('=', '[2, 2]')])
self.assertEqual(str(sset.filters), "( bc = [2, 2] )")
sset.updateCounts()
self.assertEqual(len(sset), 4710)
sset.filters = None
self.assertEqual(str(sset.filters), "")
sset.updateCounts()
self.assertEqual(len(sset), 2667562)
sset.filters.addRequirement(bc=[('=', '[2,2]')])
self.assertEqual(str(sset.filters), "( bc = [2,2] )")
sset.updateCounts()
self.assertEqual(len(sset), 4710)
示例2: test_barcode_split_maxChunks
# 需要导入模块: from pbcore.io import SubreadSet [as 别名]
# 或者: from pbcore.io.SubreadSet import filters [as 别名]
def test_barcode_split_maxChunks(self):
fn = ('/pbi/dept/secondary/siv/testdata/'
'pblaa-unittest/Sequel/Phi29/m54008_160219_003234'
'.tiny.subreadset.xml')
sset = SubreadSet(fn, skipMissing=True)
ssets = sset.split(maxChunks=2, barcodes=True)
self.assertEqual([str(ss.filters) for ss in ssets],
["( bc = [0, 0] )",
"( bc = [1, 1] ) OR ( bc = [2, 2] )"])
sset = SubreadSet(fn, skipMissing=True)
self.assertEqual(len(sset), 15133)
sset.filters = None
self.assertEqual(str(sset.filters), "")
sset.updateCounts()
self.assertEqual(len(sset), 2667562)
sset.filters = ssets[0].filters
self.assertEqual(str(sset.filters), "( bc = [0, 0] )")
sset.updateCounts()
self.assertEqual(len(sset), 5370)
sset.filters = None
self.assertEqual(str(sset.filters), "")
sset.updateCounts()
self.assertEqual(len(sset), 2667562)
sset.filters = ssets[1].filters
self.assertEqual(str(sset.filters),
"( bc = [1, 1] ) OR ( bc = [2, 2] )")
sset.updateCounts()
self.assertEqual(len(sset), 9763)