Answers.Body: <p>I am not sure that kraken/kraken2 does anything similar to this.</p>
  <p>Usually to get OTUs/ESVs I think that you want to use a tool that clusters your sequences into groupings that represent the same sequence, allowing for technical error.</p>
  <p>Examples might include <a href="https://benjjneb.github.io/dada2/" rel="nofollow noreferrer">dada2</a> or <a href="https://academic.oup.com/gigascience/article/9/12/giaa135/6011256" rel="nofollow noreferrer">dadasnake</a>, or <a href="https://forum.qiime2.org/t/can-we-process-nanopore-data-using-qiime2/16156/4" rel="nofollow noreferrer">qiime</a>. This is after the technical steps for adapter/trimming/denoising steps.</p>
  <p>kraken2 is more for classifying into known taxonomic categories based on a reference sequence, which is a related but distinct task.</p>
  <p>I don't think that I understand what the ESV file format is supposed to look like. <a href="https://cmap.readthedocs.io/en/latest/catalog/datasets/ESV.html" rel="nofollow noreferrer">This resource</a> seems to have some info on processing data into ESVs, but it is not for nanopore. Possibly it is still useful for the final step of creating that file format. A <a href="https://osf.io/g7xsj/" rel="nofollow noreferrer">linked repository</a> has a ton of one-off scripts that may be helpful but are not very well documented. For example, here is a script that they use to generate TSV files which <em>may</em> be the &quot;ASV&quot;/&quot;ESV&quot; format:</p>
  <pre><code>#!/bin/bash
  source activate qiime2-2018.8
  
  for item in `ls */*table.qza`
      do
      name=`echo $item | cut -d\/ -f1`
      qiime tools export --input-path <span class="math-container">$item --output-path EXPORTS-GTDB-tax/$</span>name
      mv EXPORTS-GTDB-tax/<span class="math-container">$name/feature-table.biom EXPORTS-GTDB-tax/$</span>name.biom
      rmdir EXPORTS-GTDB-tax/$name
  done
  
  qiime tools export --input-path 11_ANT-28-5-SPA_seqs_classified_against_GTDB_r86.1_807F-1050R_primer_sliced/classification.qza --output-path EXPORTS-GTDB-tax/
  
  sed -i '1c#OTUID    taxonomy    confidence' EXPORTS-GTDB-tax/taxonomy.tsv
  
  #Tutorial here: https://forum.qiime2.org/t/exporting-and-modifying-biom-tables-e-g-adding-taxonomy-annotations/3630
  for item in `ls EXPORTS-GTDB-tax/*biom`
      do
      filestem=`basename $item .biom`
      biom add-metadata -i <span class="math-container">$item -o EXPORTS-GTDB-tax/$</span>filestem.with-tax.biom --observation-metadata-fp EXPORTS-GTDB-tax/taxonomy.tsv --sc-separated taxonomy
  done
  
  for item in `ls EXPORTS-GTDB-tax/*.with-tax.biom`
      do
      filestem=`basename $item .biom`
      biom convert -i <span class="math-container">$item -o EXPORTS-GTDB-tax/$</span>filestem.tsv --to-tsv --header-key taxonomy
  done
  
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-21T05:03:44.030Z
Answers.LastActivityDate: 2022-07-21T05:03:44.030Z
Answers.UserDisplayName: Maximilian Press
Body: <p>I am converting the fast5 file to fastq by using guppy basecaller after that by using kraken2 classified the sequence.</p>
  <p>Now I am trying to generate ASV file.</p>
  <p>Is this possible to generate ASV file from kraken output?</p>
  <p>Or is this any other way to generate ASV file from nanopore sequencing?</p>
  <p>I am new to nanopore sequencing data. I need help or suggestions to generate ASV file.</p>
  <p>Thank you</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-27T06:14:03.657Z
Comments.Text: What is an ASV file? You should add information about that file format to your question. [The first information I get](https://fileinfo.com/extension/asv) talks about MATLAB, which doesn't seem correct.
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-27T07:16:50.343Z
Comments.Text: ASV: amplicon sequence variant
Comments.UserDisplayName: envs_h_gang_5
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T16:16:59.903Z
Comments.Text: Dear @twinkle please do check the answer below and do consider upvoting/accepting. Its a good answer and it does help with site stats.
Comments.UserDisplayName: M__
Tags: <ngs><nanopore>
Title: How can I generate ASV file from nanopore sequencing data?
ThreadText: # How can I generate ASV file from nanopore sequencing data?
  
  (Asked by: username_0 on 2022-06-26)
  
  I am converting the fast5 file to fastq by using guppy basecaller after that by using kraken2 classified the sequence.
  
  Now I am trying to generate ASV file.
  
  Is this possible to generate ASV file from kraken output?
  
  Or is this any other way to generate ASV file from nanopore sequencing?
  
  I am new to nanopore sequencing data. I need help or suggestions to generate ASV file.
  
  Thank you
  
  **Tags:** ngs, nanopore
  
  > **Comments:**
  > **username_1**: What is an ASV file? You should add information about that file format to your question. [The first information I get](https://fileinfo.com/extension/asv) talks about MATLAB, which doesn't seem correct.  
  > **username_2**: ASV: amplicon sequence variant  
  > **username_3**: Dear @username_0 please do check the answer below and do consider upvoting/accepting. Its a good answer and it does help with site stats.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2022-07-21. Score: 1
  
  I am not sure that kraken/kraken2 does anything similar to this.
  
  Usually to get OTUs/ESVs I think that you want to use a tool that clusters your sequences into groupings that represent the same sequence, allowing for technical error.
  
  Examples might include [dada2](https://benjjneb.github.io/dada2/) or [dadasnake](https://academic.oup.com/gigascience/article/9/12/giaa135/6011256), or [qiime](https://forum.qiime2.org/t/can-we-process-nanopore-data-using-qiime2/16156/4). This is after the technical steps for adapter/trimming/denoising steps.
  
  kraken2 is more for classifying into known taxonomic categories based on a reference sequence, which is a related but distinct task.
  
  I don't think that I understand what the ESV file format is supposed to look like. [This resource](https://cmap.readthedocs.io/en/latest/catalog/datasets/ESV.html) seems to have some info on processing data into ESVs, but it is not for nanopore. Possibly it is still useful for the final step of creating that file format. A [linked repository](https://osf.io/g7xsj/) has a ton of one-off scripts that may be helpful but are not very well documented. For example, here is a script that they use to generate TSV files which *may* be the "ASV"/"ESV" format:
  
  ```
  #!/bin/bash
  source activate qiime2-2018.8
  
  for item in `ls */*table.qza`
      do
      name=`echo $item | cut -d\/ -f1`
      qiime tools export --input-path $item --output-path EXPORTS-GTDB-tax/$name
      mv EXPORTS-GTDB-tax/$name/feature-table.biom EXPORTS-GTDB-tax/$name.biom
      rmdir EXPORTS-GTDB-tax/$name
  done
  
  qiime tools export --input-path 11_ANT-28-5-SPA_seqs_classified_against_GTDB_r86.1_807F-1050R_primer_sliced/classification.qza --output-path EXPORTS-GTDB-tax/
  
  sed -i '1c#OTUID    taxonomy    confidence' EXPORTS-GTDB-tax/taxonomy.tsv
  
  #Tutorial here: https://forum.qiime2.org/t/exporting-and-modifying-biom-tables-e-g-adding-taxonomy-annotations/3630
  for item in `ls EXPORTS-GTDB-tax/*biom`
      do
      filestem=`basename $item .biom`
      biom add-metadata -i $item -o EXPORTS-GTDB-tax/$filestem.with-tax.biom --observation-metadata-fp EXPORTS-GTDB-tax/taxonomy.tsv --sc-separated taxonomy
  done
  
  for item in `ls EXPORTS-GTDB-tax/*.with-tax.biom`
      do
      filestem=`basename $item .biom`
      biom convert -i $item -o EXPORTS-GTDB-tax/$filestem.tsv --to-tsv --header-key taxonomy
  done
  
  ```
  
  
  ---
  
  