# problems to interpret beta-group-significance

**URL:** https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381
**Category:** User Support
**Created:** [April 25, 2019, 2:10pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381 "2019-04-25T14:10:16Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [April 25, 2019, 2:10pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/1 "2019-04-25T14:10:16Z")

</div>

Good Morning:  
I'm having some problems interpreting the results of my study. I have studied the colonization of microorganisms on different substrates at the exit of two treatment plants. The whole process has gone well, until I have come to analyze beta diversity. For this I have obtained the distance\_bray\_curtis\_matrix by:  
qiime diversity core-metrics-phylogenetic  
--i-phylogeny Cantoblanco/tree/cantoblancorooted-tree.qza  
--i-table Cantoblanco/dada2/cantoblancotable-dada2.qza  
--p-sampling-depth 70940  
--m-metadata-file Cantoblanco2019-sample-metadata.tsv  
--output-dir Cantoblanco/core-metrics-results3  
Obtaining this graphic representation:  
[bray\_curtis\_emperor.qzv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/7/78ef9a831fa01008c86c9894c8f16fe3732282cd.qzv) (798.0 KB)

Looking at the data, I have seen that two large groups can be distinguished depending on the place of sampling ("Place" in metadata). Taking this into account, I have resorted to making a PERMANOVA having the place as reference, by means of the following command:

qiime diversity beta-group-significance  
--i-distance-matrix Cantoblanco/core-metrics-results3/bray\_curtis\_distance\_matrix.qza  
--m-metadata-file Cantoblanco2019-sample-metadata.tsv  
--m-metadata-column Place  
--p-method permanova  
--p-pairwise  
--p-permutations 9999  
--o-visualization Cantoblanco/betabray/betabraypairwise

Obtaining this output:  
[betabraypairwisePlace.qzv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/d/d4d376b2930aa4a5a50ba4907f86dd8c14e48846.qzv) (323.7 KB)

That shows that yes, the place is a significant factor. Then, I wanted to check for pairs if the same substrate, being of different place, is statistically different (logical seeing the previously obtained). Each substrate had three replicas per place to be statistically significant (I attached the command and the file):

qiime diversity beta-group-significance

--i-distance-matrix Cantoblanco/core-metrics-results3/bray\_curtis\_distance\_matrix.qza

--m-metadata-file Cantoblanco2019-sample-metadata.tsv

--m-metadata-column Sample1

--p-method permanova

--p-pairwise --p-permutations 9999

--o-visualization Cantoblanco/betabray/betabraypairwisesample1.qzv

And I obtained that output:  
[betabraypairwisesample1.qzv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/5/5193567a24b6474db328178c4cd9b7f00d08f49a.qzv) (1.5 MB)

But I get it, although the upper graphs indicate otherwise. With everything explained I have several questions. First of all, if I am using this command correctly and correctly understanding the results, or there is a better statistical method. Also, what exactly represent the graphics? What does the value of N means and why does it oscillate between samples if the groups always consist of three replicas? Why, if I compare the groups in pairs, there are no differences and if I compare them by place if, when the graphs, those big differences are appreciated?  
Thanks in advance:  
Sergio

---

<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 27, 2019, 4:16pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/2 "2019-04-27T16:16:58Z")

</div>

Hello Sergio!

Sorry for the delay in getting back to you. You have a lot of good questions! I'm not sure I can answer them all, but I wanted to start the conversation.

* * *

> [@gaudy93](#):
>
> I have studied the colonization of microorganisms on different substrates at the exit of two treatment plants.

Cool study! 🚰 🦠 🧫

By looking at the Emperor plot, I agree that 'Place' is a huge factor for PC1, which accounts for 63.35% of variation in bray-curtis dissimilarities. I think your use of PERMANOVA is good, and I agree with your interpretation of the results. 👍

* * *

Now for the hard bit:

> [@gaudy93](#):
>
> I wanted to check for pairs if the same substrate, being of different place, is statistically different (logical seeing the previously obtained).

This might be a bit tricky to test with PERMANOVA (or the results will be hard to interpret). I would suggest trying this plugin:  
[https://docs.qiime2.org/2019.1/plugins/available/longitudinal/pairwise-differences/](https://docs.qiime2.org/2019.1/plugins/available/longitudinal/pairwise-differences/)  
From the documentation:

> Sample pairs may represent a typical intervention study, e.g., ... identical  
> samples receiving different two different treatments.

That sounds like what you have; identical substrates placed into different places.

Let me know how the `longitudinal` plugin works for you.

Colin

---

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [May 7, 2019, 1:52pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/3 "2019-05-07T13:52:47Z")

</div>

Thank you so much for the idea. The main problem is that when executing the script in the following way I get this error:  
qiime longitudinal pairwise-differences  
--m-metadata-file microplasticossinfg-sample-metadata.tsv  
--m-metadata-file bray\_curtis\_distance\_matrix.qza  
--p-metric bray\_curtis  
--p-group-column Place  
--p-state-column Polymer  
--p-state-1 PLA  
--p-state-2 PHB  
--p-no-parametric  
--p-replicate-handling random  
--o-visualization PLAPHBpairwise-differences.qzv  
There was an issue with viewing the artifact microplasticsall/core-metrics-results3/bray\_curtis\_distance\_matrix.qza as QIIME 2 Metadata:

Artifact \<artifact: DistanceMatrix uuid: fea70641-b54b-4624-91bf-aa680ec2132e\> cannot be viewed as QIIME 2 Metadata.

What can I do? or maybe i have to use Pairwise distance comparisons?  
One question more, Is there any option to include the replicas in this result?  
Thank you:  
Sergio

---

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [May 7, 2019, 3:40pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/4 "2019-05-07T15:40:51Z")

</div>

also the problem is that I want to evaluate several substrates (polymers) belonging to the same place (place) to be able to compare them. I'll copy the simplified mapping file to see if it helps explain.[microplasticos2 - sample-metadata.tsv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/9/92cab5f61b7b33da59a36c8deb95921b2bc03bc3.tsv) (17.6 KB)

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 7, 2019, 9:46pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/5 "2019-05-07T21:46:00Z")

</div>

Can you use your bray curtis PCoA results here, instead? Those are viewable as metadata, but I am not quite sure if that is really what you want.

---

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [May 7, 2019, 10:01pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/6 "2019-05-07T22:01:23Z")

</div>

no, the command does not give an error, but the display is empty

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 8, 2019, 2:35pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/7 "2019-05-08T14:35:56Z")

</div>



---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [May 8, 2019, 3:07pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/8 "2019-05-08T15:07:53Z")

</div>

> [@gaudy93](#):
>
> Artifact \<artifact: DistanceMatrix uuid: fea70641-b54b-4624-91bf-aa680ec2132e\> cannot be viewed as QIIME 2 Metadata.

if you want to look at paired-sample distances (i.e. same type of test but using a distance matrix as input) you should use `pairwise-distances` instead.

> [@gaudy93](#):
>
> no, the command does not give an error, but the display is empty

would you mind sharing the QZV?

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [May 8, 2019, 3:07pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/9 "2019-05-08T15:07:55Z")

</div>



---

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [May 8, 2019, 7:53pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/10 "2019-05-08T19:53:50Z")

</div>

Yes of course.  
[pairwise-distances.qzv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/f/f18d120c8374571bbc08a6f0e3be4fe329cc8532.qzv) (271.9 KB)  
The problem is that I think I misread how to use the script.  
Taking into account the metadata that I have spent you can see that there are two "place" Cantoblanco and Guadalajara. Taking this into account, in each place there are 9 different samples (PLA, PHB, PCL, POM, PS, LDPE, PET, Glass, water) in the metadata would be Sample 3. What would interest me is to compare in pairs those same samples in each place to see if the microbial communities are significantly different.  
How can I do?

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [May 8, 2019, 8:24pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/11 "2019-05-08T20:24:08Z")

</div>

> [@gaudy93](#):
>
> The problem is that I think I misread how to use the script.

Correct. No samples are being plotted because there are no paired replicates appearing in each "state" (since you used "polymer" as the state).

It sounds like what you really want is to make "polymer" the group and "place" the state. state\_1= Cantoblanco and state\_2= Guadalajara

You can use that with either `pairwise-differences` or `pairwise-distances`.

I am not sure how to handle the technical replicates, since the sample pairs you want to make are not true pairs (such as in a longitudinal study where the same physical object is sampled at 2 different times); so maybe just group the replicates (qiime feature-table group) prior to this test.

But I have a better proposal. Again, your samples are not actually really paired samples so this is a slightly unusual use of this test. A better test for this exists: multi-way PERMANOVA (adonis). Something like this:

```auto
qiime diversity adonis \
  --i-distance-matrix Cantoblanco/core-metrics-results3/bray_curtis_distance_matrix.qza \
  --m-metadata-file Cantoblanco2019-sample-metadata.tsv \
  --p-formula 'Place*polymer' \
  --o-visualization Cantoblanco/core-metrics-results3/adonis-results.qzv

```

That will tell you whether beta diversity is impacted by place, polymer, and the interaction of the two, i.e., do different polymers behave differently in different places?

You can also find lots of information online about interpreting the results of adonis tests, but use the [R vegan-adonis documentation](http://cc.oulu.fi/~jarioksa/softhelp/vegan/html/adonis.html) as a starting point.

Good luck!

---

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [May 8, 2019, 8:43pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/12 "2019-05-08T20:43:54Z")

</div>

Thank you very much for your help  
But, what would be the difference between making a PERMANOVA from an adonis?  
And then it is impossible to know if within the same place there are significant differences between polymers? or for that, should I consider each place separately and perform a permanova?

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [May 9, 2019, 11:53am UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/13 "2019-05-09T11:53:51Z")

</div>

> [@gaudy93](#):
>
> But, what would be the difference between making a PERMANOVA from an adonis?

PERMANOVA and adonis are the same test. The difference here is that `beta-group-significance` performs a one-way PERMANOVA only, while `adonis` supports multiple effects through the use of a formula.

> [@gaudy93](#):
>
> And then it is impossible to know if within the same place there are significant differences between polymers? or for that, should I consider each place separately and perform a permanova?

You have many polymers you are testing, so I would recommend going in a stepwise fashion.

1. Run adonis
2. If polymer:place interaction is not significant, stop there
3. If it is, look at your PCoA to figure out which place has significant polymer effects (maybe both)
4. filter your feature table to contain only that place
5. run `beta-group-significance` with the `pairwise` option and polymer as the `metadata-column`. This will run pairwise tests between each polymer to see which differ in that place.

Good luck!

---

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [May 9, 2019, 7:24pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/14 "2019-05-09T19:24:41Z")

</div>

thank you very much for everything but I have an error with the script that you give me of Adonis and I don´t understand this.  
Plugin error from diversity:

Command '['run\_adonis.R', '/tmp/tmpwfl147hm/dm.tsv', '/tmp/tmpwfl147hm/md.tsv', 'Place\*Polymer', '999', '1', '/tmp/qiime2-temp-7gq6fz5r/adonis.tsv']' returned non-zero exit status 1.

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 10, 2019, 2:56pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/15 "2019-05-10T14:56:41Z")

</div>

Can you please run:

```bash
qiime tools inspect-metadata Cantoblanco2019-sample-metadata.tsv

```

This will help us verify that you have formatted your formula string appropriately. Thanks!

---

<div class="post-metadata">

### Author: ![gaudy93](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/g/779978/32.png) [@gaudy93](https://forum.qiime2.org/u/gaudy93)
#### Post date: [May 10, 2019, 3:40pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/16 "2019-05-10T15:40:05Z")

</div>

> [@thermokarst](#):
>
> qiime tools inspect-metadata Cantoblanco2019-sample-metadata.tsv

Yeah the correct name of the metadata file that I finally use is this:  
[microplasticossinfg-sample-metadata.tsv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/5/53c008be28737995a39f9fa7c4a05733b4e6f793.tsv) (22.5 KB)

And this is the script that you said:

COLUMN NAME TYPE  
===================================== ===========  
BarcodeSequence categorical  
LinkerPrimerSequence categorical  
Mergedereplicados categorical  
Sample categorical  
Polymer categorical  
PLAPHB categorical  
Mergeagua categorical  
Mergewater categorical  
Sample1 categorical  
Sample2 categorical  
Sample3 categorical  
Place categorical  
Material categorical  
Materialplace categorical  
Material2 categorical  
Material3 categorical  
Material4 categorical  
Degradability categorical  
Contact angle numeric  
Form categorical  
Density (grames per cubic centimetre) numeric  
Bouyancy categorical  
Color categorical  
Average size (mm) numeric  
Aditives categorical  
Principal Use categorical  
Monomer categorical  
Origin categorical  
General categorical  
Filtrado categorical  
Description categorical  
===================================== ===========  
IDS: 58  
COLUMNS: 31

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [May 13, 2019, 12:37pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/17 "2019-05-13T12:37:43Z")

</div>

> [@gaudy93](#):
>
> thank you very much for everything but I have an error with the script that you give me of Adonis and I don´t understand this.

If you are not already using version 2019.4, please install the latest version of QIIME 2. That release contains some minor bug fixes for the adonis action.

If you are still receiving this error with 2019.4, please share the complete error message (run the command using the `--verbose` flag).

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [June 13, 2019, 6:37pm UTC](https://forum.qiime2.org/t/problems-to-interpret-beta-group-significance/9381/18 "2019-06-13T18:37:43Z")

</div>

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