Taxa filter not filtering; can you filter collapsed tables?

Good afternoon,

I am working on trying to filter out taxa with no identifiers (i.e., ;;) from my FeatureData[Frequency] tables and, then collapsing them to a taxonomic level using the qiime taxa collapse command.

I have been using the following command for filtering:

qiime taxa filter-table
–i-table table1.qza
–i-taxonomy taxonomy.qza
–p-include “D_5__”
–p-mode contains
–p-exclude “;__”
–o-filtered-table table2.qza

To my understanding, this should keep all taxa resolved to D_5__ (genus) and which contains a taxonomic name, but discard any taxa that contained unassigned taxa down to a genus level (i.e. D_0__Bacteria;D_1__Actinobacteria;D_2__Actinobacteria;D_3__Corynebacteriales;; should be removed).

I am then attempting to collapse my filtered table to a genus level using the following command:

qiime taxa collapse --i-table table2.qza --i-taxonomy taxonomy.qza --p-level 6 --o-collapsed-table genus_table.qza

Both commands run fine and produce FeatureData[Frequency] tables, though still contain unassigned taxa.

Now that I write this out, is this a case where using the *qiime feature-table filter-features" command might work on the collapsed table? I cannot use the qiime taxa filter command on the collapsed table because the “ASVs”/Features are no longer hash codes but taxonomic lineages. Is there an easy way to use the “–p-where” command that would allow me to filter out unassigned taxa in my collapse table?

I’ll leave this here while I go try it out myself, but any suggestions would be greatly appreciated (particularly if there is some flaw in my code/method above).

Best,

Alex

Not quite. This would keep any feature that contains “D_5__” somewhere in its annotation. There needn’t be anything else… so “D_0__Bacteria;D_1__Bacteria;D_2__Bacteria;D_3__Bacteria;D_4__Bacteria;D_5__Unknown” would still pass.

Also not quite. This line is not doing what you think it does:

Because “;__” is probably not contained on any line (or at least it is not in the SILVA taxonomy).

Yes, this particular taxon should be removed by this line:

Yes, that would work

Actually, that would work too… but you would need to create a FeatureData[Taxonomy] artifact in which the feature IDs are all unique taxa labels, and the labels match these. You would need to make that outside of QIIME 2.

You could just create a TSV file in which each line contains an exact taxon ID that you want to remove, and an appropriate header line. Input that as metadata and leave out the --p-where option.

Hopefully that gets you on the right path!

2 Likes

Thanks for your very thorough reply, Nicholas! With your clarification on some of my misinterpretations, I expect I should be able to accomplish what I need to now.

Cheers!

3 Likes

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