# ANCOM- BC pre-processing

**URL:** <https://forum.qiime2.org/t/ancom-bc-pre-processing/34155>\
**Category:** General Discussion\
**Created:** [April 29, 2026, 12:13pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155 "2026-04-29T12:13:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![asmaamorsi](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/a/48db29/32.png) [@asmaamorsi](https://forum.qiime2.org/u/asmaamorsi)\
**Post date:** [April 29, 2026, 12:13pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/1 "2026-04-29T12:13:23Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)\
**Post date:** [April 30, 2026, 3:50pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/2 "2026-04-30T15:50:50Z")

</div>

Hello again Asmaa,

> [@asmaamorsi](#):
>
> 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?

Yes! And people have discussed how they do it including [Justine](https://forum.qiime2.org/t/ancom-tutorial-do-i-need-to-filter-my-table/13860/5) and [Nick](https://forum.qiime2.org/t/ancom-running-for-30-hours/3991/3).

As an example to get you started, the [Gut-to-soil axis tutorial](https://amplicon-docs.qiime2.org/en/stable/tutorials/gut-to-soil/) shows how to use a prevalence filter:

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

```

> [@asmaamorsi](#):
>
> is rarefaction still necessary

Not for this method!

---

<div class="post-metadata">

**Author:** ![asmaamorsi](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/a/48db29/32.png) [@asmaamorsi](https://forum.qiime2.org/u/asmaamorsi)\
**Post date:** [April 30, 2026, 6:24pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/3 "2026-04-30T18:24:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gregcaporaso](https://forum.qiime2.org/user_avatar/forum.qiime2.org/gregcaporaso/32/17769_2.png) [@gregcaporaso](https://forum.qiime2.org/u/gregcaporaso)\
**Post date:** [May 4, 2026, 8:27pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/5 "2026-05-04T20:27:19Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![hulfred](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/h/ad7895/32.png) [@hulfred](https://forum.qiime2.org/u/hulfred)\
**Post date:** [May 4, 2026, 10:59pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/6 "2026-05-04T22:59:12Z")

</div>

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.:

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

```

You may find [this post](https://forum.qiime2.org/t/interpretation-of-ancombc-output-when-using-interactions-in/28035/9) helpful for the interaction-term syntax.

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

Best,

---

<div class="post-metadata">

**Author:** ![gregcaporaso](https://forum.qiime2.org/user_avatar/forum.qiime2.org/gregcaporaso/32/17769_2.png) [@gregcaporaso](https://forum.qiime2.org/u/gregcaporaso)\
**Post date:** [May 5, 2026, 8:16pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/7 "2026-05-05T20:16:09Z")

</div>

Thank you for your input @hulfred!

---

<div class="post-metadata">

**Author:** ![asmaamorsi](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/a/48db29/32.png) [@asmaamorsi](https://forum.qiime2.org/u/asmaamorsi)\
**Post date:** [May 6, 2026, 2:23am UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/8 "2026-05-06T02:23:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![hulfred](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/h/ad7895/32.png) [@hulfred](https://forum.qiime2.org/u/hulfred)\
**Post date:** [May 6, 2026, 1:48pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/9 "2026-05-06T13:48:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)\
**Post date:** [May 6, 2026, 1:52pm UTC](https://forum.qiime2.org/t/ancom-bc-pre-processing/34155/10 "2026-05-06T13:52:07Z")

</div>

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! 🦎
