Dada2 denoise-paired plugin error (return code 1, -9)

Hi, I ran the following code:

qiime dada2 denoise-paired 
--i-demultiplexed-seqs /media/sf_470Proj/demux-paired-end.qza 
--p-trim-left-f 0 
--p-trim-left-r 0 
--p-trunc-len-f 0 
--p-trunc-len-r 235 
--o-representative-sequences /media/sf_470Proj/rep-seqs-dada2.qza 
--o-table /media/sf_470Proj/feature-table.qza 
--o-denoising-stats /media/sf_470Proj/denoise-stat.qza 
--p-n-threads 4

And receive the following error message:

Plugin error from dada2:

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

Debug info has been saved to /tmp/qiime2-q2cli-err-k4rtm_p5.log

As I tried to read the log, the following info was given:

(qiime2-2019.1) qiime2@qiime2core2019-1:~$ qiime dada2 denoise-paired --i-demultiplexed-seqs /media/sf_470Proj/demux-paired-end.qza --p-trim-left-f 0 --p-trim-left-r 0 --p-trunc-len-f 0 --p-trunc-len-r 235 --o-representative-sequences /media/sf_470Proj/rep-seqs-dada2.qza --o-table /media/sf_470Proj/feature-table.qza --o-denoising-stats /media/sf_470Proj/denoise-stat.qza --p-n-threads 4 --verbose
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/tmpfudfb6_5/forward /tmp/tmpfudfb6_5/reverse /tmp/tmpfudfb6_5/output.tsv.biom /tmp/tmpfudfb6_5/track.tsv /tmp/tmpfudfb6_5/filt_f /tmp/tmpfudfb6_5/filt_r 0 235 0 0 2.0 2 consensus 1.0 4 1000000

R version 3.4.1 (2017-06-30) 
Loading required package: Rcpp
DADA2 R package version: 1.6.0 
1) Filtering ..................
2) Learning Error Rates
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
Not all sequences were the same length.
2a) Forward Reads
Initializing error rates to maximum possible estimate.
Error in dada_uniques(names(derep[[i]]$uniques), unname(derep[[i]]$uniques),  : 
  Memory allocation failed.
Calls: dada -> dada_uniques -> .Call
Execution halted
Warning message:
system call failed: Cannot allocate memory 
Traceback (most recent call last):
  File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 231, in denoise_paired
    run_commands([cmd])
  File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
  File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmpfudfb6_5/forward', '/tmp/tmpfudfb6_5/reverse', '/tmp/tmpfudfb6_5/output.tsv.biom', '/tmp/tmpfudfb6_5/track.tsv', '/tmp/tmpfudfb6_5/filt_f', '/tmp/tmpfudfb6_5/filt_r', '0', '235', '0', '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/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2cli/commands.py", line 274, in __call__
    results = action(**arguments)
  File "</home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/decorator.py:decorator-gen-442>", line 2, in denoise_paired
  File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
    output_types, provenance)
  File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/qiime2/sdk/action.py", line 365, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 246, 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.

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.

Can you please explain what caused this error and suggest solution to overcome it?
These are our .qza and .qzv files:

demux-paired-end.qzv (291.0 KB)

Thank you in advance!

Hi, @Kiet_Ho

I see ‘memory allocation failed’ so I am assuming that you may not have enough memory for this process?

How much RAM is on your machine? Also, how large is your input .qza file?

1 Like

Hi, @sabasu

Thank you for your reply. Yes, the error was caused by low memory, my partner and I soon realized that after we tested the qiime dada2 command with fewer samples.

We were too rushed to post this question before trying every possible solution. Yet we are both glad that qiime2 community is very responsive and helpful. Thank you!

1 Like

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