コード例 #1
0
 def test_biplot(self):
     with tempfile.TemporaryDirectory() as output_dir:
         biplot(output_dir, self.biplot,
                sample_metadata=self.metadata)
         index_fp = os.path.join(output_dir, 'index.html')
         self.assertTrue(os.path.exists(index_fp))
         self.assertTrue('src="./emperor.html"' in open(index_fp).read())
コード例 #2
0
ファイル: test_plot.py プロジェクト: jakereps/q2-emperor
 def test_biplot(self):
     with tempfile.TemporaryDirectory() as output_dir:
         biplot(output_dir, self.biplot,
                sample_metadata=self.metadata)
         index_fp = os.path.join(output_dir, 'index.html')
         self.assertTrue(os.path.exists(index_fp))
         self.assertTrue('src="./emperor.html"' in open(index_fp).read())
コード例 #3
0
    def test_biplot_with_feature_metadata(self):
        feat_md = qiime2.Metadata(
            pd.DataFrame(index=pd.Index(['x', 'y', 'z'], name='feature id'),
                         columns=['k', 'p'],
                         data=[['Bacteria', 'Firmicutes'],
                               ['Bacteria', 'Firmicutes'],
                               ['Bacteria', 'Bacteroidetes']]))

        with tempfile.TemporaryDirectory() as output_dir:
            biplot(output_dir, self.biplot,
                   sample_metadata=self.metadata, feature_metadata=feat_md)
            index_fp = os.path.join(output_dir, 'index.html')
            self.assertTrue(os.path.exists(index_fp))
            self.assertTrue('src="./emperor.html"' in open(index_fp).read())
コード例 #4
0
ファイル: test_plot.py プロジェクト: jakereps/q2-emperor
    def test_biplot_with_feature_metadata(self):
        feat_md = qiime2.Metadata(
            pd.DataFrame(index=pd.Index(['x', 'y', 'z'], name='feature id'),
                         columns=['k', 'p'],
                         data=[['Bacteria', 'Firmicutes'],
                               ['Bacteria', 'Firmicutes'],
                               ['Bacteria', 'Bacteroidetes']]))

        with tempfile.TemporaryDirectory() as output_dir:
            biplot(output_dir, self.biplot,
                   sample_metadata=self.metadata, feature_metadata=feat_md)
            index_fp = os.path.join(output_dir, 'index.html')
            self.assertTrue(os.path.exists(index_fp))
            self.assertTrue('src="./emperor.html"' in open(index_fp).read())