# Question about ANCOM BC2

**URL:** https://forum.qiime2.org/t/question-about-ancom-bc2/29878
**Category:** Other Bioinformatics Tools
**Tags:** longitudinal, ancom-bc2
**Created:** [April 13, 2024, 10:43am UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878 "2024-04-13T10:43:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Themis80](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/f08c70/32.png) [@Themis80](https://forum.qiime2.org/u/Themis80)
#### Post date: [April 13, 2024, 10:43am UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878/1 "2024-04-13T10:43:10Z")

</div>

Greetings,

I have three groups of microbial samples (A, B, C), and two different timepoints of sampling (baseline and follow up). Can I use ANCOM BC2 despite these NOT being cross-sectional data? (they are longitudinal, with two different time points).

Thank you in advance.

---

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [April 13, 2024, 2:10pm UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878/2 "2024-04-13T14:10:49Z")

</div>

Hello and welcome to the forum!

I would say, that it depends on the questions you want to answer!  
For example, if you want to compare groups B and C to A at time-point 0 as separate analysis, and then compare the same groups at time point 1 as another analysis, and then discuss the differences you can do it in Qiime2.  
If you want to perform longitudinal comparisons, you can use Ancombc2 R package, since Qiime2 only wraps cross-sectional designs.

Best,

---

<div class="post-metadata">

### Author: ![Themis80](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/f08c70/32.png) [@Themis80](https://forum.qiime2.org/u/Themis80)
#### Post date: [April 13, 2024, 3:31pm UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878/3 "2024-04-13T15:31:51Z")

</div>

Thank you for your answer. I have already used ancom bc2 in R for this project. It is just that I am not sure if it is theoretically correct. For example, if this was a standard t test, I would have to use a paired t test to compare baseline and follow up.

---

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [April 13, 2024, 3:36pm UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878/4 "2024-04-13T15:36:04Z")

</div>

As far as I know, Ancombc2 R supports longitudinal design. I am not very proficient with R, but I remember that in their R tutorial they have a separate section for that.

---

<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 13, 2024, 9:11pm UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878/5 "2024-04-13T21:11:33Z")

</div>

> [@Themis80](#):
>
> if this was a standard t test, I would have to use a paired t test to compare baseline and follow up.

Here's an example using a diet-swap cohort. This sounds very similar to your project!

[https://www.bioconductor.org/packages/release/bioc/vignettes/ANCOMBC/inst/doc/ANCOMBC2.html#run-ancom-bc2-on-a-real-longitudinal-dataset](https://www.bioconductor.org/packages/release/bioc/vignettes/ANCOMBC/inst/doc/ANCOMBC2.html#run-ancom-bc2-on-a-real-longitudinal-dataset)

(I've moved this to Other Bioinformatics Tools because there's not a qiime plugin for ANCOM-BC2... [yet!](https://github.com/qiime2/q2-composition/issues/132))

---

<div class="post-metadata">

### Author: ![Themis80](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/f08c70/32.png) [@Themis80](https://forum.qiime2.org/u/Themis80)
#### Post date: [April 15, 2024, 10:40am UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878/6 "2024-04-15T10:40:28Z")

</div>

Thank you for this example. I have seen this before, but I couldn't find the original study.

---

<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 15, 2024, 4:12pm UTC](https://forum.qiime2.org/t/question-about-ancom-bc2/29878/7 "2024-04-15T16:12:56Z")

</div>

Ah, here's the published paper: [Fat, fibre and cancer risk in African Americans and rural Africans | Nature Communications](https://www.nature.com/articles/ncomms7342)

It's part of the `microbiome` R package / GitHub org (confusing name, I know)

> **[microbiome](https://github.com/microbiome)**
>
> Microbiome research methods. microbiome has 44 repositories available. Follow their code on GitHub.

Perhaps this import makes it more clear:

```auto
library(microbiome)
data(dietswap) # from the package `microbiome`

```
