how to do the alpha and beta diversity and microbiota composition analysis ?

hello, everyone. I have finished all analyzing steps according the "Moving Pictures" tutorial. And I obtained the results like this:

But I don't know how to continue the alpha and beta diversity (with observed_OTU, Chao1 and Shannon) and microbiota composition analysis. In other words, could you tell me how to obtain the graphs like the following? I am really appreciated with your help.


The graphs you provided are drawn outside of Qiime2 environment. So, you can obtain a data for each metric in Qiime2, export it to .csv files and draw graphs in Python, R or any other suitable visualization tool

Thanks. Could you introduce in detail?

For example, you can open a barplot.qzv file as a archive and find a .csv or .tsv files inside data subfolder and visualize this data in any other tool outside of Qiime2. The same one can do with alpha diversity metrics. I like Qiime2 output visualizations, but for publications usually it is necessary to tweak/modify figures, so I use Python seaborn or matplotlib libraries.

Thanks very much. I can find a .tsv file related the .qzv file, which data has no metrics(observed_OTU, Chao1 and Shannon). Could you tell me how to obtain the alpha and beta diversity results (with observed_OTU, Chao1 and Shannon) firstly?
I am really appreciated with your help.

You ave a file with alpha diversity comparison between columns in your metadata file (first screenshot in your post). You can obtain such files for each metric you want first (Shannon, Chao, OTUs). Inside of this file, in data subfolder, there is another 'medata.tsv' file, in which you can find alpha diversity metric, for each sample in your metadata file. From this data, you can plot graphs using appropriate tool (python libraries, R or other)

You are so kind. Thanks very much. I have the metadata file. From the first screenshot in my post, I obtained the .csv files as follows, which did not include the metric (Shannon, Chao and OTUs). How can I do?

In the same data subfolder, from were you obtained .csv files, there should be 'metadata.tsv' file, with selected metric as a last column

Thanks for your reply. Yes, I have the metadata file and kruskal-wallis-pairwise*.csv files as follows.

But I don't know how to obstain a file with selected metric as a last column in your last screenshot. My commands are as follows.
qiime diversity alpha-group-significance
--i-alpha-diversity core-metrics-results/faith_pd_vector.qza
--m-metadata-file sample-metadata.tsv
--o-visualization core-metrics-results/faith-pd-group-significance.qzv

How you extracted your .csv files?
If you will open resulted faith-pd-group-significance.qzv file as archive, you will see ‘data’ subfolder, in which, together with all .csv files should be ‘metadata.tsv’ file like on my screenshot in previous comment. Could you share your .qzv file?

The alph-group-significance results are as follows. How to open the resulted faith-pd-group-significance.qzv file as archive? It is just a single file. I could not find a data folder.

I have Ubuntu and when I just double click on .qzv file it opens as an archive. Or you can open it or extract content in your software for archives

Do you think whether my commands have something wrong?

No, they looks fine to me.
Can you attach one .qzv file to comment?

Thanks very much. I double-checked and found the .tsv file when I submitted the faith-pd-group-significance.qzv file to again.

Then using Python seaborn or matplotlib libraries generate graphs?

Yes, but if you know better how to do it with other tools, you can use them. I am using seaborn and matplotlib just because I can use it. But one can plot in R or any other language/software, whatever is more convinient

Thanks very much for your help.

Hello timanix, I have done the taxonomic analysis and got the graph as follows:

But I need the graph like this microbiota composition analysis, could you help me to how to do to get the following graph? I am really appreciated with you.

Hi! The graph on your screenshot is plotted outside of Qiime2 environment. You can use data from Qiime2 output (barplot.qzv file), but you will not be able to receive plots like this using only Qiime2. Authors of the article used R, Python or something else to draw this figure. I took a closer look on the figure and understood that it is more difficult to reconstruct then I thought for the first time. To recreate something like this with Qiime outputs, you will need to perform a lot of scripting.
So, if you can code in Python or other language, you can try. If not, I would advise or simplify the figure for your research, or find a person who can draw this figure for you.
By the way, in your case, you will have ASVs instead of OTUs until you performed 97% clustering with vsearch on your tables.

As a variant you should read materials and methods section of the article with this figure and try to figure out which tools they used. They can provide scripts or software they used, so it will be easier to reconstruct

1 Like

Thanks for you kind reply. I still have two questions:

  1. Which dada can generate the FIGURE 4 above the screenshot? How to find the data? From barplot.qzv by qiime2?
  2. I am a newer for microbiota analysis. And I am confused ASV and OTU. What is the difference between them? According to Moving Pictures tutorial, I got the graph like this:

But I looked for the publicated papers, the picture for microbiota composition analysis was like the following :

How to choose the style for the picture for microbiota composition analysis? Thanks for your help very much.