Answers.Body: <p>I'm working on something similar as a side project. I'll detail the steps that I'm using, but I'm curious if others can suggest a better way.</p>
  
  <ul>
  <li><p>You don't mention if your data are paired-end, but in my case I have paired-end sequences that overlap in the middle. I used <a href="https://ccb.jhu.edu/software/FLASH" rel="nofollow noreferrer">FLASh</a> to merge the reads and <a href="https://github.com/lh3/seqtk" rel="nofollow noreferrer">seqtk</a> to convert the reads to fasta format.</p></li>
  <li><p>I used the cluster_fast algorithm in <a href="https://github.com/torognes/vsearch" rel="nofollow noreferrer">vsearch</a> to cluster sequences at 100% identity, then filtered out rare sequence types (&lt;10 sequences) to account for sequencing errors.</p></li>
  <li><p>This resulted in a manageable number of unique sequences, which I searched against a custom database using vsearch, but which could also have been searched against the nr database using blast.</p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-03T12:13:22.150Z
Answers.LastActivityDate: 2017-07-03T12:13:22.150Z
Answers.UserDisplayName: heathobrien
Answers.Body: <p>Regarding your third question ("Where could I get a database of COI/COX data?"), you can apparently search and download fasta sequences from <a href="http://www.boldsystems.org/index.php/Public_SearchTerms" rel="nofollow noreferrer">BOLD</a>.</p>
  
  <p>However, I don't see a "select all" button to select all records found by one search in a single fasta file.</p>
  
  <p>There seems to exist an R API: <a href="https://cran.r-project.org/web/packages/bold/bold.pdf" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/bold/bold.pdf</a> which refers to this: <a href="http://www.boldsystems.org/index.php/resources/api#sequenceParameters" rel="nofollow noreferrer">http://www.boldsystems.org/index.php/resources/api#sequenceParameters</a>>.</p>
  
  <p>From this I seem to understand that one can directly query using urls:</p>
  
  <pre><code>wget -O Gastropoda.fa http://www.boldsystems.org/index.php/API_Public/sequence?taxon=Gastropoda&amp;marker=COI
  </code></pre>
  
  <p>And I get a fasta file containing COI sequences for Gastropoda. There may be ways to refine the query geographically, using the <code>geo</code> parameter.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-04T09:26:17.017Z
Answers.Text: Yes, I already downloaded some of the BOLD data. I circumvented the missing "select all" button by using a firefox addon for selection boxes. I did not know that there is an R API, that will be helpful.
Answers.UserDisplayName: Cyberfox
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-03T14:28:22.810Z
Answers.LastActivityDate: 2017-07-03T15:34:15.717Z
Answers.LastEditDate: 2017-07-03T15:34:15.717Z
Answers.UserDisplayName: bli
Body: <p>For a diet analysis of an insect-eating animal, all species in a sample shall be identified. For this a sequencing of the metagenomic sample was done, where the COI/COX region was used as a barcode and amplified. This resulted in 20 million reads (after quality control). </p>
  
  <p>While looking for an apropriate workflow, I am faced with these issues:</p>
  
  <ul>
  <li><p>For many tools 20 million reads are to much to handle (BLAST for
  instance)</p></li>
  <li><p>For the majority of metagenomic tools the focus is on micro-organisms, not insects</p></li>
  <li><p>The database to search against must contain COI/COX data, mainly from insects, however, the animal could also eat snails or frog eggs...</p></li>
  <li><p>Since the reads are amplicons some analysis are not recommended</p></li>
  </ul>
  
  <p>Leaving me with these questions:</p>
  
  <ol>
  <li>What are the typical analysis steps in a workflow like this?</li>
  <li>Which tools could I use for my purpose?</li>
  <li>Where could I get a database of COI/COX data?</li>
  </ol>
  
Tags: <metagenome><barcode>
Title: Workflow of metabarcoding analysis
ThreadText: # Workflow of metabarcoding analysis
  
  (Asked by: username_0 on 2017-07-03)
  
  For a diet analysis of an insect-eating animal, all species in a sample shall be identified. For this a sequencing of the metagenomic sample was done, where the COI/COX region was used as a barcode and amplified. This resulted in 20 million reads (after quality control).
  
  While looking for an apropriate workflow, I am faced with these issues:
  
  * For many tools 20 million reads are to much to handle (BLAST for
    instance)
  * For the majority of metagenomic tools the focus is on micro-organisms, not insects
  * The database to search against must contain COI/COX data, mainly from insects, however, the animal could also eat snails or frog eggs...
  * Since the reads are amplicons some analysis are not recommended
  
  Leaving me with these questions:
  
  1. What are the typical analysis steps in a workflow like this?
  2. Which tools could I use for my purpose?
  3. Where could I get a database of COI/COX data?
  
  **Tags:** metagenome, barcode
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-07-03. Score: 0 | Accepted answer
  
  I'm working on something similar as a side project. I'll detail the steps that I'm using, but I'm curious if others can suggest a better way.
  
  * You don't mention if your data are paired-end, but in my case I have paired-end sequences that overlap in the middle. I used [FLASh](https://ccb.jhu.edu/software/FLASH) to merge the reads and [seqtk](https://github.com/lh3/seqtk) to convert the reads to fasta format.
  * I used the cluster\_fast algorithm in [vsearch](https://github.com/torognes/vsearch) to cluster sequences at 100% identity, then filtered out rare sequence types (<10 sequences) to account for sequencing errors.
  * This resulted in a manageable number of unique sequences, which I searched against a custom database using vsearch, but which could also have been searched against the nr database using blast.
  
  
  ---
  
  ### Answer by username_2 on 2017-07-03. Score: 0
  
  Regarding your third question ("Where could I get a database of COI/COX data?"), you can apparently search and download fasta sequences from [BOLD](http://www.boldsystems.org/index.php/Public_SearchTerms).
  
  However, I don't see a "select all" button to select all records found by one search in a single fasta file.
  
  There seems to exist an R API: <https://cran.r-project.org/web/packages/bold/bold.pdf> which refers to this: <http://www.boldsystems.org/index.php/resources/api#sequenceParameters>>.
  
  From this I seem to understand that one can directly query using urls:
  
  ```
  wget -O Gastropoda.fa http://www.boldsystems.org/index.php/API_Public/sequence?taxon=Gastropoda&marker=COI
  
  ```
  
  And I get a fasta file containing COI sequences for Gastropoda. There may be ways to refine the query geographically, using the `geo` parameter.
  
  > **Comments:**
  > **username_0**: Yes, I already downloaded some of the BOLD data. I circumvented the missing "select all" button by using a firefox addon for selection boxes. I did not know that there is an R API, that will be helpful.  
  
  ---
  
  