# Error with DADA2 script

**URL:** <https://forum.qiime2.org/t/error-with-dada2-script/13442>\
**Category:** Technical Support\
**Created:** [February 3, 2020, 11:45am UTC](https://forum.qiime2.org/t/error-with-dada2-script/13442 "2020-02-03T11:45:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dperez](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dperez](https://forum.qiime2.org/u/dperez)\
**Post date:** [February 3, 2020, 11:45am UTC](https://forum.qiime2.org/t/error-with-dada2-script/13442/1 "2020-02-03T11:45:08Z")

</div>

Hi QIIME2 developers!

I have a problem when I was running the **qiime dada2 denoise-paired** command with QIIME2 (2019.10 version) . The script is:  
\*--i-demultiplexed-seqs demux-paired-end-cats.qza \*

- --p-trim-left-f 16 \*
- --p-trim-left-r 24 \*
- --p-trunc-len-f 287 \*
- --p-trunc-len-r 228 \*
- --p-chimera-method consensus \*
- --p-n-threads 0 \*
- --o-table table-cats-general.qza \*
- --o-representative-sequences rep-seqs-cats-general.qza \*  
\*\* --o-denoising-stats denoising-stats-cats-general.qza &\*

After running that I get the following error: _ **Plugin error from dada2:** _  
_**An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more. Debug info has been saved to /tmp/qiime2-q2cli-err-ieqb5504.log**_

The explanation of this error is:

_ **This may print messages to stdout and/or stderr.** _  
_**The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.**_

_ **Command: run\_dada\_paired.R /tmp/tmpp82gj2f6/forward /tmp/tmpp82gj2f6/reverse /tmp/tmpp82gj2f6/output.tsv.biom /tmp/tmpp82gj2f6/track.tsv /tmp/tmpp82gj2f6/filt\_f /tmp/tmpp82gj2f6/filt\_r 287 228 16 24 2.0 2.0 2 consensus 1.0 0 1000000** _

_**R version 3.5.1 (2018-07-02)**_  
_ **Loading required package: Rcpp** _  
_ **DADA2: 1.10.0 / Rcpp: 1.0.2 / RcppParallel: 4.4.4** _  
_**1) Filtering Error in filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF, :**_  
\*\*\* These are the errors (up to 5) encountered in individual cores...\*\*\*  
_**Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :**_  
\*\*\* Mismatched forward and reverse sequence files: 31425, 43609.\*\*\*  
_**Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :**_  
\*\*\* Mismatched forward and reverse sequence files: 43609, 31425.\*\*\*  
_**Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :**_  
\*\*\* Mismatched forward and reverse sequence files: 31425, 43609.\*\*\*  
_**Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :**_  
\*\*\* Mismatched forward and reverse sequence files: 43609, 31425.\*\*\*  
_**Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :**_  
\*\*\* Mismatched forward and reverse sequence files: 31425, 43609.\*\*\*  
_ **Execution halted** _  
_**Traceback (most recent call last):**_  
\*\*\* File "/home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 257, in denoise\_paired\*\*\*  
\*\*\* run\_commands([cmd])\*\*\*  
\*\*\* File "/home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 36, in run\_commands\*\*\*  
\*\*\* subprocess.run(cmd, check=True)\*\*\*  
\*\*\* File "/home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/subprocess.py", line 418, in run\*\*\*  
\*\*\* output=stdout, stderr=stderr)\*\*\*  
_**subprocess.CalledProcessError: Command '['run\_dada\_paired.R', '/tmp/tmpp82gj2f6/forward', '/tmp/tmpp82gj2f6/reverse', '/tmp/tmpp82gj2f6/output.tsv.biom', '/tmp/tmpp82gj2f6/track.tsv', '/tmp/tmpp82gj2f6/filt\_f', '/tmp/tmpp82gj2f6/filt\_r', '287', '228', '16', '24', '2.0', '2.0', '2', 'consensus', '1.0', '0', '1000000']' returned non-zero exit status 1.**_

_ **During handling of the above exception, another exception occurred:** _

_**Traceback (most recent call last):**_  
\*\*\* File "/home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/site-packages/q2cli/commands.py", line 328, in **call** \*\*\*  
\*\*\* results = action(**arguments)**\*  
\*\*\* File "\</home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/site-packages/decorator.py:decorator-gen-459\>", line 2, in denoise\_paired\*\*\*  
\*\*\* File "/home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/site-packages/qiime2/sdk/action.py", line 240, in bound\_callable\*\*\*  
\*\*\* output\_types, provenance)\*\*\*  
\*\*\* File "/home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/site-packages/qiime2/sdk/action.py", line 383, in _callable\_executor_\*\*\*  
\*\*\* output\_views = self.\_callable(**view\_args)**\*  
\*\*\* File "/home/dperez/.conda/envs/qiime2-2019.10/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 272, in denoise\_paired\*\*\*  
\*\*\* " and stderr to learn more." % e.returncode)\*\*\*  
_**Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.**_

I've never had this error before so I don't know how to deal with it. Any suggestion to solve it?

Thank you very much,  
Daniel.

---

<div class="post-metadata">

**Author:** ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)\
**Post date:** [February 3, 2020, 5:33pm UTC](https://forum.qiime2.org/t/error-with-dada2-script/13442/2 "2020-02-03T17:33:10Z")

</div>

Hello Daniel,

Did you look through the error message for clues? Here is what I noticed:

> \*\*\* Mismatched forward and reverse sequence files: 31425, 43609.\*\*\*

I saw that several times...

So it looks like your forward and reverse reads no longer match. Has someone prefiltered the fastq files before you processed them with Qiime 2? We are looking for any clues that could show the source of this mismatch.

Colin

---

<div class="post-metadata">

**Author:** ![dperez](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dperez](https://forum.qiime2.org/u/dperez)\
**Post date:** [February 4, 2020, 1:32pm UTC](https://forum.qiime2.org/t/error-with-dada2-script/13442/3 "2020-02-04T13:32:09Z")

</div>

Hi,  
Thank you very much for your reply.  
Nobody has filtered de fastq files before. The script I used to import the data was:  
\*qiime tools import \*

- --type 'SampleData[PairedEndSequencesWithQuality]' \*
- --input-path cats \*
- --input-format CasavaOneEightSingleLanePerSampleDirFmt \*
- --output-path demux-paired-end-cats.qza &\*

As I said before, I always follow the same script and I've never had any problem. Have you got any clue to know what sample (or samples) is problematic?

Than you very much,

Dani.

---

<div class="post-metadata">

**Author:** ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)\
**Post date:** [February 4, 2020, 3:14pm UTC](https://forum.qiime2.org/t/error-with-dada2-script/13442/4 "2020-02-04T15:14:00Z")

</div>

Hello Dani,

I'm not sure which samples have mismatched reads. This information might be in one of the dada2 log files.

> [@dperez](#):
>
> As I said before, I always follow the same script and I’ve never had any problem. Have you got any clue to know what sample (or samples) is problematic?

My first guess is some sort of prefiltering, but it that's not it then I'm stumped too. Maybe the Illumina run failed but managed to output some reads? Maybe bcl2fastq didn't finish running? 🤔

Colin
