Handling paired before/after microbiome data

Hi everyone,

I am working on analyzing the microbiome of a specific human body site to compare patients before and after a clinical intervention. Because the data is collected from the exact same patients at two different time points, the samples are inherently correlated (a strictly paired/repeated-measures design).

For alpha diversity, my current plan is to evaluate normality and proceed with either a parametric approach (Paired t-test) or a non-parametric approach (Wilcoxon signed-rank test).

However, I could use some guidance on the subsequent steps of the analysis:

  1. Beta Diversity (PERMANOVA): Does anyone have advice on how to properly implement this before/after design in a PERMANOVA to evaluate shifts in beta diversity?
  2. Differential Abundance (DA) Analysis: Which differential abundance tools do you highly recommend for this type of paired design?

Any insights, R package recommendations, or links to similar analytical workflows would be greatly appreciated.

Thank you in advance!

Hi @kbenmd,
I think QIIME 2 might have what you want.

For beta diversity:

Have you checked out q2-longitudinal? longitudinal - Microbiome marker gene analysis with QIIME 2. I think thepairwise-distances might be what you are looking for but there is a ton of cool longitudinal analyses that might be useful!

For differential abundance:

ANCOM-BC2 is able to account for repeated measure so that would be my recommendation for differential abundance. ANCOM-BC2 is also available in QIIME 2. composition - Microbiome marker gene analysis with QIIME 2

Here are the docs I like to reference when using ANCOMBC2 for repeated measures: ANCOM-BC2 Tutorial

I hope all this helps

5 Likes

Hi @kbenmd and @cherman2,

Hopefully its okay that I mention it. I've used gemelli CTF a few times for both beta diverisity and sort of differential abundance. I like it because it does the deltas for me, and becuase I can look at orientation more easily. (Is there directionality in PCA space). Since CTF/PCA are grounded in features, I can translate that direction to changing taxa.

Best,
Justine

1 Like

An off-topic reply has been merged into an existing topic: Is ANCOM-BC2 the best choice for my data?

Please keep replies on-topic in the future.

Hi Chloe and Justine,

Thank you both so much for the detailed recommendations!

Since I am not very experienced with Python and QIIME 2, I have been running my entire workflow in R. To account for the repeated-measures design, I used a PERMANOVA restricted to each patient ID using adonis2.

Here is the code I ran:

perm_w <- adonis2(unifrac_w_hd ~ Timepoint, data = meta_hd_plot,
strata = meta_hd_plot$Patient_ID, permutations = 9999)
perm_b <- adonis2(bray_hd ~ Timepoint, data = meta_hd_plot,
strata = meta_hd_plot$Patient_ID, permutations = 9999)
perm_a <- adonis2(aitchison_dist ~ Timepoint, data = meta_hd_plot,
strata = meta_hd_plot$Patient_ID, permutations = 9999)

I am running into a visualization issue, however. The restricted PERMANOVA results are significant, but my standard PCoA plots do not reflect this because they display the ordination without any stratification. Does anyone have suggestions on how to better plot these results in R so the visual aligns with the restricted PERMANOVA?

1 Like

Hi @kbenmd,

In general, most people get better performance out of learning to use existing well tested, well documented tools rather than trying to re-invent the wheel. Broadening your horizons will give you more opportunities. I also think q2-longitudinal gives you some new ways to think about your data and associated tests.

I agree with your intuition that this visualziation doesn't communicate what you'd like to say; depending on what the assumptions of the comparison are, you could look at changes in direction (I tend to only do this is the rPCA context where the axes are meaningful and not with a straight up PCoA where they're not) or changes in distance between groups. So, I've used boxplots/strip plots, and vectors to show deltas in various contexts, treating the first time point as a reference position and then measuring either distance or change in ordination space from that point.

Of course, if you're going to visualize the data that way, you might decide to just drop the permanova ll together and look at how the magnitude of change (distance) compares for your exposures and unexposed groups.

Best,
Justine

1 Like