Q2 beta-div PERMANOVA results different from adonis in R

This is similar to the question posted in this thread, which has been closed·
Q2 PERMANOVA p-vals consistently lower than Vegan Adonis p-vals for the same data set and variable (Q2 PERMANOVA p-vals consistently lower than Vegan Adonis p-vals for the same data set and variable)

Hi!

I am new to qiime2 and microbiome analysis in general. I was interested in my unweighted unifrac result from qiime2 because significance testing with PERMANOVA showed pairwise differences all throughout my 3 groups. So I wanted to reproduce the results in R: I used phyloseq to do a PCoA plot (which was more or less the same as the q2 output, just a little different %ages in axes), but when I performed significance testing with pairwise adonis (as I learned was the equivalent of PERMANOVA in R) on the distance matrix, the p values I got were different such that 1 pairwise comparison was no longer significant.

So I tried running pairwise adonis again in PERMANOVA /but/ using the exported distance matrix from unweighted unifrac (with formatting modifications) result in qiime2, and I got significant results for all 3 pairwise comparisons.

My question is, why is the distance matrix from qiime2 different from that produced in phyloseq in R (phyloseq::distance)?

And,
would it be all right to use the phyloseq output for PCoA (using phyloseq ordinate function on physeq object) together with the adonis pairwise output run on the exported distance matrix of the qiime2 output?

Thank you!

2 Likes

Hello Ange,

Thanks for posting on the forums. Welcome to Qiime 2! :qiime2:

In order to track down the source of this issue, we need to compare the output files at each stage in this process. This could be due to different default settings, or very small differences that have a large effect. For example, in that form post you listed, one source of the difference was how Qiime 1 and R parse sample names! It could be any number of things. :man_shrugging:

That's a great place to start. What is the exact steps you used to make the distance matrix in R and Qiime? How do you know they are different?

Colin

2 Likes

Thanks for replying!

Okay, here are the two distance matrices. The first one is the qiime 2 output for unweighted UniFrac from the qiime diversity core-metrics-phylogenetic command; the second is the output from running phyloseq::distance in R on a physeq object (created by reading the exported tree, taxonomy ,metadata,feature table QZAs using the Qiime2R package).

Even if you generate these distance matrices in the same way in QIIME 2 vs. phyloseq (same metric, rarefaction, same rarefaction depth), there will be differences. The reason is that rarefaction (used by default in QIIME 2's core-metrics-phylogenetic pipeline, and not used by default in phyloseq) randomly subsamples your feature table — do that 10 times and you will retrieve 10 slightly different results since the subsample is random.

The fact that you see significant effects with QIIME 2 but not phyloseq is either due to this random subsampling, or more likely because in phyloseq you are not subsampling or normalizing at all (I am assuming since you have not mentioned normalization in phyloseq), so fairly large differences between these distance matrices may be expected. Unweighted unifrac will be very sensitive to sampling depth differences, which should be normalized across samples prior to unifrac (e.g., by rarefaction or another normalization method).

2 Likes

Okay, thank you!

I see that there is a debate of whether to rarefy microbiome data or not.

But for this purpose I would just like to use R for visualizing qiime2 data. For future reference I would just like to post how I found a way to use the distance matrix from qiime2 with the phyloseq ordinate command by converting the exported qiime 2 unifrac output into a dist-object and then using it for the distance argument in the phyloseq ordinate function. I have yet to see if it works, though.

Thanks a lot!

have you seen qiime2r? this greatly simplifies the process of transferring data to R:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.