When to rarefy feature table


I am confused when I should have rarefied my feature table.

I downloaded my feature table in biom format and used the R decontam package to remove contaminant ASV’s from the table. I then re-imported to QIIME2 to create new taxa bar plots etc.

I have noticed that although I rarefied as part of the alpha/beta diversity measures I have not rarefied the table.

I think I should have used the “qiime feature-table rarefy” command but not sure when…
Should I have rarefied the first table prior to decontam?
Or can I rarefy the current table post decontam?

Welcome to the forum, @alicias1!

It sounds like you probably did everything correctly:

Rarefaction is performed automatically in the core-metrics pipelines, set using the sequence depth parameter.

Rarefaction is not typically necessary for other analysis steps… e.g., all differential abundance tests in various plugins (like ANCOM or aldex2 or songbird) have their own normalization steps built in and data should not be rarefied prior to passing to these methods.

The rarefy method in feature-table is run automatically as part of the core-metrics pipelines, and typically the only time you will want to use it is if you are not using core-metrics for some reason.

Good luck!


Thanks for the speedy reply!

I am trying to do my statistics in R on my feature table collapsed at the genus level. I think the data in this table is counts of how many times each taxa appears in each sample?

The number of counts in each sample vary a lot between my samples so I think I may need to do some sort of normalisation. I have been reading this paper : https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003531
I was planning to try abundance analysis on my table using a mixed model as it suggests instead of rarefying the table. Is this a good approach?

Okay now I understand.

I thought your workflow was something like this:
QIIME 2 --> export to biom --> decontam --> import back into QIIME 2 --> core-metrics

In which case that’s all good… rarefaction would happen with core-metrics, which is where you need it.

If you are doing analyses in R that require rarefaction, then you should either rarefy in QIIME 2 (post-decontam!) before exporting, or rarefy in R.

Do not rarefy prior to exporting and using decontam… since decontam uses feature counts to identify putative contaminants I can only assume that altering those counts through rarefaction will throw the whole thing off (but I’m not 100% sure).

But if you workflow is something like this:
QIIME 2 --> export --> decontam --> more analysis in R that requires rarefaction

Then do something like this
QIIME 2 --> export --> decontam --> rarefy --> more analysis in R that requires rarefaction


Yes! Some sort of normalization is required. Rarefaction is historically a very commonly used and well accepted method of normalizing for differences in sampling depth… but obviously not without controversy. It is still very commonly used for diversity statistics, but not for differential abundance analysis. So…

All of the differential abundance methods in QIIME 2 use their own normalization approaches NOT rarefaction, the literature on differential abundance has advanced quite a bit in recent years… so this may be easier than going outside of QIIME 2 to perform such analyses. See q2-composition, q2-aldex2, and q2-songbird for examples.

Note, there are also diversity analyses implemented in some QIIME 2 plugins that also use different normalization approaches rather than rarefaction, like DEICODE and q2-breakaway. See the QIIME 2 library for details on all of these: https://library.qiime2.org/plugins/

1 Like

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