multi-way adonis test

Hi everyone!!

I have some questions about qiime diversity adonis plugin (https://docs.qiime2.org/2019.4/plugins/available/diversity/adonis/). I have many metadata categories from which I would like to see how much % of variation they explain.

First question is, should I perform adonis test separately for categories a, b , c and d or should I inuclude all of them in the same calculation like this?

qiime diversity adonis
–i-distance-matrix weighted_unifrac_distance_matrix.qza
–m-metadata-file metadata-1.tsv
–p-formula “a+b+c+d”
–o-visualization weighted_unifrac_adonis.qzv

Secondly, I saw in another post that interaction between factors can be assessed using * instead of +. How can these interactions be proved? For example I did one test with + and another with * and the result was exactly the same (all results) except for one Pr(>F) (only from one factor). What does it mean? How are interactions detected?

Finally, I had a problem when running this plugin inside a pipeline. When running the command inside the pipeline I got one result and when I ran it alone got another different result. Any idea of what could be going on? Result should not be influenced for any other calculations, right? I didn’t found anything like this in the forum.

I hope everything is well explained,

Lots of thanks in advance!

Hi @pau,

There are a lot of options with Adonis (as with everything). The qiime2 adonis wraps the R function, and you may find the R documentation for the function and package helpful.

I would recommend both. I would look a the individual effect of a, b, and c, and then I might combine them. One of my recent discoveries is that when you do a + b + c, the order matters and you get the remaining variance explained. So, if you’re interested in a as your primary variable, you want to structure the equation as b + c + a.

Im not sure what you mean by “interactions being proved”. Like, you calculate the interaction term and you get the result and its the same as any other statistical test. Adonis should give you an interaction term in the model, I think, but it won’t tell you which of the interaction groups are significant.

Okay, three possible explanations

  1. You switched around the equation order
  2. You’re inputting slightly different files, which can change the result.
  3. If “different” means your p-values shift slightly, then that makes sense because adonis is a permutative test. For things that are extreme, p-values should be static around (1 / number of permutations + 1). For things that are not that extremely significant, the p-value can and probably will fluctuate more because p-values are calculated through random permutative processes.

Best,
Justine

2 Likes

Hi @jwdebelius
Thanks a lot for your quick and detailed answer!!

Perfect! So, that would show the % of variation explained by a category when “acting” alone and when its effect is combined with other categories? Also, thanks a lot for your order recommendation, sounds great and should be very useful in my case!

For “being proved” I meant, by looking at the result .qzv how can you see whether there’s interaction between categories or not, because I saw no difference when looking at a result computed with a + b + c compared to a * b * c (except for the variation in only one p-value), so maybe this suggests there’s non?

The R2 values changed as well, and I am quite sure the input files are right. About the order, it’s strange because commands in the pipeline were computing adonis for single metadata categories (not a+b+c). For example, when running altogether in the same pipeline:

qiime diversity adonis
–i-distance-matrix unweighted_unifrac_distance_matrix.qza
–m-metadata-file metadata-1.tsv
–p-formula a
–o-visualization unweighted_unifrac_ADONIS.qzv ;

qiime diversity adonis
–i-distance-matrix weighted_unifrac_distance_matrix.qza
–m-metadata-file metadata-1.tsv
–p-formula a
–o-visualization weighted_unifrac_ADONIS.qzv ;

qiime diversity adonis
–i-distance-matrix jaccard_distance_matrix.qza
–m-metadata-file metadata-1.tsv
–p-formula a
–o-visualization jaccard_ADONIS.qzv ;

qiime diversity adonis
–i-distance-matrix bray_curtis_distance_matrix.qza
–m-metadata-file metadata-1.tsv
–p-formula a
–o-visualization bray_curtis_ADONIS.qzv ;

R2 results were 0,04 Bray-Curtis, 0,02 Jaccard, 0,05 UnweightedUnifrac and 0,15 weighted.

When running 4 same commands above, but alone, results were 0,15 Bray-C, 0,10 Jaccard, 0,16 UnwUnifrac and 0,19 WeightedUnifrac. (without changing anything). Could be some interaction between them?

I’m sorry for the long post!

Thanks again!

Hi @pau,

Okay, I confess that Ive been staring at this for a week becuase there shouldn’t be a change based on whether commands are run in series or in a pipeline. I would double-check everything (possibly running in a snakemake pipeline or a jupyter notebook).

Best,
Justine

2 Likes

@pau,
Building on @jwdebelius’s advice to double-check everything, I recommend carefully checking the provenance in the adonis output QZVs to ensure that (a) the inputs are identical and (b) the parameter settings are identical. It’s easy to get filepaths mixed up when running as part of a larger workflow, but provenance tracks all of this for you so that you can trace your steps and determine what went wrong.

Good luck!

2 Likes

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