Using ANCOM to identify diferentially abundant features

I would like to use ANCOM to identify differentially abundant features across groups. The feature tables are less intuitive to me than in QIIME 1 and I’m having trouble determining whether ANCOM is making its calculations based on relative abundances of the features. I tried using the

qiime feature-table relative-frequency

command to convert my feature-table to relative abundances, but the ANCOM command (qiime composition ancom) could not use that as an input table.

Thanks.

Hi @linneakh! Did you add a psuedo-count to your table?

$ qiime composition add-pseudocount \
  --i-table table.qza \
  --o-composition-table comp-table.qza

There is a little bit of discussion about why this needs to happen in the Moving Pictures Tutorial. Hope that helps!

I had actually forgotten this step. However, I just tried this and it still wouldn’t accept the f table with relative abundances as a valid table, giving me the following error.

Plugin error from composition:

Argument to input ‘table’ is not a subtype of FeatureTable[Frequency].

I guess my question is whether using the FeatureTable[Frequency] to do ANCOM automatically calculates differential abundances based on relative abundances or absolute feature abundances, or if it doesn’t, how to do this.

I had actually forgotten this step. However, I just tried this and it still wouldn’t accept the f table with relative abundances as a valid table, giving me the following error.
Plugin error from composition:

Argument to input ‘table’ is not a subtype of FeatureTable[Frequency].

Okay! Unfortunately the add-psuedocount method only accepts FeatureTable[Frequency], not FeatureTable[RelativeFrequency].

So the flow should look like this:

FeatureTable[Frequency] is used as input to add-psuedocount, which outputs a FeatureTable[Composition], which can then be used as input to ancom.

I guess my question is whether using the FeatureTable[Frequency] to do ANCOM automatically calculates differential abundances based on relative abundances or absolute feature abundances, or if it doesn’t, how to do this.

I am going to ping @mortonjt for his thoughts on this!

2 Likes

The reason why we aren’t doing this is because of the pseudocount scheme. Because we are dealing with raw counts, we want to add a single pseudocount to smooth out the zeros before processing into ANCOM.
So for the time being, we don’t want add-pseudocount to accept tables of FeatureTable[RelativeFrequency], because if you have already converted your counts to proportions, adding 1 or more to your features would give you completely misleading results (i.e. 1 is very large compared to most microbial proportions)

Now there are ways to smooth out zeros when dealing with proportions. In fact, we do already have a procedure implemented in scikit-bio that can be found here. If there is sufficient interest, we can make this option available in qiime2 in the future.

3 Likes

@mortonjt, can you edit your post to provide the scikit-bio link? Looks like it got dropped.