本文整理匯總了Python中qiime.sdk.Artifact.peek方法的典型用法代碼示例。如果您正苦於以下問題:Python Artifact.peek方法的具體用法?Python Artifact.peek怎麽用?Python Artifact.peek使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qiime.sdk.Artifact
的用法示例。
在下文中一共展示了Artifact.peek方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: inspect_artifact
# 需要導入模塊: from qiime.sdk import Artifact [as 別名]
# 或者: from qiime.sdk.Artifact import peek [as 別名]
def inspect_artifact(uuid):
try:
metadata = Artifact.peek(ARTIFACTS[uuid])
except Exception:
abort(404)
return jsonify({'uuid': metadata.uuid, 'type': metadata.type})
示例2: test_peek
# 需要導入模塊: from qiime.sdk import Artifact [as 別名]
# 或者: from qiime.sdk.Artifact import peek [as 別名]
def test_peek(self):
artifact = Artifact.import_data(FourInts, [0, 0, 42, 1000])
fp = os.path.join(self.test_dir.name, 'artifact.qza')
artifact.save(fp)
metadata = Artifact.peek(fp)
self.assertIsInstance(metadata, ResultMetadata)
self.assertEqual(metadata.type, 'FourInts')
self.assertEqual(metadata.uuid, str(artifact.uuid))
self.assertEqual(metadata.format, 'FourIntsDirectoryFormat')
示例3: test_peek
# 需要導入模塊: from qiime.sdk import Artifact [as 別名]
# 或者: from qiime.sdk.Artifact import peek [as 別名]
def test_peek(self):
artifact = Artifact._from_view([0, 0, 42, 1000], FourInts, None)
fp = os.path.join(self.test_dir.name, 'artifact.qza')
artifact.save(fp)
metadata = Artifact.peek(fp)
self.assertIsInstance(metadata, ResultMetadata)
self.assertEqual(metadata.type, FourInts)
self.assertIsNone(metadata.provenance)
self.assertEqual(metadata.uuid, artifact.uuid)
示例4: test_peek_with_provenance
# 需要導入模塊: from qiime.sdk import Artifact [as 別名]
# 或者: from qiime.sdk.Artifact import peek [as 別名]
def test_peek_with_provenance(self):
artifact = Artifact._from_view({'foo': 'bar', 'baz': 'bazz'}, Mapping,
self.provenance)
fp = os.path.join(self.test_dir.name, 'artifact.qza')
artifact.save(fp)
metadata = Artifact.peek(fp)
self.assertIsInstance(metadata, ResultMetadata)
self.assertEqual(metadata.type, Mapping)
self.assertEqual(metadata.provenance, self.provenance)
self.assertEqual(metadata.uuid, artifact.uuid)
示例5: get_artifacts
# 需要導入模塊: from qiime.sdk import Artifact [as 別名]
# 或者: from qiime.sdk.Artifact import peek [as 別名]
def get_artifacts():
global ARTIFACTS
ARTIFACTS = {}
path = os.getcwd()
artifact_paths = list(glob.glob(os.path.join(path, '*.qza')))
artifacts = []
for artifact_path in artifact_paths:
try:
metadata = Artifact.peek(artifact_path)
name, _ = os.path.splitext(os.path.basename(artifact_path))
artifacts.append(
_result_record(metadata, name, '.inspect_artifact'))
ARTIFACTS[str(metadata.uuid)] = artifact_path
except Exception:
pass # TODO: do better things when this happens
return jsonify({'artifacts': artifacts})