uneven taxonomy and OTU table length after filtering

Hello all,
I ran into problems with merging OTU table and taxonomy names after filtering.
I filtered out mitochondria and chloroplast using the following code:

qiime taxa filter-table --i-table table.qza --i-taxonomy taxonomy.qza --p-mode exact --p-exclude ‘k__Bacteria; p__Cyanobacteria; c__Chloroplast; o__Streptophyta; f__; g__; s__’ --o-filtered-table table-filtered2.qza
qiime taxa filter-table --i-table table-filtered2.qza --i-taxonomy taxonomy.qza --p-mode exact --p-exclude ‘k__Bacteria; p__Proteobacteria; c__Alphaproteobacteria; o__Rickettsiales; f__mitochondria’ --o-filtered-table table-filtered.qza

after filtering, the exported OTU table have 4769 lines while the exported taxonomy table have 4806 lines. Because of the uneven length of OTU table and Taxonomy table, I had problems in merging them together. (The unfiltered tables does not have this issue, OTU table and taxonomy table have the same feature ID from up to down).

I tried to use

qiime taxa collapse --i-table table.qza --i-taxonomy taxonomy.qza --p-level 3 --o-visualization feature-table-class.qza

it returned error message “Collapse groups of features that have the same taxonomic assignment through the specified level. The frequencies of all features will be summed when they are collapsed.” The error message does not make sense to me because my level 3 taxonomy are different, not the same as the error message suggested.

Does anyone know how to solve this issue?
Thank you!

Hi @Karen_Yike_Shen!

That isn't an error message - that is the help text for the command:


Sounds to me like you didn't actually run the command, maybe try again? :t_rex:

Thank you thermokarst,
I realized from the help message that I put wrong output command. It should be “–o-collapsed-table” Now the problem is solved.
I was looking at this question while I tried to solve the question. The output command in this question is wrong too (It has the output as visualization)…How to add taxonomy to feature-table.qza and get otu id of each taxonomy and number of otus

Thanks @Karen_Yike_Shen - I fixed that post you linked to.