# DADA2 with non-oriented library

**URL:** https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817
**Category:** User Support
**Tags:** dada2
**Created:** [April 17, 2018, 1:44pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817 "2018-04-17T13:44:38Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![schillebeeckx](https://forum.qiime2.org/user_avatar/forum.qiime2.org/schillebeeckx/32/20020_2.png) [@schillebeeckx](https://forum.qiime2.org/u/schillebeeckx)
#### Post date: [April 17, 2018, 1:44pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/1 "2018-04-17T13:44:38Z")

</div>

I'm putting together a pipeline (qiime2-2017.10) to process our V4 MiSeq data that was prepped using a non-oriented library. Here's what I've got so far:

1. orient all reads in the same direction (using in-house script) and remove any primers found for the R1 file.
2. orient all reads in the same direction (using in-house script) and remove any primers found for the R2 file.
3. import oriented/trimmed R1 & R2 files into an `EMPPairedEndSequences` qiime artifact
4. demultiplex `qiime demux emp-paired --i-seqs seqs.qza --m-barcodes-file mapping.txt --m-barcodes-category BarcodeSequence --o-per-sample-sequences demux.qza --p-rev-comp-mapping-barcodes`
5. run DADA2: `qiime dada2 denoise-paired --i-demultiplexed-seqs demux.qza --p-trunc-len-f 220 --p-trunc-len-r 220 --output-dir dada2 --p-n-threads 0`

However DADA2 keeps exiting with an error (log attached as well as my demulitplexed visual file).

[seqMAT56\_demux.qzv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/f/fde06f7fbea782d8d2b5f1f6ece2eee65541b755.qzv) (305.6 KB)  
[qiime2-q2cli-err-04ctds97.txt](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/a/aa867d9bfd7cc42ec994e8032e03d69c8eb8d4a3.txt) (9.1 KB)

---

<div class="post-metadata">

### Author: ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)
#### Post date: [April 17, 2018, 1:57pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/2 "2018-04-17T13:57:36Z")

</div>



---

<div class="post-metadata">

### Author: ![tomasz](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tomasz](https://forum.qiime2.org/u/tomasz)
#### Post date: [April 17, 2018, 8:52pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/5 "2018-04-17T20:52:21Z")

</div>

Hi @Constantino\_Schilleb,

It's likely that your input demux file is somehow corrupted, but it's difficult to assess only on the basis of the `qzv` visualization that you attached. Do you also encounter errors while running `qiime deblur` on your sequences?

Tomasz

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [April 17, 2018, 9:12pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/6 "2018-04-17T21:12:21Z")

</div>



---

<div class="post-metadata">

### Author: ![MMC\_northS](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@MMC\_northS](https://forum.qiime2.org/u/MMC_northS)
#### Post date: [April 18, 2018, 7:32am UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/7 "2018-04-18T07:32:44Z")

</div>

Hi @schillebeeckx

I am using PGM ion torrent instead Miseq but I have he same problem about the orientation of my sequences in single end. I have in each fastq/sample both orientations. Could you help me with the reorientation? I am not sure about how to do it.

regarding your imported sequences, do you have one file per sample or one for all samples? I have one file per sample and to import like demultiplexed file I used one manifest file. Dada and deblur run without errors, but in my case with wrong results due to my mixed orientations.

Thanks for your help

---

<div class="post-metadata">

### Author: ![schillebeeckx](https://forum.qiime2.org/user_avatar/forum.qiime2.org/schillebeeckx/32/20020_2.png) [@schillebeeckx](https://forum.qiime2.org/u/schillebeeckx)
#### Post date: [April 18, 2018, 5:55pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/8 "2018-04-18T17:55:17Z")

</div>

I'm not familiar with PGM ion torrent but I've provided the script I'm using to orient & trim. Note that it checks for primers on both ends of joined reads. You mention single-ended reads, so the script may have to be modified to handle that case. Also, you'll probably have to update it with your own primers.[V4V5\_orient\_and\_trim\_primers\_fuzzy.py](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/2/2b30e106d869bc7c900addf090bf0ad079b0db57.py) (8.2 KB)

---

<div class="post-metadata">

### Author: ![schillebeeckx](https://forum.qiime2.org/user_avatar/forum.qiime2.org/schillebeeckx/32/20020_2.png) [@schillebeeckx](https://forum.qiime2.org/u/schillebeeckx)
#### Post date: [April 18, 2018, 5:55pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/9 "2018-04-18T17:55:21Z")

</div>

> [@tomasz](#):
>
> It’s likely that your input demux file is somehow corrupted

In my orient & trim step, the resulting R1 & R2 reads won't necessarily be the same length (either within a file or between the two files). Is that the issue? Is there any other way I can validate my demux file?

> [@tomasz](#):
>
> Do you also encounter errors while running `qiime deblur` on your sequences?

I ran the following with no issues:  
`qiime deblur denoise-16S --i-demultiplexed-seqs seqMAT56_demux.qza --p-trim-length 220 --p-sample-stats --output-dir deblur --p-jobs-to-start 10`  
and have attached the output visualizations.

[stats.qzv](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/flex002/uploads/qiime21/original/2X/1/1aaa6aac81441d097833357ed0f89823e4785421.qzv) (233.4 KB)

---

<div class="post-metadata">

### Author: ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)
#### Post date: [April 18, 2018, 5:57pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/11 "2018-04-18T17:57:47Z")

</div>



---

<div class="post-metadata">

### Author: ![MMC\_northS](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@MMC\_northS](https://forum.qiime2.org/u/MMC_northS)
#### Post date: [April 19, 2018, 7:02am UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/12 "2018-04-19T07:02:07Z")

</div>

Thank you very much @schillebeeckx for sharing the script! I will to modify for my conditions (primers, sequences single end, etc.). Thanks again!  
MMC

---

<div class="post-metadata">

### Author: ![MMC\_northS](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@MMC\_northS](https://forum.qiime2.org/u/MMC_northS)
#### Post date: [April 19, 2018, 7:05am UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/13 "2018-04-19T07:05:15Z")

</div>

I do not know why you had problems in Dada, but in Deblur the results seem normal. Except for the two first samples, which have low sequnces, the rest lose arond 25-36% of sequences because the size of the fragment. Maybe you can try lower trimming, 200, 180, for example, in order to check how many sequences you recover after denoised filter if you use lower size.

---

<div class="post-metadata">

### Author: ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)
#### Post date: [April 22, 2018, 3:45pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/14 "2018-04-22T15:45:39Z")

</div>

Hey @schillebeeckx,

A shot in the dark, is it possible that your forward and reverse reads are the same for one (or more) of your samples? Your problem sounds similar to this thread:

> [@Q2-dada2: Error in isBimeraDenovoTable(unqs\[\[i\]\], ..., verbose = verbose) : Input must be a valid sequence table](https://forum.qiime2.org/t/q2-dada2-error-in-isbimeradenovotable-unqs-i-verbose-verbose-input-must-be-a-valid-sequence-table/3288):
>
> [https://github.com/qiime2/q2-dada2/issues/90](https://github.com/qiime2/q2-dada2/issues/90) Hello, I got the error below at the step of chimera detection. I wonder if this is that there were no sequences left for chimera detection at the end of that stage. Running qiime 2 Feb 2018 version. Let me know if you need any further info System versions Python version: 3.5.5 QIIME 2 release: 2018.2 QIIME 2 version: 2018.2.0 q2cli version: 2018.2.0 Installed plugins alignment 2018.2.0 composition 2018.2.0 cutadapt 2018.2.0 dada2 2018.2…

---

<div class="post-metadata">

### Author: ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)
#### Post date: [April 22, 2018, 3:45pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/15 "2018-04-22T15:45:47Z")

</div>



---

<div class="post-metadata">

### Author: ![schillebeeckx](https://forum.qiime2.org/user_avatar/forum.qiime2.org/schillebeeckx/32/20020_2.png) [@schillebeeckx](https://forum.qiime2.org/u/schillebeeckx)
#### Post date: [April 23, 2018, 9:31pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/16 "2018-04-23T21:31:52Z")

</div>

I was able to isolate the issue to my trimming and orienting step. In the rare case of a primer being present in only on read direction (either R1 or R2), that read half will get oriented (and potentially reversed complimented) whereas its pair will not. I've since updated my orient script to handle said case.

I'm not sure if this is moot, or if either the QIIME2 or DADA2 developers want to update their error reporting for this. If required I can provide example data to re-create this issue.

---

<div class="post-metadata">

### Author: ![antgonza](https://forum.qiime2.org/user_avatar/forum.qiime2.org/antgonza/32/1236_2.png) [@antgonza](https://forum.qiime2.org/u/antgonza)
#### Post date: [April 24, 2018, 2:53pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/17 "2018-04-24T14:53:07Z")

</div>

Thanks @schillebeeckx. I agree that improving error message will be great to avoid other people wondering about this. Could you open an issue? I _think_ [here](https://github.com/qiime2/q2-dada2/issues) is the right repository.

---

<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: [May 25, 2018, 8:53pm UTC](https://forum.qiime2.org/t/dada2-with-non-oriented-library/3817/18 "2018-05-25T20:53:10Z")

</div>

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