Self-consistency loop terminated before convergence.An error was encountered while running DADA2 in R (return code 1)

Hello,
I have been getting the following error after the denoising step:

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

I use this command:

qiime dada2 denoise-paired --i-demultiplexed-seqs paired-end-demux.qza --o-table table --o-representative-sequences rep-seqs --p-trim-left-f 5 --p-trim-left-r 5 --p-trunc-len-f 205 --p-trunc-len-r 205

I check the error log:

cat /var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/qiime2-q2cli-err-59qisupk.log
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 /var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/forward /var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/reverse /var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/output.tsv.biom /var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/filt_f /var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/filt_r 205 205 5 5 2.0 2 consensus 1.0 1 1000000

R version 3.4.1 (2017-06-30)
载入需要的程辑包:Rcpp
DADA2 R package version: 1.6.0

  1. Filtering ................

  2. Learning Error Rates
    2a) Forward Reads
    Initializing error rates to maximum possible estimate.
    Sample 1 - 148403 reads in 51229 unique sequences.
    Sample 2 - 145240 reads in 53221 unique sequences.
    Sample 3 - 143196 reads in 51653 unique sequences.
    Sample 4 - 141675 reads in 50840 unique sequences.
    Sample 5 - 141552 reads in 49282 unique sequences.
    Sample 6 - 140356 reads in 50312 unique sequences.
    Sample 7 - 138208 reads in 42132 unique sequences.
    Sample 8 - 145817 reads in 50908 unique sequences.
    selfConsist step 2
    selfConsist step 3
    selfConsist step 4
    selfConsist step 5
    selfConsist step 6
    selfConsist step 7
    selfConsist step 8
    selfConsist step 9
    selfConsist step 10
    Self-consistency loop terminated before convergence.
    2b) Reverse Reads
    Initializing error rates to maximum possible estimate.
    Sample 1 - 148403 reads in 51229 unique sequences.
    Sample 2 - 145240 reads in 53221 unique sequences.
    Sample 3 - 143196 reads in 51653 unique sequences.
    Sample 4 - 141675 reads in 50840 unique sequences.
    Sample 5 - 141552 reads in 49282 unique sequences.
    Sample 6 - 140356 reads in 50312 unique sequences.
    Sample 7 - 138208 reads in 42132 unique sequences.
    Sample 8 - 145817 reads in 50908 unique sequences.
    selfConsist step 2
    selfConsist step 3
    selfConsist step 4
    selfConsist step 5
    selfConsist step 6
    selfConsist step 7
    selfConsist step 8
    selfConsist step 9
    selfConsist step 10
    Self-consistency loop terminated before convergence.

  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
    此外: Warning message:
    In is.na(colnames(unqs[[i]])) : is.na()不适用于类别为'NULL'的非串列或非矢量
    停止执行
    Traceback (most recent call last):
    File "/Users/mac/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 179, in denoise_paired
    run_commands([cmd])
    File "/Users/mac/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 35, in run_commands
    subprocess.run(cmd, check=True)
    File "/Users/mac/anaconda3/envs/qiime2-2018.2/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['run_dada_paired.R', '/var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/forward', '/var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/reverse', '/var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/output.tsv.biom', '/var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/filt_f', '/var/folders/py/xrlp2jks4jq1kqx3mwf99tk80000gn/T/tmp1u__19zv/filt_r', '205', '205', '5', '5', '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 "/Users/mac/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/q2cli/commands.py", line 246, in call
results = action(**arguments)
File "", line 2, in denoise_paired
File "/Users/mac/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/qiime2/sdk/action.py", line 228, in bound_callable
output_types, provenance)
File "/Users/mac/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/qiime2/sdk/action.py", line 363, in callable_executor
output_views = self._callable(**view_args)
File "/Users/mac/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 194, 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.

It would be great if anyone could guide me.
The qiime 2 version that am using is qiime2 2018.02 and my R version is also 3.4.2 (2017-09-28)

Hi @will, see this forum thread it looks like you may be running into the same issue.

Good luck!

1 Like

Thank you so much.
I have tried making a new temporary environment and running multiple threads in my project. But it still doesn't work. The result gave the same error log.:sweat:

the is my command:

qiime dada2 denoise-paired \

--p-n-threads 50
--i-demultiplexed-seqs paired-end-demux.qza
--o-table table
--o-representative-sequences rep-seqs
--p-trim-left-f 0
--p-trim-left-r 0
--p-trunc-len-f 230
--p-trunc-len-r 230

could everyone help me to fix it?

@will,

So still an error with return code 1? Or just the self-consistency loop error? If just the latter, check this thread — the self-consistency loop might not always be a problem (but the job crashing with error code 1 is).

How long is the job taking to run before it errors?

If you are still getting a job failure with exit code 1, see this thread (or search for others on this forum) — it looks like this issue often occurs if dada2 parameters are not set appropriately — e.g., if reads do not merge.

If that does not work, could you please post your demultiplexed read quality summaries here (in case this is related to dada2 parameters that you are setting/read quality)? We can take a look at these settings.

Thanks!

Thank you so much. My problem is fixed after I choose to remain the low quality reads. I found that there will be a problem when I cut more. when I set --p-trunc-len-r/f 150, it does not work, when I set --p-trunc-len-r/f 225, I works and costs less time.

1 Like

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