Filter features from table-decontam

Hi, Thank you for developing this amazing tool.
I am working with low biomass samples and I am filtering out contamination by the decontam package in R.

In order to further analyze the data, how can I filter the species that I get from the csv file obtained by R from my taxonomy table?
I tried to convert the R file into a mapping.txt with a column where the species I wan to retain are false, and then run the filter features this way:

qiime feature-table filter-features --i-table s_taxonomy.qza --m-metadata-file combined.txt --p-where Subject=‘FALSE’ --o-filtered-table s_filtered.qza

but it gives back
TypeError: Argument to parameter ‘table’ is not a subtype of FeatureTable[Frequency]
Should I try another method?

I also wonder if it is a problem that the mapping file is transposed compared to the taxonomy (Features on column).
Thank you for your help

1 Like

:smile:

This is the correct command for filtering features out of a feature table — if you want to filter out whole taxonomic groups that are identified as contaminants, and those taxa are the feature IDs in your feature table, e.g., this is a feature table that is collapsed by taxonomic assignment (I assume this is all true, as the name of the input table is s_taxonomy.qza).

It looks like the only problem here is that your input table is not in the correct format. Do you know what format that file is? (you can drop it into view.qiime2.org to check the type/provenance). I'm guessing that you may have done something like convert the table to relative abundance? In which case you want the unconverted feature table (I am assuming that this was all done in QIIME2 prior to exporting and using decontam).

I'm not entirely familiar with the output of decontam — but my understanding is that you might typically use this to detect individual ASVs that are presumptive contaminants in a dataset, rather than whole taxonomic groups. In that case, you will want to instead output a TSV of individual ASVs as row names and a column of contaminant status (TRUE/FALSE), just as you are doing for taxa. Then filter in the same way. cc:ing @benjjneb here in case he has additional advice on this.

It sounds like your metadata file is in the correct format so this should not be the issue.

Let us know if you are able to figure out the correct format for that table — if all else fails, send us your metadata file and table and we can take a look. I hope that helps!

3 Likes

Hi guys, I managed to make it work, first exporting the demux.dada2 feature table to a biom file, converting it to an excel file, and from this on with R decontam package and finally filter-feature.
thank for the suggestions!

3 Likes

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