qiime taxa filter-table removing wrong taxa


I'm trying to filter my feature table based on a taxonomic list of desired bugs (taxa_to_keep_donors.txt (1.3 KB)).

I broke it down into two steps, first:
Include generally everything I want (but there were a few taxa left to remove):

qiime taxa filter-table \
--i-table ../../filtered_table_min2samp.qza \
--i-taxonomy ../../taxonomy_silva138-99.qzv.qza \
--p-include Rothia,Bacteroidales,Streptococcus,Ruminiclostridium,ventriosum_group,xylanophilum_group,Butyrivibrio,Lachnospiraceae_UCG-006,UCG_003,incertae_Sedis,Negativibacillus,Anaerovoracaceae,Proteus,Oscillospiraceae \
--o-filtered-table filtered_all_taxa_to_keep.qza

This provided a table that I expected (after collapsing, converting to relative frequency, exporting, and converting to txt)
rel_freq_keep_L6.txt (56.6 KB)
I then went to exclude the extra taxa:

qiime taxa filter-table \
--i-table filtered_all_taxa_to_keep.qza \
--i-taxonomy ../../taxonomy_silva138-99.qzv.qza \
--p-exclude uncultured,UCG-005,DTU014,Colidextribacter,intestinimonas,NK4A214,Oscillibacter,Papillibacter,Pseudoflavonifractor \
--o-filtered-table filtered_lefse_taxa_temp.qza

This step is, unfortunately, removing taxa that don't match the exclusion terms (as far as I can tell).
rel_freq_lefse_taxa_L6_temp.txt (24.9 KB)

Taxa removed that I don't think meet the exclusion criteria:


I did a search on the first filtering table and each of the exclusion words only showed up once, so I'm not sure why the other taxa are being excluded.

What am I doing wrong in the exclusion step that these extra taxa are being removed?


I am totally not sure in my answer, and I do not know if it will work or not, but could you try to provide each of your patterns in ""?

Hi Timur,

Unfortunately, adding quotes around each pattern did not solve the issue. The table looks the same as the one posted before.

qiime taxa filter-table \
--i-table filtered_all_taxa_to_keep.qza \
--i-taxonomy ../../taxonomy_silva138-99.qzv.qza \
--p-exclude "uncultured","UCG-005","DTU014","Colidextribacter","intestinimonas","NK4A214","
Oscillibacter","Papillibacter","Pseudoflavonifractor" \
--o-filtered-table filtered_lefse_taxa_temp_v2.qza


That's a mystery to me.
But, is it possible that all errorously filtered taxa in your taxonomy file contain one of the patterns at level 7? For example, "uncultured".

You are right, the missing taxa had "uncultured" at level 7. I was able to fix this by excluding g__uncultured instead of just uncultured.

Thanks for your help!

1 Like

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