# Creating & Exporting ASV tables

**URL:** https://forum.qiime2.org/t/creating-exporting-asv-tables/17478
**Category:** Technical Support
**Tags:** dada2, asv, export
**Created:** [November 17, 2020, 2:57am UTC](https://forum.qiime2.org/t/creating-exporting-asv-tables/17478 "2020-11-17T02:57:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![fabipc](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabipc](https://forum.qiime2.org/u/fabipc)
#### Post date: [November 17, 2020, 2:57am UTC](https://forum.qiime2.org/t/creating-exporting-asv-tables/17478/1 "2020-11-17T02:57:22Z")

</div>

Hello,

I have a quick question, or more like a confirmation of my analysis. I had previously followed a tutorial on how to create and export an ASV table and I feel like I did it correctly, however, after a request from my PI, she mentioned that what I had provided was not an ASV table. Hence, I would like to know if I in fact did this wrong. If you could please let me know if I followed the correct steps to create an ASV table, I would really appreciate it. I have also provided a few rows and columns from the ASV file I have created for verification (in case this makes it easier to see).

**Below is the code I ran to create the ASV table using the dada2 feature table and the taxonomy.qza files.**

**#Raw Table----------------------------------------------------------------------**  
mkdir DADA2/Clean/FilteredTable/ExportRaw

_qiime tools export --input-path Bacteria-Table-Merged-Filtered-1-4E-MJ-NS.qza --output-path DADA2/Clean/FilteredTable/ExportRaw_  
_cd DADA2/Clean/FilteredTable/ExportRaw_  
_mv feature-table.biom Bacteria-Table-MergedFiltered-Clean-NS.biom_  
_biom convert -i Bacteria-Table-MergedFiltered-Clean-NS.biom -o Bacteria-Table-MergedFiltered-Clean-NS.tsv --to-tsv_  
_biom head -i Bacteria-Table-MergedFiltered-Clean-NS.tsv_

**#Create a taxonomy biom file----------------------------------------------**  
_qiime tools export --input-path Bacteria-taxonomy-paired-Clean-2020-132.qza --output-path ./_  
_cp taxonomy.tsv biom-taxonomy.tsv_

**#Add metadata to taxonomy and biom feature table ----------------**  
_mkdir ASVtables_

_biom add-metadata -i DADA2/Clean/FilteredTable/ExportRaw/Bacteria-Table-MergedFiltered-Clean-NS.biom -o ASVtables/Bacteria-FilteredTable-with-taxonomy.biom --observation-metadata-fp Taxonomy/biom-taxonomy.tsv --sc-separated taxonomy --observation-header OTUID,taxonomy,confidence_

_biom convert -i ASVtables/Bacteria-FilteredTable-with-taxonomy.biom -o ASVtables/Bacteria-FilteredTable-with-taxonomy.tsv -m Bacteria-Metadata-Lib1-4E-MJ-Clean.tsv --to-tsv --header-key taxonomy_

**This in turn is the file that I am using as the ASV table and which I was using in R to run statistic analysis.**

[Fungal-ASV-table.csv](https://forum.qiime2.org/uploads/short-url/w1cf6omx79LzOTDFN7TD5Eb4jQt.csv) (1.5 KB)

---

<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: [November 17, 2020, 8:46am UTC](https://forum.qiime2.org/t/creating-exporting-asv-tables/17478/2 "2020-11-17T08:46:41Z")

</div>

Hi @fabipc,

Whether your table is an ASV table or OTU table depends on the upstream processing before the export. What commands did you use to generate file file you exported?

Best,  
Justine

---

<div class="post-metadata">

### Author: ![fabipc](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabipc](https://forum.qiime2.org/u/fabipc)
#### Post date: [November 17, 2020, 7:34pm UTC](https://forum.qiime2.org/t/creating-exporting-asv-tables/17478/3 "2020-11-17T19:34:35Z")

</div>

@jwdebelius Thanks for your response.

I see, I just ran DADA2, created the taxonomy file, and then added the taxonomy to the feature table, using the following commands:

**1. Ran DADA: used these files to create classifier with the commands below:**

**#Train Classifier--------------------------------------------------------------------------------------------------------------**  
mkdir SILVA\_132\_QIIME\_release/Reference

qiime tools import   
--type 'FeatureData[Sequence]'   
--input-path SILVA\_132\_QIIME\_release/rep\_set/rep\_set\_16S\_only/99/silva\_132\_99\_16S.fna   
--output-path SILVA\_132\_QIIME\_release/rep\_set/rep\_set\_16S\_only/99/silva\_132\_99\_16S.qza

qiime tools import   
--type 'FeatureData[Taxonomy]'   
--input-format HeaderlessTSVTaxonomyFormat   
--input-path SILVA\_132\_QIIME\_release/taxonomy/16S\_only/99/majority\_taxonomy\_7\_levels.txt   
--output-path SILVA\_132\_QIIME\_release/rep\_set/rep\_set\_16S\_only/99/silva-16s-Ref-Taxonomy132.qza

qiime feature-classifier extract-reads   
--i-sequences SILVA\_132\_QIIME\_release/rep\_set/rep\_set\_16S\_only/99/silva\_132\_99\_16S.qza   
--p-f-primer CCTACGGGNGGCWGCAG   
--p-r-primer GACTACHVGGGTATCTAATCC   
--p-min-length 1   
--o-reads SILVA\_132\_QIIME\_release/Reference/16s-ref-seqs.qza

**#Fit the classifier-------------------------------------------------------------------------------------------------------------**  
mkdir SILVA\_132\_QIIME\_release/Classifier  
qiime feature-classifier fit-classifier-naive-bayes   
--i-reference-reads SILVA\_132\_QIIME\_release/Reference/16s-ref-seqs.qza   
--i-reference-taxonomy SILVA\_132\_QIIME\_release/rep\_set/rep\_set\_16S\_only/99/silva-16s-Ref-Taxonomy132.qza   
--o-classifier SILVA\_132\_QIIME\_release/Classifier/Silva-16s-Classifier132.qza

**#Test the Classifier- Create Taxonomy Barplot----------------------------------------------------------------------**  
mkdir TrialTaxonomy

qiime feature-classifier classify-sklearn   
--i-classifier SILVA\_132\_QIIME\_release/Classifier/Silva-16s-Classifier-2020-132.qza   
--i-reads DADA2/Clean/Bacteria-RepSeqs-Merged-1-4E-MJ-clean.qza   
--o-classification Taxonomy/Bacteria-taxonomy-paired-Clean-2020-132.qza

**2. I then filtered out the mitochondria and chloroplast**  
**3. Exported the files out with the code shared on the first post.**

Thank you so much for your help, I feel like I did create an ASV table since I did not cluster the data. If you could please let me know if I did this correctly and or not, I would really appreciate it.

---

<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: [November 17, 2020, 8:23pm UTC](https://forum.qiime2.org/t/creating-exporting-asv-tables/17478/4 "2020-11-17T20:23:30Z")

</div>

Hi @fabipc,

> [@fabipc](#):
>
> I feel like I did create an ASV table since I did not cluster the data. If you could please let me know if I did this correctly and or not, I would really appreciate it.

This is exactly what I was wondering about! If you didn't cluster your data, then you have ASVs. If you clustered, it would be OTUs.

I dont see anything immediately wrong with your code, either

Best,  
Justine

---

<div class="post-metadata">

### Author: ![fabipc](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabipc](https://forum.qiime2.org/u/fabipc)
#### Post date: [November 17, 2020, 8:31pm UTC](https://forum.qiime2.org/t/creating-exporting-asv-tables/17478/5 "2020-11-17T20:31:23Z")

</div>

@jwdebelius Okay perfect, so the ASV table attached in the first post, looks correct, right? (The one I attached was for fungi, but I did the same steps as mentioned above, with the exception that I used the UNITE database).

---

<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: [December 19, 2020, 2:31am UTC](https://forum.qiime2.org/t/creating-exporting-asv-tables/17478/6 "2020-12-19T02:31:25Z")

</div>

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