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

Hello there!

I am running qiime2 2020.2 on a MacBook through a remote ssh server, installed with miniconda. I am working with some paired-end demultiplexed sequences (non-Casava), which I have successfully imported with a manifest file. Subsequently, I have successfully trimmed the sequences to the V4 region using the q2 cutadapt plugin and the 515f and 785r primer sequences.

I now wanted to denoise the sequences using the DADA2 plugin. I ran the following:

qiime dada2 denoise-paired --i-demultiplexed-seqs trimmed-seqs.qza --p-trim-left-f 0 --p-trunc-len-f 0 --p-trim-left-r 0 --p-trunc-len-r 140 --o-representative-sequences rep-seqs.qza --o-table table.qza --o-denoising-stats stats-dada2.qza --verbose

I then get the following error and verbose output:
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/tmpq08g47t3/forward /tmp/tmpq08g47t3/reverse /tmp/tmpq08g47t3/output.tsv.biom /tmp/tmpq08g47t3/track.tsv /tmp/tmpq08g47t3/filt_f /tmp/tmpq08g47t3/filt_r 0 140 0 0 2.0 2.0 2 consensus 1.0 1 1000000

R version 3.5.1 (2018-07-02)
Loading required package: Rcpp
DADA2: 1.10.0 / Rcpp: 1.0.3 / RcppParallel: 4.4.4

  1. Filtering .....................
  2. Learning Error Rates
    45837818 total bases in 205551 reads from 21 samples will be used for learning the error rates.
    28777140 total bases in 205551 reads from 21 samples will be used for learning the error rates.
  3. Denoise remaining samples .....................
  4. Remove chimeras (method = consensus)
    Error in isBimeraDenovoTable(unqs[[i]], ..., verbose = verbose) :
    Input must be a valid sequence table.
    Calls: removeBimeraDenovo -> isBimeraDenovoTable
    Execution halted
    Traceback (most recent call last):
    File "/home/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 257, in denoise_paired
    run_commands([cmd])
    File "/home/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
    File "/home/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmpq08g47t3/forward', '/tmp/tmpq08g47t3/reverse', '/tmp/tmpq08g47t3/output.tsv.biom', '/tmp/tmpq08g47t3/track.tsv', '/tmp/tmpq08g47t3/filt_f', '/tmp/tmpq08g47t3/filt_r', '0', '140', '0', '0', '2.0', '2.0', '2', '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/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/commands.py", line 328, in call
results = action(**arguments)
File "</home/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/decorator.py:decorator-gen-455>", line 2, in denoise_paired
File "/home/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
output_types, provenance)
File "/home/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in callable_executor
output_views = self._callable(**view_args)
File "/home/s143837/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_dada2/_denoise.py", line 272, 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.

It is very strange because I ran the exact same yesterday on similar data prepared with the same steps described above, so I am suspecting something is wrong with my data. However, the trimmed-seqs.qza file looks okay, I think. I am attaching a screenshot of my visualization of that file.

The reverse reads have terrible quality, and I am suspecting maybe there are simply none left for chimera removal? Similar to this post: [Q2-dada2: Error in isBimeraDenovoTable(unqs[[i]], ..., verbose = verbose) : Input must be a valid sequence table]
However, I have checked my manifest file again, and I have different forward and reverse reads in there... Also, as far as I understand, the denoise-paired command should only exclude sequence reads with quality score lower than 2, right? These sequences are bad, but not that bad...
I also should have no problem with RAM since I am running on a server with 20 cores available.

Any pointers on what could be wrong here? And possible solutions? Any help would be greatly appreciated!

Best regards,
Line

Hello @lineroager I notice that in the post you linked to there is a warning at the bottom of the traceback suggesting the code that was trying to handle the reverse reads didn't receive anything. I'm not seeing this warning in your traceback which leads me to believe that may not be the issue here, but we can't rule it out especially because that other post is using an older version of dada2 so that may just be down to version differences in how the error is being reported.

I suspect the actual error is occuring somewhere in step 3, the denoising step, and what denoising is giving to chimera removal is damaged in some way, but I'm not 100% sure.

One thing you might be able to try is playing with the reverse truncation length you're using if you haven't already. You should be able to move it down significantly from 140 while maintaining the required overlap, maybe move it to somewhere in the 90-110 range for a start. This could allow you to cut out more of the poor quality reads towards the end which might help resolve the issue. If you can't get it to work by changing that parameter let us know, and we'll go from there.

2 Likes

Thank you @Oddant1! I was now able to run the denoising when moving the truncation length down to 110. I am still not entirely sure I understand why though...

I think you might be right about this. I have no idea what exactly is happening though.
Oh well, it worked out! Thank you for the suggestion!

Awesome! Happy to help. I suspect with the reverse truncation length at 140 it ran into some issues with denoising due to the quality of the reads it was looking at on the reverse end. By moving the length down to 110 you made it so it was no longer looking at the poor quality reads at all. Without picking things apart a bit more I'm not 100% sure what happened either, but I'm glad it worked.

1 Like

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