Dada2 denoising plugin error

Hi everyone, hope you are well. I´m facing some issues while running the dada2 denoising step with my seq data. I have read similar topics in this forum but none with the same error.
My data come from Illumina MiSeq 300bp, PE data, is already demultiplexed and trimmed for adaptors and others using timmomatic:

for i1 in _R1; do i2=${i1/_R1/_R2}; java -jar /usr/share/java/trimmomatic-0.36.jar PE -phred33 -threads 8 $i1 i2 {i1/_R1/_R1_PE} {i1/_R1/_R1_UP} {i2/_R2/_R2_PE} ${i2/_R2/_R2_UP} ILLUMINACLIP:/usr/share/trimmomatic/TruSeq3-PE.fa:2:30:10 SLIDINGWINDOW:10:28 MINLEN:50 LEADING:8 TRAILING:8; done

After the trimmomatic run, I observed the resulting sequences and decided to run the in the dada2 denoisng step in order to trim the extremes tha still have low quality. The parameters I decided to use are the following:

(qiime2-2020.11) [email protected]:/media/sf_qiime2/analisis_bac$ qiime dada2 denoise-paired --i-demultiplexed-seqs paired-end-demux.qza --p-trim-left-f 6 --p-trim-left-r 6 --p-trunc-len-f 289 --p-trunc-len-r 235 --o-table table16S.qza --o-representative-sequences rep_seqs16S.qza --o-denoising-stats denois_stats16S.qza --verbose

The error (or erros, I guess) is the following:

(qiime2-2020.11) [email protected]:/media/sf_qiime2/analisis_bac$ qiime dada2 denoise-paired --i-demultiplexed-seqs paired-end-demux.qza --p-trim-left-f 6 --p-trim-left-r 6 --p-trunc-len-f 289 --p-trunc-len-r 235 --o-table table16S.qza --o-representative-sequences rep_seqs16S.qza --o-denoising-stats denois_stats16S.qza --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/tmp7k45hvnp/forward /tmp/tmp7k45hvnp/reverse /tmp/tmp7k45hvnp/output.tsv.biom /tmp/tmp7k45hvnp/track.tsv /tmp/tmp7k45hvnp/filt_f /tmp/tmp7k45hvnp/filt_r 289 235 6 6 2.0 2.0 2 independent consensus 1.0 1 1000000

R version 4.0.2 (2020-06-22)
Loading required package: Rcpp
DADA2: 1.18.0 / Rcpp: 1.0.5 / RcppParallel: 5.0.2

  1. Filtering ........................
  2. Learning Error Rates
    301954491 total bases in 1066977 reads from 11 samples will be used for learning the error rates.
    Error in dada_uniques(names(drpi$uniques), unname(drpi$uniques), names(drpi$uniques) %in% :
    Memory allocation failed.
    Execution halted
    Warning message:
    system call failed: Cannot allocate memory
    Traceback (most recent call last):
    File "/home/qiime2/miniconda/envs/qiime2-2020.11/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 264, in denoise_paired
    run_commands([cmd])
    File "/home/qiime2/miniconda/envs/qiime2-2020.11/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-2020.11/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmp7k45hvnp/forward', '/tmp/tmp7k45hvnp/reverse', '/tmp/tmp7k45hvnp/output.tsv.biom', '/tmp/tmp7k45hvnp/track.tsv', '/tmp/tmp7k45hvnp/filt_f', '/tmp/tmp7k45hvnp/filt_r', '289', '235', '6', '6', '2.0', '2.0', '2', 'independent', 'consensus', '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 "/home/qiime2/miniconda/envs/qiime2-2020.11/lib/python3.6/site-packages/q2cli/commands.py", line 329, in call
results = action(**arguments)
File "", line 2, in denoise_paired
File "/home/qiime2/miniconda/envs/qiime2-2020.11/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
output_types, provenance)
File "/home/qiime2/miniconda/envs/qiime2-2020.11/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in callable_executor
output_views = self._callable(**view_args)
File "/home/qiime2/miniconda/envs/qiime2-2020.11/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.

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.
(qiime2-2020.11) [email protected]:/media/sf_qiime2/analisis_bac$

Any suggestion for what is happening here will be very useful!!!
Thank you!

Hi @Vani_Maguire,

TO me the main error seems a memory allocation problem:

What system are you using? How much memory does it have?
Some possible solution were discussed in this thread:

As aside, you are using quite an old version of qiime2, it may be beneficial try with the latest one!
Also, did you visualized your samples after trimmomatic imported in qiime2?
Are the looking ok? (In term of sequence number and length)

Hope it helps
Luca

2 Likes

Thank you very much! yes it seems it´s a memory problem. I am using q2 version 2020, I will update ir to 2021 version instead and see if the error remains.
After trimmomatic I saw the resulting seqs and looked pretty well, much better that before the trimmomatic step, but decided to denoise by trimming both extremes with dada2 to improve quality (the begining and the end of the seqs were still of poor quality).
I will update qiime and rerun the denoising step to see if the error remains!

Thank you so much!!

1 Like

Hello! I updated qiime2 to the newst version as you suggested and asigned more RAM memory through the virtual machine. Rerun the code and worked fine!!! the run lasted 7 hrs with no errors!

Thank you very much!!

1 Like

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