An error was encountered while running DADA2 in R (return code 1)

Hi Qiimers,

Getting the following error when using DADA2 step:

`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.`

Command I was running was as follows:

`qiime dada2 denoise-paired \

--i-demultiplexed-seqs i10-demux-paired-end.qza
--p-trunc-len-f 260
--p-trunc-len-r 210
--p-n-threads 1
--p-chimera-method pooled
--verbose
--o-table i10-table.qza
--o-representative-sequences i10-rep-seqs.qza
--o-denoising-stats i10-denoising-stats.qza`

and the debug info:

`Command: run_dada_paired.R /tmp/tmpqn0kqaq8/forward /tmp/tmpqn0kqaq8/reverse /tmp/tmpqn0kqaq8/output.tsv.biom /tmp/tmpqn0kqaq8/track.tsv /tmp/tmpqn0kqaq8/filt_f /tmp/tmpqn0kqaq8/filt_r 260 210 0 0 2.0 2 pooled 1.0 1 1000000

R version 3.4.1 (2017-06-30)
Loading required package: Rcpp
DADA2 R package version: 1.6.0

  1. Filtering Error in writeFastq(fqF, fout[[1]], "w", compress = compress):
    failed to write record 18894
    Execution halted
    Traceback (most recent call last):
    File "/sas5/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 229, in denoise_paired
    run_commands([cmd])
    File "/sas5/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
    File "/sas5/miniconda3/envs/qiime2-2018.8/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmpqn0kqaq8/forward', '/tmp/tmpqn0kqaq8/reverse', '/tmp/tmpqn0kqaq8/output.tsv.biom', '/tmp/tmpqn0kqaq8/track.tsv', '/tmp/tmpqn0kqaq8/filt_f', '/tmp/tmpqn0kqaq8/filt_r', '260', '210', '0', '0', '2.0', '2', 'pooled', '1.0', '1', '1000000']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/sas5/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2cli/commands.py", line 274, in call
results = action(**arguments)
File "", line 2, in denoise_paired
File "/sas5/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/sas5/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 362, in callable_executor
output_views = self._callable(**view_args)
File "/sas5/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 244, 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 am aware similar errors have been addressed before,https://forum.qiime2.org/t/error-while-running-dada2-in-r-return-code-1/4570 but I really don't know how to address writing permissions or memory issue.
Any help is appreciated !:blush:

lynn

Continuing the discussion from Error while running DADA2 in R (return code 1):

could anyone tell me how to define new tmp path to ~/.bashrc? i don't konw how to do this.:joy:

You can export your tmp anywhere

mkdir home/user/tempo
export TMPDIR=/home/user/tempo/

Make sure you have enough of free space there and writing permission

1 Like

You should be able to add a line to your .bashrc that says:

export TMPDIR=/path/to/new/tempdir

Don’t forget to log out and back in, or run source ~/.bashrc.

Thanks for your rapid response.
your suggestion works well.:grin:

1 Like

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