# Perform Diversity analysis

**URL:** https://forum.qiime2.org/t/perform-diversity-analysis/15941
**Category:** User Support
**Created:** [August 4, 2020, 10:36am UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941 "2020-08-04T10:36:12Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)
#### Post date: [August 4, 2020, 10:36am UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/1 "2020-08-04T10:36:12Z")

</div>

Dear all,

I performed diversity analysis using the following command lines

qiime diversity alpha   
--i-table table.qza   
--p-metric observed\_otus   
--o-alpha-diversity observed\_otus\_vector.qza

qiime diversity beta   
--i-table table.qza   
--p-metric braycurtis   
--o-distance-matrix unweighted\_unifrac\_distance\_matrix.qza  
How can i convert the qza files to qzv because i want to visualize the results ?

The aforementioned command lines were used for non-phylogenetic diversity metrics.  
What are the main differences between results obtained from phylogenetic diversity analysis and non phylogenetic diversity analysis What is the best method to perform diversity analysis phylogenetic or non phylogenetic approach ?

Thank you so much

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [August 4, 2020, 11:03pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/2 "2020-08-04T23:03:09Z")

</div>

Hi @M_F,

This is a complex question and one that, i think, is still a big point of discussion in the field. Ive had multiple conversations with people who swear by phylogenetic or non-phylogenetic metrics for their data. It depends on what you're looking for in your data. It's also worth keeping in mind that techniques can be complementary.

Imagine I have 3 communities:

- Community 1: 🐁, 🐀
- Community 2: 🐁, 🐇
- Community 3: 🖱, 🐀

The non-phylogenetic metrics weights the similarity between any two features the same way, so the distance between 1 and 2 and 1 and 3 will be the same.

On the other hand, phylogenetic metrics account for the similarity between the features. Typically, this is thee shared evolutionary history - the phylogeny. (I'll let you decide if you. think a 🖱 is more similar to a 🐁 than a 🐇 is to a 🐀.. I think it depends on your perspective today.)

Best,  
Justine

---

<div class="post-metadata">

### Author: ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)
#### Post date: [August 5, 2020, 8:03am UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/5 "2020-08-05T08:03:02Z")

</div>

Hello @jwdebelius

Thanks for the response. For alpha and beta diversity analysis i obtained a qza files i would like to visualize those files and to convert them to qzv format How can i convert them ?  
Thanks

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [August 5, 2020, 3:09pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/6 "2020-08-05T15:09:49Z")

</div>

Hi @M_F,

Have you looked at our fabulous [tutorials](https://docs.qiime2.org/2020.6/tutorials/)?

Best,  
Justine

---

<div class="post-metadata">

### Author: ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)
#### Post date: [August 6, 2020, 11:51am UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/7 "2020-08-06T11:51:20Z")

</div>

Hello @jwdebelius,  
I generated qzv files for alpha and beta diversity analysis.

1. 

qiime diversity alpha-group-significance   
--i-alpha-diversity obersved\_otus\_vector.qza   
--m-metadata-file sample-metadata.tsv   
--o-visualization observed\_otus\_vector.qzv

For alpha diversity analysis using the aforementioned command line statistical analysis were performed automatically using Kruskal Wallis test/the last test don't show significant differences between for example control group and Affected patients while in the boxplot i see significant differences i'm asking if it's possible to replace the statistical test used (kruskal wallis) by another ?

1. concerning beta diversity analysis i used the following command line  
qiime diversity beta-group-significance   
--i-distance-matrix unweighted\_unifrac\_distance\_matrix.qza  
--m-metadata-file sample-metadata.tsv   
--m-metadata-column Disease   
--o-visualization core-metrics-results/unweighted-unifrac-subject-group-significance.qzv   
--p-pairwise

The plots generated using the aforementioned command line display for for example control group (n=1081) while the number of the control group is n=40 why the results show duplication of samples ?

1. How can i generate PCOA results from beta diversity analysis in order to explore them using emperor tool ? i didn't see the corresponding command line.

Thanks for your help

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [August 6, 2020, 4:15pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/8 "2020-08-06T16:15:00Z")

</div>

Hi @M_F,

You can't change the alpha group significance test because a normal distribution isn't always best for alpha diversity. I'm guessing you have relatively small sample sizes? I guess one of the questions I should have asked sooner is if you rarified your data?

Your beta diveristy questions have been addressed before in multiple threads, those are compiled into the Frequently Asked Question Post.

> [@Frequent Questions and "Best of the QIIME 2 Forum"](https://forum.qiime2.org/t/frequent-questions-and-best-of-the-qiime-2-forum/13608):
>
> The following is a list of frequently asked questions on the forum, with answers, to serve as a point of reference for forum users to quickly find answers, or for forum users and moderators to use as a reference when helping others. Note: some of these listings are collapsed lists. If you see an arrow next to a title, click the title to expand the list of topic titles related to that subject. arrow_forwardFAQs [What is a "Feature" exactly? - #3 by Nicholas\_Bokulich](https://forum.qiime2.org/t/what-is-a-feature-exactly/2201/3)[MemoryError with q2-f…](https://forum.qiime2.org/t/feature-classifiers-error/11946/2)

I think you'll probably find your answers there, but if not, please come back and ask more qustions!

Best,  
Justine

---

<div class="post-metadata">

### Author: ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)
#### Post date: [August 7, 2020, 11:14am UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/9 "2020-08-07T11:14:31Z")

</div>

Hi @jwdebelius  
Thanks for the message.

1. Regarding the alpha diversity analysis I didn't perform alpha rarefaction plotting because as required by the following command line i should generate rooted-tree.qza file from the merged sequences however when i performed phylogenetic analysis of merged sequences of 100 samples i received an error message indicating that the job requires enough memory to achieve this task noting that the job was stopped because i don't have enough memory. So i was obliged to conduct phylogenetic analysis running each sample separately (one by one) to create rooted-tree.qza file for each sample. The question is how to merge the rooted-tree.qza files created for each sample to perform alpha rarefaction plotting ?  
qiime diversity alpha-rarefaction   
--i-table table.qza   
--i-phylogeny rooted-tree.qza   
--p-max-depth 4000   
--m-metadata-file sample-metadata.tsv   
--o-visualization alpha-rarefaction.qzv

2. Concerning the beta diversity analysis

i didn't find a response to my questions in the FAQs :  
The plots generated using the following command line show duplication of samples how can i resolve this problem (eg the number of the control group is n=40 i found n = 1081) ?  
qiime diversity beta-group-significance  
–i-distance-matrix unweighted\_unifrac\_distance\_matrix.qza  
–m-metadata-file sample-metadata.tsv  
–m-metadata-column Disease  
–o-visualization core-metrics-results/unweighted-unifrac-subject-group-significance.qzv  
–p-pairwise  
How can i generate PCOA results from beta diversity analysis in order to explore them using emperor tool ? i didn’t see the corresponding command line.

Thanks

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [August 10, 2020, 3:49pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/10 "2020-08-10T15:49:43Z")

</div>

Hi @M_F,

Can you please back up and describe your pipeline? You should not have a per-sample tree, so I'd love to know how you got there?

The number at the bottom of the boxplot is the number of distance measurements, not the number of samples.

> [@beta diversity explanation (jaccard\_distance)](https://forum.qiime2.org/t/beta-diversity-explanation-jaccard-distance/15216):
>
> Hi , I did beta diversity analysis using jaccard\_distance metric. But I am confused the result. According to the table, there is a significant difference between NF and PF groups, and the distance from NF to PF is 1 according to the left upper graph. They are consistent. However, the distance from NL to PL is also 1 from the lower right graph which means two group shar no species, but P value is more than 0.05 from the table which means there is no significant difference between NL and PL. [i…

> [@interpretation of beta-diversity-group-significance box plots](https://forum.qiime2.org/t/interpretation-of-beta-diversity-group-significance-box-plots/12550):
>
> Hello all, Can anyone pls help me to interpret my beta-diversity-group-significance results? I have 4 groups each containing 2 samples. total number of sample is 8. I am unable to understand why in all the four plots, the first box has appeared to be a line only. Did I make any mistake? [excreta-boxplots] [gut-boxplots] [leaf-boxplots] [soil-boxplots] Any kind of help is highly appreciated. Best regards,

> [@Help interpreting beta diversity plots](https://forum.qiime2.org/t/help-interpreting-beta-diversity-plots/14691):
>
> Hi! I'm still relatively new to Qiime, and was wondering if I could get some help interpreting my beta diversity (Bray-Curtis) plots? I thought I had this all figured out but then my PI brought up a different point and made me question everything!! [D84-CON-boxplots-2 v2] So my thinking was, there is more diversity in the TYL group because the box is larger, indicating a wider variety in the distances measured. But then my PI brought up that it could be less diversity, because even though the…

Best,  
Justine

---

<div class="post-metadata">

### Author: ![M\_F](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@M\_F](https://forum.qiime2.org/u/M_F)
#### Post date: [September 2, 2020, 12:42pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/12 "2020-09-02T12:42:58Z")

</div>

@jwdebelius,

Thanks for the reply.

1. Regarding the beta diversity analysis :  
I have a question about the pairwise permanova results table what does those columns (permutations, pseudo-F, q value) refer to ?  
In boxplots we have y axis representing distance and in x axis we have for example group 1 (n = 1128) Group 2 (n=480) what does those n values represent if y axis represents distance ?

2. Concerning the alpha diversity analysis :  
In the table representing Kruskal Wallis results : what did the column H refer to ?  
Thanks

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [September 2, 2020, 4:31pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/13 "2020-09-02T16:31:02Z")

</div>



---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [September 4, 2020, 5:32pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/14 "2020-09-04T17:32:21Z")

</div>

Hi @M_F,

> [@M\_F](#):
>
> I have a question about the pairwise permanova results table what does those columns (permutations, pseudo-F, q value) refer to ?

The pseudo-F is the test statistic for the original data. It's not used directly to calculate the p-value.  
Permanova is a permutation test, so permutations tells you how many times the data has been shuffled to give you your p-value.  
The q-value is the p-value adjusted for multiple hypothesis correction.

> [@M\_F](#):
>
> In boxplots we have y axis representing distance and in x axis we have for example group 1 (n = 1128) Group 2 (n=480) what does those n values represent if y axis represents distance ?

This was already discussed:

> [@Help interpreting beta diversity plots](https://forum.qiime2.org/t/help-interpreting-beta-diversity-plots/14691):
>
> Hi! I'm still relatively new to Qiime, and was wondering if I could get some help interpreting my beta diversity (Bray-Curtis) plots? I thought I had this all figured out but then my PI brought up a different point and made me question everything!! [D84-CON-boxplots-2 v2] So my thinking was, there is more diversity in the TYL group because the box is larger, indicating a wider variety in the distances measured. But then my PI brought up that it could be less diversity, because even though the…

> [@M\_F](#):
>
> In the table representing Kruskal Wallis results : what did the column H refer to ?  
> Thanks

The H-value is the Kruskal wallis test statistics.

Best,  
Justine

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [September 4, 2020, 5:32pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/15 "2020-09-04T17:32:24Z")

</div>



---

<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: [October 5, 2020, 11:32pm UTC](https://forum.qiime2.org/t/perform-diversity-analysis/15941/16 "2020-10-05T23:32:28Z")

</div>

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