本文整理汇总了Python中pbcore.io.AlignmentSet.induceIndices方法的典型用法代码示例。如果您正苦于以下问题:Python AlignmentSet.induceIndices方法的具体用法?Python AlignmentSet.induceIndices怎么用?Python AlignmentSet.induceIndices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcore.io.AlignmentSet
的用法示例。
在下文中一共展示了AlignmentSet.induceIndices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pbmerge_indexing
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import induceIndices [as 别名]
def test_pbmerge_indexing(self):
log.debug("Test through API")
aln = AlignmentSet(data.getXml(12))
self.assertEqual(len(aln.toExternalFiles()), 2)
outdir = tempfile.mkdtemp(suffix="dataset-unittest")
outfn = os.path.join(outdir, 'merged.bam')
log.info(outfn)
consolidateXml(aln, outfn, cleanup=False)
self.assertTrue(os.path.exists(outfn))
self.assertTrue(os.path.exists(outfn + '.pbi'))
cons = AlignmentSet(outfn)
self.assertEqual(len(aln), len(cons))
orig_stats = os.stat(outfn + '.pbi')
cons.externalResources[0].pbi = None
self.assertEqual(None, cons.externalResources[0].pbi)
# test is too quick, stat times might be within the same second
time.sleep(1)
cons.induceIndices()
self.assertEqual(outfn + '.pbi', cons.externalResources[0].pbi)
self.assertEqual(orig_stats, os.stat(cons.externalResources[0].pbi))
cons.externalResources[0].pbi = None
self.assertEqual(None, cons.externalResources[0].pbi)
# test is too quick, stat times might be within the same second
time.sleep(1)
cons.induceIndices(force=True)
self.assertNotEqual(orig_stats, os.stat(cons.externalResources[0].pbi))