Hi,
I need to know how to display a specific metadata in a heatmap without redundancy
I am using this code to generate a heatmap of collapsed feature table to the phyla level in samples that are categorized by plant genus . I mean, I have only 5 plant genera as a source of 63 samples. but, the heatmap displayed by sampleID+the plant genus which look redundant (repetitive plant genera). Is there a way to collapse the metadata.
Yes. The idea is to use feature-table group to combine samples so you just have 5 samples (one for each of your five plants ), then make a heatmap of this grouped table.
Not within this plugin... yet! That would be a cool feature to add to the plugin.
I grouped the metadata column
qiime feature-table group
–i-table table-no-mito-no-chlor-l2.qza
–p-axis sample
–m-metadata-file metadata.tsv
–m-metadata-column “PlantGenus”
–p-mode sum
–o-grouped-table tableheatmap.qza
The following IDs are not present in the metadata: then listing the 5 plant genera names
–verbose
Traceback (most recent call last):
File “/home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/q2cli/commands.py”, line 328, in call
results = action(**arguments)
File “</home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/decorator.py:decorator-gen-342>”, line 2, in heatmap
File “/home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 240, in bound_callable
output_types, provenance)
File “/home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 445, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/q2_feature_table/_heatmap/_visualizer.py”, line 121, in heatmap
table = _munge_sample_metadata(sample_metadata, table, cluster)
File “/home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/q2_feature_table/_heatmap/_visualizer.py”, line 79, in _munge_sample_metadata
metadata = metadata.filter_ids(table.index)
File “/home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/qiime2/metadata/metadata.py”, line 1105, in filter_ids
ids_to_keep)
File “/home/eman/anaconda3/envs/qiime2-2019.10/lib/python3.6/site-packages/qiime2/metadata/metadata.py”, line 198, in _filter_ids_helper
% (’, '.join(repr(e) for e in sorted(missing_ids))))
ValueError: The following IDs are not present in the metadata: ‘Genus1’, ‘Genus2’, ‘Genus3’, ‘Genus4’, ‘Genus5’
I think by grouping we lost the primary key of data tables; sample_Id.
It works! I am super happy. Thank you so much! Indeed, I intended to generate heatmaps for this project in qiime since the phyloseq object is missing almost half of the samples, I do not know why? I am using the same script that I have used for other projects! Feature taxonomy table.biom has 63 samples and qiime qza files show 63 samples, but the object in R shows only 37 samples. I know almost 1/3 of my samples have very low read counts but they should exist.
One more question, is there a way to select the top50/20 taxa? So far, I think I can keep them by using --p-min-frequency