Remove features based on per-sample frequency

I want to remove features with per-sample frequency of less than 10.

I understand "qiime feature-table filter-features" remove all features with a total abundance (summed across all samples) of less than 10 (--p-min-frequency 10). I could not find a script to remove features with per-sample frequency. Plugin qiime feature-table filter-features-conditionally can filter based on relative frequency. I would appreciate if you could help me with this.


Good morning!

I think you found the right plugins, but I'm not sure they do this...

As you have discovered, these plugins will remove features from the full table, like this

Sample:Feature ASV1 ASV2 ASV3
Sample1 12 7 56
Sample2 77 1 14
Sample3 17 0 30
Keep? :white_check_mark: :no_entry_sign: :white_check_mark:

It sounds like you want to 'zero out' values from the table, say with a value less than 2:

Sample:Feature ASV1 ASV2 ASV3
Sample1 12 7 56
Sample2 77 0! :scream_cat: 14
Sample3 17 0 30

This direct modification is possible in R or Python, but I don't think Qiime2 supports this directly because this sort of per-cound feature modification can be problematic.

Note how zeroing out ASV2 from Sample2 changes the distribution of reads in both ASV2 and Sample2. ASV2 now has the same value in Sample2 and Sample3, which was not originally the case. This tricky situation is avoided with a filter that keeps or removes ASVs from the full table.

'Zeroing out' is possible, but reviewer three is going to have questions. :upside_down_face:

Thanks for explaining the pitfalls of selectively "zeroing out" ASVs in a sample. However, I feel that ASV2 in Sample2 is most likely a cross contamination and wanted to get rid of it. Based on your rationale, I will not attempt per-sample filtering and continue with filtering across the full table.
Thanks a lot.

1 Like

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