# Where can I find a tutorial showing how to use beta\_diversity.py (QIIME1) equivalent in QIIME2 for PERMANOVA?

**URL:** https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919
**Category:** User Support
**Created:** [December 17, 2019, 7:00pm UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919 "2019-12-17T19:00:21Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ehossain](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ehossain/32/6838_2.png) [@ehossain](https://forum.qiime2.org/u/ehossain)
#### Post date: [December 17, 2019, 7:00pm UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/1 "2019-12-17T19:00:21Z")

</div>

- Version of QIIME 2 you are running, and how it is installed (e.g. Virtualbox, conda, etc.): qiime2-2019.10, installed through conda
- What is the exact command or commands you ran? beta\_diversity.py -I table.txt -o processed -m bray\_curtis\_faith.
- What is the exact error message, if applicable? "Invalid Syntax"

I have used a PERMANOVA protocol developed by PI in the lab with QIIME1. I still need the PERMANOVA test to see if a PCoA plot clustering is significant. How do I run a PERMANOVA test in QIIME2?

The protocol for QIIME1 is here: [Permanova\_code - Google Drive](https://drive.google.com/open?id=1xfw0-7jVba2XHvwrAAnu8VMt-r3STx7I)

What will be equivalent QIIME2 workflow?

---

<div class="post-metadata">

### Author: ![gwarmstrong](https://forum.qiime2.org/user_avatar/forum.qiime2.org/gwarmstrong/32/5358_2.png) [@gwarmstrong](https://forum.qiime2.org/u/gwarmstrong)
#### Post date: [December 17, 2019, 7:55pm UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/2 "2019-12-17T19:55:50Z")

</div>

Hi @ehossain !

I think that the "Alpha and beta diversity analysis" section of the moving pictures tutorial would be informative for you:  
[https://docs.qiime2.org/2019.10/tutorials/moving-pictures/#alpha-and-beta-diversity-analysis](https://docs.qiime2.org/2019.10/tutorials/moving-pictures/#alpha-and-beta-diversity-analysis)

I would also add a clarification to your interpretation of the PERMANOVA test. As stated in the tutorial, the PERMANOVA will

> test whether distances between samples within a group, such as samples from the same body site (e.g., gut), are more similar to each other then they are to samples from the other groups (e.g., tongue, left palm, and right palm)

This is slightly different than "seeing if a PCoA plot clustering is significant" because the PCoA plot is an approximate representation of the distances between samples.

Let me know if I can provide any more clarification!

---

<div class="post-metadata">

### Author: ![ehossain](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ehossain/32/6838_2.png) [@ehossain](https://forum.qiime2.org/u/ehossain)
#### Post date: [December 17, 2019, 11:32pm UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/3 "2019-12-17T23:32:36Z")

</div>

Hello @gwarmstrong!  
Thank you so much for pointing towards the tutorial. I just did it. I think I have a comfortable idea how to do the PERMANOVA. The only problem I have now is the "Data File" format. Let me explain below:

My work is in small molecule Metabolomics (Mass Spectrometry). The CSV file that I use to generate PCoA plots) can be found here: [CD\_Stool\_Analysis\_Start\_modified\_Transposed\_BlankRemoved\_TICNormed\_w\_metadata\_NoQCNoBlank\_Only\_AB.csv - Google Drive](https://drive.google.com/open?id=1yafrTPBwLh-4PfKgiHphH6bB6Yp21npW)

My feature table would be this same file minus the metadata.

So the fist column contains Sample names (each row is an unique sample).

From 2nd column through n-th column I have peak ares corresponding to m/z (mass to charge ratio) values. These will be my unique features. Kinda similar to gene sequence in a sample.

This is not a well defined FASTA file. So how do I get started the very point of data importing?

Also does any of the headers in metadata/feature table has to be written in a specific format?

I think if I know how to import a CSV or XLSX "data file", I can get started. Any tips in this regard? Thank you again.

---

<div class="post-metadata">

### Author: ![gwarmstrong](https://forum.qiime2.org/user_avatar/forum.qiime2.org/gwarmstrong/32/5358_2.png) [@gwarmstrong](https://forum.qiime2.org/u/gwarmstrong)
#### Post date: [December 17, 2019, 11:52pm UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/4 "2019-12-17T23:52:46Z")

</div>

So there is an [open issue](https://github.com/qiime2/q2-types/issues/140) about importing CSV/TSV format directly...

This will take a couple steps:

1. Import the CSV to a biom table using `biom convert`. These two threads will hopefully be a good starting point.

> [@Converting and exporting (.tsv to.biom)](https://forum.qiime2.org/t/converting-and-exporting-tsv-to-biom/3934/2):
>
> Hi @conhow! Welcome! We have an [open issue](https://github.com/qiime2/q2-types/issues/140) to support directly importing this kind of BIOM table, but for now, your workflow makes sense. Did you take a look at the [BIOM docs](http://biom-format.org/documentation/biom_conversion.html)? It looks like you should be able to run something like the following to convert your TSV BIOM file to an HDF5 BIOM file: biom convert -i table.tsv -o converted\_table.biom --to-hdf5 Then, you can check out the [QIIME 2 Importing tutorial](https://docs.qiime2.org/2018.2/tutorials/importing/#biom-v2-1-0) for information on how to import this file! Let us know how that goes for you, …

> [@CSV to a qiime2 readable format](https://forum.qiime2.org/t/csv-to-a-qiime2-readable-format/2284/3):
>
> Hi @coralgal! We don't currently support importing CSV or TSV formatted OTU tables. We have an [open issue](https://github.com/qiime2/q2-types/issues/140) tracking this feature, and we'll follow up here when it's available in a release! In the meantime, you can use the biom convert tool (which comes installed with QIIME 2) to convert your CSV OTU table into a .biom file. See the [biom convert tutorial](http://biom-format.org/documentation/biom_conversion.html) for details; you'll first need to convert your CSV file to TSV. Both JSON and HDF5 versions of the .biom file format are supported by the QIIME …

1. Import the biom table with `qiime tools import`. See [this tutorial](https://docs.qiime2.org/2019.7/tutorials/importing/#biom-v2-1-0).

---

<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: [December 18, 2019, 12:42am UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/5 "2019-12-18T00:42:07Z")

</div>

Q2 secret: you could also use `qiime sample-classifier metatable` to import and convert a TSV directly to a feature table. This method was designed for merging metadata into feature tables for specific purposes but if you only input a TSV format observation matrix it will do the conversion and import in one go.

---

<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: [December 18, 2019, 1:27am UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/6 "2019-12-18T01:27:24Z")

</div>

> [@ehossain](#):
>
> Also does any of the headers in metadata/feature table has to be written in a specific format?

See this tutorial: [Metadata in QIIME 2 — QIIME 2 2019.10.0 documentation](https://docs.qiime2.org/2019.10/tutorials/metadata/)

You can check out [qiime2.org](http://qiime2.org) for more tutorials and other info on getting started with QIIME 2.

Good luck!

---

<div class="post-metadata">

### Author: ![ehossain](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ehossain/32/6838_2.png) [@ehossain](https://forum.qiime2.org/u/ehossain)
#### Post date: [December 22, 2019, 12:07am UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/7 "2019-12-22T00:07:23Z")

</div>

Thank you so much @Nicholas_Bokulich. That command of passing the .tsv feature table as metadata and not providing the source does import the file as .qza and I was able to do my first PERMANOVA test on QIIME2 after that. I guess this thread can closed as "Solved".

---

<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: [January 22, 2020, 6:07am UTC](https://forum.qiime2.org/t/where-can-i-find-a-tutorial-showing-how-to-use-beta-diversity-py-qiime1-equivalent-in-qiime2-for-permanova/12919/8 "2020-01-22T06:07:26Z")

</div>

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