本文整理汇总了Python中pbcore.io.SubreadSet.consolidate方法的典型用法代码示例。如果您正苦于以下问题:Python SubreadSet.consolidate方法的具体用法?Python SubreadSet.consolidate怎么用?Python SubreadSet.consolidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcore.io.SubreadSet
的用法示例。
在下文中一共展示了SubreadSet.consolidate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_subreadset_consolidate
# 需要导入模块: from pbcore.io import SubreadSet [as 别名]
# 或者: from pbcore.io.SubreadSet import consolidate [as 别名]
def test_subreadset_consolidate(self):
log.debug("Test methods directly")
aln = SubreadSet(data.getXml(10), data.getXml(13))
self.assertEqual(len(aln.toExternalFiles()), 2)
outdir = tempfile.mkdtemp(suffix="dataset-unittest")
outfn = os.path.join(outdir, 'merged.bam')
consolidateBams(aln.toExternalFiles(), outfn, filterDset=aln)
self.assertTrue(os.path.exists(outfn))
consAln = SubreadSet(outfn)
self.assertEqual(len(consAln.toExternalFiles()), 1)
for read1, read2 in zip(sorted(list(aln)), sorted(list(consAln))):
self.assertEqual(read1, read2)
self.assertEqual(len(aln), len(consAln))
log.debug("Test through API")
aln = SubreadSet(data.getXml(10), data.getXml(13))
self.assertEqual(len(aln.toExternalFiles()), 2)
outdir = tempfile.mkdtemp(suffix="dataset-unittest")
outfn = os.path.join(outdir, 'merged.bam')
aln.consolidate(outfn)
self.assertTrue(os.path.exists(outfn))
self.assertEqual(len(aln.toExternalFiles()), 1)
nonCons = SubreadSet(data.getXml(10), data.getXml(13))
self.assertEqual(len(nonCons.toExternalFiles()), 2)
for read1, read2 in zip(sorted(list(aln)), sorted(list(nonCons))):
self.assertEqual(read1, read2)
self.assertEqual(len(aln), len(nonCons))
示例2: test_subreadset_consolidate
# 需要导入模块: from pbcore.io import SubreadSet [as 别名]
# 或者: from pbcore.io.SubreadSet import consolidate [as 别名]
def test_subreadset_consolidate(self):
log.debug("Test through API")
aln = SubreadSet(data.getXml(10), data.getXml(13))
self.assertEqual(len(aln.toExternalFiles()), 2)
outdir = tempfile.mkdtemp(suffix="dataset-unittest")
outfn = os.path.join(outdir, 'merged.bam')
aln.consolidate(outfn)
self.assertTrue(os.path.exists(outfn))
self.assertEqual(len(aln.toExternalFiles()), 1)
# lets make sure we're not getting extra entries:
self.assertEqual(len(aln.externalResources), 1)
self.assertEqual(len(aln.externalResources[0].indices), 2)
nonCons = SubreadSet(data.getXml(10), data.getXml(13))
self.assertEqual(len(nonCons.toExternalFiles()), 2)
for read1, read2 in zip(sorted(list(aln)), sorted(list(nonCons))):
self.assertEqual(read1, read2)
self.assertEqual(len(aln), len(nonCons))