當前位置: 首頁>>代碼示例>>Python>>正文


Python Artifact.peek方法代碼示例

本文整理匯總了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})
開發者ID:robertoalvarezm,項目名稱:qiime-studio,代碼行數:9,代碼來源:workspace.py

示例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')
開發者ID:qiime2,項目名稱:qiime2,代碼行數:13,代碼來源:test_artifact.py

示例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)
開發者ID:Kleptobismol,項目名稱:qiime2,代碼行數:13,代碼來源:test_artifact.py

示例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)
開發者ID:Kleptobismol,項目名稱:qiime2,代碼行數:14,代碼來源:test_artifact.py

示例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})
開發者ID:robertoalvarezm,項目名稱:qiime-studio,代碼行數:19,代碼來源:workspace.py


注:本文中的qiime.sdk.Artifact.peek方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。