Esempio n. 1
0
    def test_with_metadata(self):
        md = qiime2.CategoricalMetadataColumn(
            pd.Series(['milo', 'summer', 'russ'], name='pet',
                      index=pd.Index(['S1', 'S2', 'S3'], name='id')))
        heatmap(self.output_dir, self.table, metadata=md)

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 2
0
    def test_table_ids_are_subset_of_metadata_ids(self):
        md = qiime2.CategoricalMetadataColumn(
            pd.Series(['milo', 'russ'], name='pet',
                      index=pd.Index(['S1', 'S3'], name='id')))

        with self.assertRaisesRegex(ValueError, 'not present.*S2'):
            heatmap(self.output_dir, self.table, metadata=md)
Esempio n. 3
0
    def test_with_feature_metadata(self):
        feature_md = qiime2.CategoricalMetadataColumn(
            pd.Series(['peanut', 'dog'], name='species',
                      index=pd.Index(['O1', 'O2'], name='id')))
        heatmap(self.output_dir, self.table, feature_metadata=feature_md)

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 4
0
    def test_with_metadata(self):
        md = qiime2.CategoricalMetadataColumn(
            pd.Series(['milo', 'summer', 'russ'], name='pet',
                      index=pd.Index(['S1', 'S2', 'S3'], name='id')))
        heatmap(self.output_dir, self.table, metadata=md)

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 5
0
    def test_table_ids_are_subset_of_metadata_ids(self):
        md = qiime2.CategoricalMetadataColumn(
            pd.Series(['milo', 'russ'], name='pet',
                      index=pd.Index(['S1', 'S3'], name='id')))

        with self.assertRaisesRegex(ValueError, 'not present.*S2'):
            heatmap(self.output_dir, self.table, metadata=md)
    def test_extra_metadata_ids(self):
        md = qiime2.MetadataCategory(
            pd.Series(['milo', 'summer', 'russ', 'peanut'],
                      name='pet',
                      index=['S1', 'S2', 'S3', 'S4']))

        heatmap(self.output_dir, self.table, metadata=md)

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 7
0
    def test_no_sample_cluster(self):
        md = qiime2.CategoricalMetadataColumn(
            pd.Series(['milo', 'summer', 'russ'], name='pet',
                      index=pd.Index(['S1', 'S2', 'S3'], name='id')))

        heatmap(self.output_dir, self.table, sample_metadata=md,
                cluster='features')

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 8
0
    def test_with_sample_and_feature_metadata(self):
        md = qiime2.CategoricalMetadataColumn(
            pd.Series(['milo', 'summer', 'russ'], name='pet',
                      index=pd.Index(['S1', 'S2', 'S3'], name='id')))
        feature_md = qiime2.CategoricalMetadataColumn(
            pd.Series(['peanut', 'dog'], name='species',
                      index=pd.Index(['O1', 'O2'], name='id')))
        heatmap(self.output_dir, self.table, sample_metadata=md,
                feature_metadata=feature_md)

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 9
0
    def test_with_title(self):
        heatmap(self.output_dir, self.table, title='foo')

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 10
0
    def test_defaults(self):
        heatmap(self.output_dir, self.table)

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 11
0
    def test_no_normalization(self):
        heatmap(self.output_dir, self.table, normalize=False)

        self.assertBasicVizValidity(self.output_dir, normalize=False)
Esempio n. 12
0
    def test_empty_table(self):
        empty_table = pd.DataFrame([], [], [])

        with self.assertRaisesRegex(ValueError, 'empty'):
            heatmap(self.output_dir, empty_table)
Esempio n. 13
0
    def test_with_title(self):
        heatmap(self.output_dir, self.table, title='foo')

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 14
0
    def test_defaults(self):
        heatmap(self.output_dir, self.table)

        self.assertBasicVizValidity(self.output_dir)
Esempio n. 15
0
    def test_empty_table(self):
        empty_table = pd.DataFrame([], [], [])

        with self.assertRaisesRegex(ValueError, 'empty'):
            heatmap(self.output_dir, empty_table)
Esempio n. 16
0
    def test_no_normalization(self):
        heatmap(self.output_dir, self.table, normalize=False)

        self.assertBasicVizValidity(self.output_dir, normalize=False)
    def test_table_ids_are_subset_of_metadata_ids(self):
        md = qiime2.MetadataCategory(
            pd.Series(['milo', 'russ'], name='pet', index=['S1', 'S3']))

        with self.assertRaisesRegex(ValueError, 'Missing'):
            heatmap(self.output_dir, self.table, metadata=md)