本文整理汇总了Python中pbcore.io.AlignmentSet.copyTo方法的典型用法代码示例。如果您正苦于以下问题:Python AlignmentSet.copyTo方法的具体用法?Python AlignmentSet.copyTo怎么用?Python AlignmentSet.copyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcore.io.AlignmentSet
的用法示例。
在下文中一共展示了AlignmentSet.copyTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_loadmetadata_from_dataset_create_cli
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import copyTo [as 别名]
def test_loadmetadata_from_dataset_create_cli(self):
fn = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
fn2 = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
log.debug(fn)
aln = AlignmentSet(data.getXml(8))
aln.metadata.collections = None
aln.copyTo(fn)
aln.close()
del aln
self.assertTrue(os.path.exists(fn))
aln = AlignmentSet(fn)
self.assertFalse(aln.metadata.collections)
cmd = "dataset create --metadata {m} {o} {i}".format(
o=fn2,
i=fn,
m=("/pbi/dept/secondary/siv/testdata/"
"SA3-Sequel/lambda/roche_SAT/"
"m54013_151205_032353.subreadset.xml"))
log.debug(cmd)
o, r, m = backticks(cmd)
self.assertEqual(r, 0, m)
aln = AlignmentSet(fn2)
self.assertTrue(aln.metadata.collections)
示例2: test_relativize_cli
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import copyTo [as 别名]
def test_relativize_cli(self):
fn = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
aln = AlignmentSet(data.getXml(8))
aln.copyTo(fn)
self.assertFalse(_is_relative(fn))
cmd = "dataset relativize {d}".format(d=fn)
log.debug(cmd)
o, r, m = backticks(cmd)
self.assertEqual(r, 0)
self.assertTrue(os.path.exists(fn))
self.assertTrue(_is_relative(fn))
示例3: test_newUuid_cli
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import copyTo [as 别名]
def test_newUuid_cli(self):
fn = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
aln = AlignmentSet(data.getXml(8))
aln.copyTo(fn)
pre_uuid = AlignmentSet(fn).uuid
cmd = "dataset newuuid {d}".format(d=fn)
log.debug(cmd)
o, r, m = backticks(cmd)
post_uuid = AlignmentSet(fn).uuid
self.assertEqual(r, 0)
self.assertTrue(os.path.exists(fn))
self.assertNotEqual(pre_uuid, post_uuid)
示例4: test_absolutize_cli
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import copyTo [as 别名]
def test_absolutize_cli(self):
fn = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
aln = AlignmentSet(data.getXml(8))
aln.copyTo(fn, relative=True)
self.assertTrue(_is_relative(fn))
cmd = "dataset absolutize {d}".format(d=fn)
log.debug(cmd)
o, r, m = backticks(cmd)
self.assertEqual(r, 0)
self.assertTrue(os.path.exists(fn))
self.assertFalse(_is_relative(fn))
fn = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
outfn = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
aln = AlignmentSet(data.getXml(8))
aln.copyTo(fn, relative=True)
self.assertTrue(_is_relative(fn))
cmd = "dataset absolutize {d} --outdir {o}".format(d=fn, o=outfn)
log.debug(cmd)
o, r, m = backticks(cmd)
self.assertEqual(r, 0)
self.assertTrue(os.path.exists(fn))
self.assertTrue(os.path.exists(outfn))
self.assertTrue(_is_relative(fn))
self.assertFalse(_is_relative(outfn))
fn = tempfile.NamedTemporaryFile(suffix=".alignmentset.xml").name
outdir = tempfile.mkdtemp(suffix="dataset-unittest")
outfn = os.path.join(outdir, os.path.split(fn)[1])
aln = AlignmentSet(data.getXml(8))
aln.copyTo(fn, relative=True)
self.assertTrue(_is_relative(fn))
cmd = "dataset absolutize {d} --outdir {o}".format(d=fn, o=outdir)
log.debug(cmd)
o, r, m = backticks(cmd)
self.assertEqual(r, 0)
self.assertTrue(os.path.exists(fn))
self.assertTrue(os.path.exists(outfn))
self.assertTrue(_is_relative(fn))
self.assertFalse(_is_relative(outfn))