how to construct barplot after feature table grouping


Just wondering how to construct barplot after feature-table group. I grouped the table by sampling depth but it popped up error during barplot:

qiime taxa barplot \
--i-table grouped/table_groupby_depth_16s.qza \
--i-taxonomy taxonomy/taxonomy_mcm_16s.qza \
--m-metadata-file ../../metadata/metadata_16s.tsv \
--o-visualization taxonomy/barplot_grouped_mcm_16s.qzv

error msg:
Feature IDs found in the table are missing in the metadata: {'4inch', '8inch', '12inch'}

I am not sure how can I modify the metadata after grouping?



whenever you group a feature table, the axis you are grouping on (samples or features) adopt the group labels that you are using. In your case, you are grouping on the sample axis (grouping by sample depth, a column in your original metadata file). So you need to create a new metadata file that has sample IDs consisting of the column you used for grouping.

So in your case, you just need this:

sample-id whatever metadata columns you desire
4inch 4 inch sampling depth metadata
8inch 8 inch sampling depth metadata
12inch 12 inch sampling depth metadata

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.