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


Python Visualization.peek方法代碼示例

本文整理匯總了Python中qiime.sdk.Visualization.peek方法的典型用法代碼示例。如果您正苦於以下問題:Python Visualization.peek方法的具體用法?Python Visualization.peek怎麽用?Python Visualization.peek使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qiime.sdk.Visualization的用法示例。


在下文中一共展示了Visualization.peek方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: inspect_visualization

# 需要導入模塊: from qiime.sdk import Visualization [as 別名]
# 或者: from qiime.sdk.Visualization import peek [as 別名]
def inspect_visualization(uuid):
    try:
        metadata = Visualization.peek(VISUALIZATIONS[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 Visualization [as 別名]
# 或者: from qiime.sdk.Visualization import peek [as 別名]
    def test_peek(self):
        visualization = Visualization._from_data_dir(self.data_dir, None)
        fp = os.path.join(self.test_dir.name, 'visualization.qza')
        visualization.save(fp)

        metadata = Visualization.peek(fp)

        self.assertIsInstance(metadata, ResultMetadata)
        self.assertEqual(metadata.type, qiime.core.type.Visualization)
        self.assertIsNone(metadata.provenance)
        self.assertEqual(metadata.uuid, visualization.uuid)
開發者ID:Kleptobismol,項目名稱:qiime2,代碼行數:13,代碼來源:test_visualization.py

示例3: test_peek

# 需要導入模塊: from qiime.sdk import Visualization [as 別名]
# 或者: from qiime.sdk.Visualization import peek [as 別名]
    def test_peek(self):
        visualization = Visualization._from_data_dir(
            self.data_dir, self.make_provenance_capture())
        fp = os.path.join(self.test_dir.name, 'visualization.qzv')
        visualization.save(fp)

        metadata = Visualization.peek(fp)

        self.assertIsInstance(metadata, ResultMetadata)
        self.assertEqual(metadata.type, 'Visualization')
        self.assertEqual(metadata.uuid, str(visualization.uuid))
        self.assertIsNone(metadata.format)
開發者ID:qiime2,項目名稱:qiime2,代碼行數:14,代碼來源:test_visualization.py

示例4: get_visualizations

# 需要導入模塊: from qiime.sdk import Visualization [as 別名]
# 或者: from qiime.sdk.Visualization import peek [as 別名]
def get_visualizations():
    global VISUALIZATIONS
    VISUALIZATIONS = {}
    path = os.getcwd()
    viz_paths = list(glob.glob(os.path.join(path, '*.qzv')))
    visualizations = []
    for viz_path in viz_paths:
        try:
            metadata = Visualization.peek(viz_path)
            name, _ = os.path.splitext(os.path.basename(viz_path))
            VISUALIZATIONS[str(metadata.uuid)] = viz_path
            visualizations.append(
                _result_record(metadata, name, '.inspect_visualization'))
        except Exception:
            pass  # TODO: do better things when this happens

    return jsonify({'visualizations': visualizations})
開發者ID:robertoalvarezm,項目名稱:qiime-studio,代碼行數:19,代碼來源:workspace.py


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