I would like to ask your help on this error I get when running DADA2.
When I run the following command:
qiime dada2 denoise-paired
–i-demultiplexed-seqs 16S_trimmed.qza
–p-trunc-len-f 180 --p-trunc-len-r 120
–p-trim-left-f 0
–p-trim-left-r 5
–p-trunc-q 20
–p-n-threads 24
–p-chimera-method “pooled”
–output-dir dada2.1
–verbose
I get the following error: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.
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.
R version 3.5.1 (2018-07-02)
Loading required package: Rcpp
DADA2: 1.10.0 / Rcpp: 1.0.4.6 / RcppParallel: 5.0.0
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 [224] must be the same length as the vector [215]
Execution halted
Traceback (most recent call last):
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 264, in denoise_paired
run_commands([cmd])
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 36, in run_commands
subprocess.run(cmd, check=True)
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/subprocess.py”, line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘run_dada_paired.R’, ‘/tmp/tmpoqz0fanr/forward’, ‘/tmp/tmpoqz0fanr/reverse’, ‘/tmp/tmpoqz0fanr/output.tsv.biom’, ‘/tmp/tmpoqz0fanr/track.tsv’, ‘/tmp/tmpoqz0fanr/filt_f’, ‘/tmp/tmpoqz0fanr/filt_r’, ‘180’, ‘120’, ‘0’, ‘5’, ‘2.0’, ‘2.0’, ‘20’, ‘independent’, ‘pooled’, ‘1.0’, ‘24’, ‘1000000’]’ returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/commands.py”, line 329, in call
results = action(**arguments)
File “”, line 2, in denoise_paired
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 245, in bound_callable
output_types, provenance)
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 390, in callable_executor
output_views = self._callable(**view_args)
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 279, 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.
Which 16S region are you working on? And which full amplicon length would you expect for this?
What length are your sequences? (2x250bp, 2x300bp )
Which sequencing platform did you use?
Your settings seems quite stringent to me, I doubt you have any merging region left after the trimming. I would also remove the ‘-p-trunc-q’ option, because you probably are loosing lots of bases with this (I mean, the job of a denoiser is to work hard to improve base quality, isn’t it? )
Please keep in mind that you should allow for at least 12 bases of overlap between forward and reverse reads, after the primer trimming and considering the --p-trim-len option.
I think your reverse trimming length is still too stringent.
How long is the expected amplicon?
Could you share your demultiplexed.qzv file (after cutadapt step)? If you prefer, feel free to PM me to keep it private.
R version 3.5.1 (2018-07-02)
Loading required package: Rcpp
DADA2: 1.10.0 / Rcpp: 1.0.4.6 / RcppParallel: 5.0.0
Filtering Error in filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF, :
These are the errors (up to 5) encountered in individual cores…
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 526
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 381
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 399
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 526
Error in writeFastq(fqR, fout[[2]], “w”, compress = compress) :
failed to write record 68757
Execution halted
Traceback (most recent call last):
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 264, in denoise_paired
run_commands([cmd])
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 36, in run_commands
subprocess.run(cmd, check=True)
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/subprocess.py”, line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘run_dada_paired.R’, ‘/tmp/tmp9lzgg7m9/forward’, ‘/tmp/tmp9lzgg7m9/reverse’, ‘/tmp/tmp9lzgg7m9/output.tsv.biom’, ‘/tmp/tmp9lzgg7m9/track.tsv’, ‘/tmp/tmp9lzgg7m9/filt_f’, ‘/tmp/tmp9lzgg7m9/filt_r’, ‘190’, ‘160’, ‘0’, ‘5’, ‘2.0’, ‘2.0’, ‘0’, ‘independent’, ‘pooled’, ‘1.0’, ‘10’, ‘1000000’]’ returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2cli/commands.py”, line 329, in call
results = action(**arguments)
File “”, line 2, in denoise_paired
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 245, in bound_callable
output_types, provenance)
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 390, in callable_executor
output_views = self._callable(**view_args)
File “/home/ubuntu/francesco/miniconda3/envs/qiime2-2020.6/lib/python3.6/site-packages/q2_dada2/_denoise.py”, line 279, 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 agree, your sequences should have plenty of overlap you may eve try with R1 alone in your case!
The last error looks like to be different from the initial one!
These are the errors (up to 5) encountered in individual cores…
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 526
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 381
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 399
Error in writeFastq(fqF, fout[[1]], “w”, compress = compress) :
failed to write record 526
Error in writeFastq(fqR, fout[[2]], “w”, compress = compress) :
failed to write record 68757
Execution halted
Do you run the code in a virtual machine? Are you running out of space ?