ANCOM- BC pre-processing

Hi all,
I am new to ANCOM-BC and have a couple of questions.
My first question is about rare taxa filtering. Is it recommended to remove rare taxa before running ANCOM-BC? If so, what are commonly used thresholds for minimum frequency and minimum prevalence?
My second question is about rarefaction. Since ANCOM-BC includes bias correction to account for unequal sampling depth, is rarefaction still necessary or recommended before running the analysis?

Thank you!

Hello again Asmaa,

Yes! And people have discussed how they do it including Justine and Nick.

As an example to get you started, the Gut-to-soil axis tutorial shows how to use a prevalence filter:

qiime feature-table filter-features \
  --i-table asv-table.qza \
  --p-min-samples 2 \
  --o-filtered-table asv-table-ms2.qza

Not for this method!

Thank you Colin for the information. I have a follow-up question about my own experiment. I am studying changes in the microbial community in response to disease infection across 2 genotypes, 2 fields, and 3 collection points. My goal is to determine which features differ in abundance between genotypes within the same field at each collection point. To do this, I split my feature table into 3 separate tables based on collection point, and plan to run ANCOM-BC on each table using the following script :

qiime composition ancombc
--i-table 16sSwap_genuslevel_first.qza
--m-metadata-file 16sSwaps_metadata.txt
--p-formula "genotype + field"
--p-reference-levels "genotype::R"
--p-alpha 0.05
--p-p-adj-method BH
--o-differentials 16s-Swap-DA-genotype-first.qza

Is this the correct approach to compare genotypes within each field and collection point?

1 Like

@asmaamorsi, I'm going to ask the ANCOMBC developer to jump in here to advise. One recommendation though - I would use ANCOMBC2 now, as this is the more modern method. This is illustrated in the gut-to-soil tutorial that @colinbrislawn linked you to.

2 Likes

Thanks for looping me in, @gregcaporaso !

Hi @asmaamorsi , I think your current model tests the main effect of genotype, adjusted for field. It doesn’t directly test “genotype differences within each field.”

For your goal, comparing genotypes within the same field at each collection point, you can fit an interaction model at each collection point, e.g.:

--p-formula "genotype * field"
--p-reference-levels "genotype::R" "field::FIELD_REFERENCE"

You may find this post helpful for the interaction-term syntax.

I also agree with Greg’s suggestion to use ANCOMBC2 for now.

Best,

5 Likes

Thank you for your input @hulfred!

Thank you for the information. I tried running the analysis following the same function, however I got the following error:

"An error was encountered while running ANCOM-BC in R (return code 1). Please inspect stdout and stderr to learn more. Debug info has been saved to /tmp/local/6687463/qiime2-q2cli-err-kht9x_yx.log"

I tried to open the file to read the error, but it was empty.

One of the treatments in my experiment has only 2 samples. Could this be the reason for the error?

I am not entirely sure about this error message, @colinbrislawn would you mind chiming in?

Hey @asmaamorsi,

Could you re-run your command with the --verbose flag enabled? This will give us a more detailed error message so we can see where the issue is coming from. Thanks! :lizard:

1 Like