Error when running dada2 denoise-paired: R (return code 1)

Hi, I'm having a problem running dada2. And I noticed that it disappears when I try to change some specific parameters.

Command as follow:

time qiime dada2 denoise-paired \
--i-demultiplexed-seqs trimmed.qza \
--p-trim-left-f 0 \
--p-trim-left-r 0 \
--p-trunc-len-f 162 \
--p-trunc-len-r 212 \
--p-min-overlap 24 \
--p-n-threads 18 \
--o-representative-sequences rep-seqs-162-212-24.qza \
--o-table table-162-212-24.qza \
--o-denoising-stats stats-152-212-24.qza

Plugin error from dada2:

An error was encountered while running DADA2 in R (return code 1), 
please inspect stdout and stderr to learn more.
Debug info has been saved to /tmp/qiime2-q2cli-err-srqu961d.log

And the.log as follow:

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.R --input_directory /tmp/tmp3hjf70d9/forward --input_directory_reverse /tmp/tmp3hjf70d9/reverse --output_path /tmp/tmp3hjf70d9/output.tsv.biom --output_track /tmp/tmp3hjf70d9/track.tsv --filtered_directory /tmp/tmp3hjf70d9/filt_f --filtered_directory_reverse /tmp/tmp3hjf70d9/filt_r --truncation_length 162 --truncation_length_reverse 212 --trim_left 0 --trim_left_reverse 0 --max_expected_errors 2.0 --max_expected_errors_reverse 2.0 --truncation_quality_score 2 --min_overlap 24 --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 18 --learn_min_reads 1000000

R version 4.2.2 (2022-10-31)
Loading required package: Rcpp
DADA2: 1.26.0 / Rcpp: 1.0.11 / RcppParallel: 5.1.6
2) Filtering Error in names(answer) <- names1 :
'names' attribute [18] must be the same length as the vector [13]
4: mcmapply(fastqPairedFilter, mapply(c, fwd, rev, SIMPLIFY = FALSE),
mapply(c, filt, filt.rev, SIMPLIFY = FALSE), MoreArgs = list(truncQ = truncQ,
truncLen = truncLen, trimLeft = trimLeft, trimRight = trimRight,
maxLen = maxLen, minLen = minLen, maxN = maxN, minQ = minQ,
maxEE = maxEE, rm.phix = rm.phix, rm.lowcomplex = rm.lowcomplex,
orient.fwd = orient.fwd, matchIDs = matchIDs, id.sep = id.sep,
id.field = id.field, n = n, OMP = OMP, qualityType = qualityType,
compress = compress, verbose = verbose), mc.cores = ncores,
mc.silent = TRUE)
3: filterAndTrim(unfilts, filts, unfiltsR, filtsR, truncLen = c(truncLen,
truncLenR), trimLeft = c(trimLeft, trimLeftR), maxEE = c(maxEE,
maxEER), truncQ = truncQ, rm.phix = TRUE, multithread = multithread)
2: withCallingHandlers(expr, warning = function(w) if (inherits(w,
classes)) tryInvokeRestart("muffleWarning"))
1: suppressWarnings(filterAndTrim(unfilts, filts, unfiltsR, filtsR,
truncLen = c(truncLen, truncLenR), trimLeft = c(trimLeft,
trimLeftR), maxEE = c(maxEE, maxEER), truncQ = truncQ,
rm.phix = TRUE, multithread = multithread))
Traceback (most recent call last):
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 326, in denoise_paired
run_commands([cmd])
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
subprocess.run(cmd, check=True)
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/tmp3hjf70d9/forward', '--input_directory_reverse', '/tmp/tmp3hjf70d9/reverse', '--output_path', '/tmp/tmp3hjf70d9/output.tsv.biom', '--output_track', '/tmp/tmp3hjf70d9/track.tsv', '--filtered_directory', '/tmp/tmp3hjf70d9/filt_f', '--filtered_directory_reverse', '/tmp/tmp3hjf70d9/filt_r', '--truncation_length', '162', '--truncation_length_reverse', '212', '--trim_left', '0', '--trim_left_reverse', '0', '--max_expected_errors', '2.0', '--max_expected_errors_reverse', '2.0', '--truncation_quality_score', '2', '--min_overlap', '24', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allow_one_off', 'False', '--num_threads', '18', '--learn_min_reads', '1000000']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/commands.py", line 520, in call
results = self._execute_action(
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2cli/commands.py", line 581, in _execute_action
results = action(**arguments)
File "", line 2, in denoise_paired
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/qiime2/sdk/action.py", line 566, in callable_executor
output_views = self._callable(**view_args)
File "/home/lisiyang/anaconda3/envs/qiime2-amplicon-2023.9/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 339, 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.

1 Like

Hello @KonradV,

You may have run out of memory. Try running with fewer threads.

3 Likes

The problem was solved! Can I ask why this was, was it because there was not enough RAM memory? As well as sometimes I can finish it by operating it this way.

The platform I'm using is windows wsl2 ubuntu22.04 and the computer is configured with 1 32GB RAM.

Yes! RAM and memory are the same thing.

One some computers, a job / process / command is canceled when it uses too much memory.

For some programs, using 2x threads uses 2x memory (and 10x threads use 10x memory!!!) so using fewer threads can help you complete a job with the memory you have and avoid using too much memory causing the job to be canceled.

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