# Please help me！I use DADA2 to generate ASV table error, request your help!

**URL:** https://forum.qiime2.org/t/please-help-me-i-use-dada2-to-generate-asv-table-error-request-your-help/23184
**Category:** User Support
**Tags:** dada2, demux, import, feature-table
**Created:** [May 26, 2022, 4:31am UTC](https://forum.qiime2.org/t/please-help-me-i-use-dada2-to-generate-asv-table-error-request-your-help/23184 "2022-05-26T04:31:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JayZ](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@JayZ](https://forum.qiime2.org/u/JayZ)
#### Post date: [May 26, 2022, 4:31am UTC](https://forum.qiime2.org/t/please-help-me-i-use-dada2-to-generate-asv-table-error-request-your-help/23184/1 "2022-05-26T04:31:39Z")

</div>

```auto
qiime dada2 denoise-paired
--i-demultiplexed-seqs ./导入的序列/paired-end-demux.qza
--p-trim-left-f 23
--p-trim-left-r 23
--p-trunc-len-f 250
--p-trunc-len-r 250
--o-table ./质控聚类/table.qza
--o-representative-sequences ./质控聚类/rep-seqs.qza
--o-denoising-stats ./质控聚类/denoising-stats.qza
--p-n-threads 0
--verbose

```

```auto
Running external command line application(s). 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/tmpq32ozyap/forward /tmp/tmpq32ozyap/reverse /tmp/tmpq32ozyap/output.tsv.biom /tmp/tmpq32ozyap/track.tsv /tmp/tmpq32ozyap/filt_f /tmp/tmpq32ozyap/filt_r 250 250 23 23 2.0 2.0 2 12 independent consensus 1.0 0 1000000

R version 4.0.5 (2021-03-31) 
Loading required package: Rcpp
DADA2: 1.18.0 / Rcpp: 1.0.7 / RcppParallel: 5.1.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: 51326, 60771.
Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, : 
  Mismatched forward and reverse sequence files: 51326, 60771.
Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, : 
  Mismatched forward and reverse sequence files: 51326, 60771.
Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, : 
  Mismatched forward and reverse sequence files: 51326, 60771.
Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, : 
  Mismatched forward and reverse sequence files: 51326, 60771.
Execution halted
Traceback (most recent call last):
  File "/home/qiime2/miniconda/envs/qiime2-2021.11/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 266, in denoise_paired
    run_commands([cmd])
  File "/home/qiime2/miniconda/envs/qiime2-2021.11/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
  File "/home/qiime2/miniconda/envs/qiime2-2021.11/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmpq32ozyap/forward', '/tmp/tmpq32ozyap/reverse', '/tmp/tmpq32ozyap/output.tsv.biom', '/tmp/tmpq32ozyap/track.tsv', '/tmp/tmpq32ozyap/filt_f', '/tmp/tmpq32ozyap/filt_r', '250', '250', '23', '23', '2.0', '2.0', '2', '12', 'independent', 'consensus', '1.0', '0', '1000000']' returned non-zero exit status 1.

```

```auto
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/qiime2/miniconda/envs/qiime2-2021.11/lib/python3.8/site-packages/q2cli/commands.py", line 339, in __call__
    results = action(**arguments)
  File "<decorator-gen-398>", line 2, in denoise_paired
  File "/home/qiime2/miniconda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/home/qiime2/miniconda/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/sdk/action.py", line 391, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/home/qiime2/miniconda/envs/qiime2-2021.11/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 279, in denoise_paired
    raise Exception("An error was encountered while running DADA2"
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

See above for debug info.

```

---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [June 6, 2022, 8:35pm UTC](https://forum.qiime2.org/t/please-help-me-i-use-dada2-to-generate-asv-table-error-request-your-help/23184/2 "2022-06-06T20:35:52Z")

</div>



---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [June 8, 2022, 5:44pm UTC](https://forum.qiime2.org/t/please-help-me-i-use-dada2-to-generate-asv-table-error-request-your-help/23184/3 "2022-06-08T17:44:02Z")

</div>

Hi @JayZ,

Welcome to the :qiime2: forum! 👋🏼

> [@JayZ](#):
>
> ` Mismatched forward and reverse sequence files: 51326, 60771.`

This is the the issue - which could be caused by a few different things:

- Having a differing number sequence counts between your forward and reverse reads.
- The sequences in one of the two paired files could be out of order with respect to the other.
- There could be non standard headers in one (or both) of the files that makes the parser "think" the files are mismatched.

This is actually not an uncommon issue - I've linked a few forum posts below, as well as a Github issue that will provide you with a handful of troubleshooting steps you can take to determine the source of this mismatch and how to resolve it.

> <https://github.com/benjjneb/dada2/issues/737>
>
> Hello,
> 
> I am getting the following error:
> \`Error in fastqPairedFilter(c(fnFs\[…i\], fnRs\[i\]), c(filtFs\[i\], filtRs\[i\]), : 
> Mismatched forward and reverse sequence files: 7483, 3490.\`
> 
> I used q1 to demultiplex my reads using the suggested parameters. I added the \`\_R1\` or \`\_R2\` to each file.
> The following is my dada2 script: 
> \`path \<- "/home/ocho/RC2PWPCR\_ASVs/qiimedemux"
> fns \<- list.files(path)\`
> 
> \`fastqs \<- fns\[grepl(".fastq$", fns)\]
> fastqs \<- sort(fastqs)\`
> 
> \`fnFs \<- fastqs\[grepl("\_R1", fastqs)\]
> fnRs \<- fastqs\[grepl("\_R2", fastqs)\]\`
> \`sample.names \<- sapply(strsplit(fnFs, "\_"), \`\[\`, 1)\`
> 
> \`fnFs \<- file.path(path, fnFs)
> fnRs \<- file.path(path, fnRs)\`
> 
> \`filt\_path \<- file.path(path,"filtered")
> if(!file\_test("-d", filt\_path)) dir.create(filt\_path)\`
> \`filtFs \<- file.path(filt\_path, paste0(sample.names, "\_F\_filt.fastq"))
> filtRs \<- file.path(filt\_path, paste0(sample.names, "\_R\_filt.fastq"))\`
> 
> \#i need to remove the barcode (12) + the linkerprimer (37) AND the R primer (20)
> \#because there is only 9bp overlap here, I cannot truncate
> 
> \`for(i in seq\_along(fnFs)) {
> fastqPairedFilter(c(fnFs\[i\], fnRs\[i\]), c(filtFs\[i\], filtRs\[i\]),
> trimLeft = c(49, 20), truncLen = c(239, 251),
> maxN = 0, maxEE = 2, truncQ = 2,
> verbose = TRUE)\`
> 
> And I received the above error message. I am not quite sure the issue as I have prepared sequences this way before (using q1 demultiplexing algorithm). To verify, I also used adapter removal's demultiplex algorithm as well and it was the same error. The files that it gets hung on are are also the first in the lists (samples \`10A\_R1.fastq\` and \`10A\_R2.fastq\`). 
> 
> I have seen this problem mentioned \[here\](https://github.com/benjjneb/dada2/issues/261) but couldn't fit the solutions to my issue and also on q2 where it seemed to be a file naming \[issue\](https://forum.qiime2.org/t/dada2-mismatched-fwd-and-rev-reads/2133). 
> 
> Thanks!

> [@Mismatched forward and reverse sequence files - files don't exist](https://forum.qiime2.org/t/mismatched-forward-and-reverse-sequence-files-files-dont-exist/12511):
>
> Hello, I am currently using qiime2-2019.10. While running DADA2 I ran into a mismatched forward and reverse sequence file error. I found similar issues in other threads in the forum and attempted to repeat the steps but the mismatched files don’t seem to exist. My input and the qiime2 output is below: qiime dada2 denoise-paired \ \> --i-demultiplexed-seqs demux-paired-end.qza \ \> --p-trim-left-f 13 \ \> --p-trim-left-r 13 \ \> --p-trunc-len-f 247 \ \> --p-trunc-len-r 247 \ \> --…

> [@Mismatched forward and reverse sequence files](https://forum.qiime2.org/t/mismatched-forward-and-reverse-sequence-files/22891):
>
> hello I have a problem with DADA2 filtering The output result seems there is a mismatch between my forward and reverse file I have already checked similar issues on the forum [https://forum.qiime2.org/t/error-in-filtering-using-dada2/3543/11](https://forum.qiime2.org/t/error-in-filtering-using-dada2/3543/11)[https://forum.qiime2.org/t/mismatched-forward-and-reverse-sequence-files-files-dont-exist/12511](https://forum.qiime2.org/t/mismatched-forward-and-reverse-sequence-files-files-dont-exist/12511) here are my input and output #input #import data qiime tools import \ --type 'SampleData[PairedEndSequencesWithQuality]' \ --input-path /home/chaojuic…

Hope this helps!

Cheers 🦎

---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [June 8, 2022, 5:46pm UTC](https://forum.qiime2.org/t/please-help-me-i-use-dada2-to-generate-asv-table-error-request-your-help/23184/4 "2022-06-08T17:46:27Z")

</div>



---

<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: [July 9, 2022, 11:46pm UTC](https://forum.qiime2.org/t/please-help-me-i-use-dada2-to-generate-asv-table-error-request-your-help/23184/5 "2022-07-09T23:46:32Z")

</div>

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