view barplot after decontam being imported


After using decontam in R, I exported the OTU table in biom format and imported it into qiime2:

!qiime tools import \
--input-path $decontam \
--type 'FeatureTable[Frequency]' \
--input-format BIOMV100Format \
--output-path decontam-feature-table.qza

Then when I proceeded to barplot:

!qiime taxa barplot \
--i-table decontam-feature-table.qza \
--i-taxonomy taxonomy/taxonomy_mcm_16s.qza \
--m-metadata-file ../../metadata/metadata_16s.tsv \
--o-visualization taxonomy/decontam_barplot_mcm_16s.qzv

It would generate error: "missing following feature IDs" because I think decontam has dropped some the ID, and those are not found in the orignal classifier and provenance.

Question1: The taxonomy.qza should contain the existing IDs, why not just mapping those instead of requiring all IDs?

My workaround is to generate a list of contaminant features and filter those out in the original feature table:

!qiime feature-table filter-features \
--i-table table_mcm_16s.qza \
--m-metadata-file decontam/contaminates.txt \
--p-exclude-ids True \
--o-filtered-table decontam_filtered_table.qza

!qiime taxa barplot \
--i-table decontam_filtered_table.qza \
--i-taxonomy taxonomy/taxonomy_mcm_16s.qza \
--m-metadata-file ../../metadata/metadata_16s.tsv \
--o-visualization taxonomy/decontammed_barplot_mcm_16s.qzv

Q2: This would work, but I am not sure if it is correct?
Q3: In the decontam-feature-table.qza and decontam_filtered_table.qza have different sample size (605 vs 606) and median frequency (17861 vs 19122 ) . Can you shed some lights into that?

Thank youdecontam-feature-table.qzv (4.1 MB) decontam_filtered_table.qzv (4.5 MB)

As far as I can tell (you have not sent the actual error message with traceback), this error occurs when the taxonomy is missing feature IDs that are found in the table, not the other way around. So this is working as intended — you do not want barplot to silently drop features from your table just because you have incomplete feature data.

Yes this looks like the more appropriate way to do this, because it sounds like converting the feature table in R and then importing to QIIME 2 is possibly corrupting the feature IDs or some other information in the table.

Again, I think something is going wrong in R. Instead of spending too much type sorting out why, I suggest just filtering your Q2 table with a list of feature IDs as you have done.

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