Error qiime dada2 denoise-paired

Hi all!
I have some problems with the following command:
$ qiime dada2 denoise-paired --i-demultiplexed-seqs paired-end-demux.qza --p-n-threads 0 --p-trim-left-f 11 --p-trim-left-r 11 --p-trunc-len-f 250 --p-trunc-len-r 250 --o-table table.qza --o-representative-sequences rep-seqs-dada2.qza --o-denoising-stats denoising-stats.qza

The error message is:
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/tmpz94iqrob/forward /tmp/tmpz94iqrob/reverse /tmp/tmpz94iqrob/output.tsv.biom /tmp/tmpz94iqrob/track.tsv /tmp/tmpz94iqrob/filt_f /tmp/tmpz94iqrob/filt_r 250 250 11 11 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.3

  1. Filtering Error in sendMaster(try(lapply(X = S, FUN = FUN, …), silent = TRUE)) :
    write error, closing pipe to the master
    Error in names(answer) <- names1 :
    ‘names’ attribute [24] must be the same length as the vector [23]
    Execution halted
    Traceback (most recent call last):
    File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 234, in denoise_paired
    run_commands([cmd])
    File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 36, in run_commands
    subprocess.run(cmd, check=True)
    File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/subprocess.py”, line 418, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command ‘[‘run_dada_paired.R’, ‘/tmp/tmpz94iqrob/forward’, ‘/tmp/tmpz94iqrob/reverse’, ‘/tmp/tmpz94iqrob/output.tsv.biom’, ‘/tmp/tmpz94iqrob/track.tsv’, ‘/tmp/tmpz94iqrob/filt_f’, ‘/tmp/tmpz94iqrob/filt_r’, ‘250’, ‘250’, ‘11’, ‘11’, ‘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/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/commands.py”, line 327, in call
results = action(**arguments)
File “</home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/decorator.py:decorator-gen-459>”, line 2, in denoise_paired
File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 240, in bound_callable
output_types, provenance)
File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 383, in callable_executor
output_views = self._callable(**view_args)
File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 249, 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.

**Thanks a lot **! :slightly_smiling_face:
Regards

1 Like

Hello @PatoUru,

Welcome to the Qiime 2 forums! :qiime2:

I think I have spotted the problem;

‘names’ attribute [24] must be the same length as the vector [23]

Based on a quick search of the forums, people are getting this error when running: --p-n-threads 0. Try setting that to 2 or 4 or the number CPU threads that you have and see if that helps.

Colin

Thanks for your answer! So, I changed the number of cores to 4
and I got the following error
$ qiime dada2 denoise-paired --i-demultiplexed-seqs paired-end-demux.qza –p-n-threads 4 --p-trim-left-f 11 --p-trim-left-r 11 --p-trunc-len-f 250 --p-trunc-len-r 250 --o-table table.qza --o-representative-sequences rep-seqs-dada2.qza --o-denoising-stats denoising-stats.qza

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/tmpqymvqpvl/forward /tmp/tmpqymvqpvl/reverse /tmp/tmpqymvqpvl/output.tsv.biom /tmp/tmpqymvqpvl/track.tsv /tmp/tmpqymvqpvl/filt_f /tmp/tmpqymvqpvl/filt_r 250 250 11 11 2.0 2.0 2 consensus 1.0 4 1000000

R version 3.5.1 (2018-07-02)
Loading required package: Rcpp
DADA2: 1.10.0 / Rcpp: 1.0.2 / RcppParallel: 4.4.3

  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: 26634, 33593.
    Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :
    Mismatched forward and reverse sequence files: 26634, 33593.
    Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :
    Mismatched forward and reverse sequence files: 26634, 33593.
    Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :
    Mismatched forward and reverse sequence files: 26634, 33593.
    Error in (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0, :
    Mismatched forward and reverse sequence files: 26634, 33593.
    Execution halted
    Traceback (most recent call last):
    File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 234, in denoise_paired
    run_commands([cmd])
    File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 36, in run_commands
    subprocess.run(cmd, check=True)
    File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/subprocess.py”, line 418, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command ‘[‘run_dada_paired.R’, ‘/tmp/tmpqymvqpvl/forward’, ‘/tmp/tmpqymvqpvl/reverse’, ‘/tmp/tmpqymvqpvl/output.tsv.biom’, ‘/tmp/tmpqymvqpvl/track.tsv’, ‘/tmp/tmpqymvqpvl/filt_f’, ‘/tmp/tmpqymvqpvl/filt_r’, ‘250’, ‘250’, ‘11’, ‘11’, ‘2.0’, ‘2.0’, ‘2’, ‘consensus’, ‘1.0’, ‘4’, ‘1000000’]’ returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/commands.py”, line 327, in call
results = action(**arguments)
File “</home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/decorator.py:decorator-gen-459>”, line 2, in denoise_paired
File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 240, in bound_callable
output_types, provenance)
File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 383, in callable_executor
output_views = self._callable(**view_args)
File “/home/patricia/anaconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 249, 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.

Previously, I had imported the data with the following command
qiime tools import --type ‘SampleData[PairedEndSequencesWithQuality]’ --input-path manifiest_final.txt --output-path paired-end-demux.qza --input-format PairedEndFastqManifestPhred33
Imported manifiest_final.txt as PairedEndFastqManifestPhred33 to paired-end-demux.qza

What other information could I send to find the error?
Thank you!!

1 Like

OK great! That appears to have solved the first error.

Now on to this new errror:

You have more reads in your reverse file than your forward file! That’s can’t be good.

Did you do some sort of trimming or filtering on these files before importing them into Qiime 2? Does this command run successfully when you run it on the file directly from the Illumina instrument?

We already checked it and the R1 files have the same number of sequences as the R2 files.
We did not do a fastq preprocessing. We import them directly into qiime2 through the manifest file.
I don’t know what could be happening :thinking:

1 Like

Thanks for checking on your reads for me.

I think I mis-diagnosed this error! I’m sorry to have caused any confusion.

I think you may have stumbled onto this bug:

Let’s see if @ebolyen can recommend a workaround.

Please double check your manifest file and make sure you didn’t accidentally pair the wrong reverse and forward reads into the same sample (we have seen this happen before).