本文整理汇总了Python中qiime.sdk.Visualization.extract方法的典型用法代码示例。如果您正苦于以下问题:Python Visualization.extract方法的具体用法?Python Visualization.extract怎么用?Python Visualization.extract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qiime.sdk.Visualization
的用法示例。
在下文中一共展示了Visualization.extract方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_extract
# 需要导入模块: from qiime.sdk import Visualization [as 别名]
# 或者: from qiime.sdk.Visualization import extract [as 别名]
def test_extract(self):
fp = os.path.join(self.test_dir.name, 'visualization.qzv')
visualization = Visualization._from_data_dir(self.data_dir,
self.provenance)
visualization.save(fp)
output_dir = os.path.join(self.test_dir.name, 'viz-extract-test')
result_dir = Visualization.extract(fp, output_dir=output_dir)
self.assertEqual(result_dir, output_dir)
contents = [
'visualization/VERSION',
'visualization/metadata.yaml',
'visualization/README.md',
'visualization/data/index.html',
'visualization/data/css/style.css']
for fp in contents:
expected_fp = os.path.join(output_dir, fp)
self.assertTrue(os.path.exists(expected_fp),
'File %s was not extracted.' % fp)
示例2: test_extract
# 需要导入模块: from qiime.sdk import Visualization [as 别名]
# 或者: from qiime.sdk.Visualization import extract [as 别名]
def test_extract(self):
fp = os.path.join(self.test_dir.name, 'visualization.qzv')
visualization = Visualization._from_data_dir(
self.data_dir, self.make_provenance_capture())
visualization.save(fp)
root_dir = str(visualization.uuid)
output_dir = os.path.join(self.test_dir.name, 'viz-extract-test')
result_dir = Visualization.extract(fp, output_dir=output_dir)
self.assertEqual(result_dir, os.path.join(output_dir, root_dir))
expected = {
'VERSION',
'metadata.yaml',
'data/index.html',
'data/css/style.css',
'provenance/metadata.yaml',
'provenance/VERSION',
'provenance/action/action.yaml'
}
self.assertExtractedArchiveMembers(output_dir, root_dir, expected)