An error was encountered while running DADA2 in R (return code 1) dada2 denoise-ccs

Hi, thanks for seeing this. I'm using qiime2-2023.5 in linux. I run dada2 with this command:
qiime dada2 denoise-ccs --i-demultiplexed-seqs imported.qza --p-front AGAGTTTGATCCTGGCTCAG --p-adapter GNTACCTTGTTACGACTT --p-min-len 1000 --p-max-len 1600 --o-table table.qza --o-representative-sequences rep-seqs.qza --o-denoising-stats stats.qza
I got this error:
R version 4.2.3 (2023-03-15)
Loading required package: Rcpp
DADA2: 1.26.0 / Rcpp: 1.0.10 / RcppParallel: 5.1.6

  1. Removing Primers
    Read in 24933, output 0 (0%) filtered sequences.
    Read in 23501, output 0 (0%) filtered sequences.
    Read in 23213, output 0 (0%) filtered sequences.
    Read in 23263, output 0 (0%) filtered sequences.
    Read in 23274, output 0 (0%) filtered sequences.
    Read in 24060, output 0 (0%) filtered sequences.
    Read in 24451, output 0 (0%) filtered sequences.
    Read in 23343, output 0 (0%) filtered sequences.
    Read in 23671, output 0 (0%) filtered sequences.
    Read in 25450, output 0 (0%) filtered sequences.
    Read in 25281, output 0 (0%) filtered sequences.
    Read in 23314, output 0 (0%) filtered sequences.
    Error: Input/Output
    file(s):
    /tmp/qiime2/metagenomes/data/d4a8ce6d-cd4d-412b-9726-a3964968575d/data/LN1_12_L001_R1_001.fastq.gz
    message: unexpected number of lines in file '/tmp/qiime2/metagenomes/data/d4a8ce6d-cd4d-412b-9726-a3964968575d/data/LN1_12_L001_R1_001.fastq.gz'
    13: stop(cond)
    12: .throw(SRError("Input/Output", "file(s):\n %s\n message: %s",
    paste(src, collapse = "\n "), conditionMessage(err)))
    11: .throw(SRError("Input/Output", "file(s):\n %s\n message: %s",
    paste(src, collapse = "\n "), conditionMessage(err)))
    10: value[3L]
    9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    8: tryCatchList(expr, classes, parentenv, handlers)
    7: tryCatch({
    elts <- .Call(.read_solexa_fastq, src, withIds)
    if (withIds)
    ShortReadQ(elts[["sread"]], elts[["quality"]], elts[["id"]],
    ..., withIds = withIds)
    else ShortReadQ(elts[["sread"]], elts[["quality"]], ...,
    withIds = withIds)
    }, error = function(err) {
    .throw(SRError("Input/Output", "file(s):\n %s\n message: %s",
    paste(src, collapse = "\n "), conditionMessage(err)))
    })
    6: .local(dirPath, pattern, ...)
    5: readFastq(fn[[i]])
    4: readFastq(fn[[i]])
    3: removePrimers(unfilts, nop, primer, dada2:::rc(primerR), max.mismatch = maxMismatch,
    allow.indels = indels, orient = TRUE, verbose = TRUE)
    2: withCallingHandlers(expr, warning = function(w) if (inherits(w,
    classes)) tryInvokeRestart("muffleWarning"))
    1: suppressWarnings(removePrimers(unfilts, nop, primer, dada2:::rc(primerR),
    max.mismatch = maxMismatch, allow.indels = indels, orient = TRUE,
    verbose = TRUE))
    Traceback (most recent call last):
    File "/home/metagenomes/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 440, in denoise_ccs
    run_commands([cmd])
    File "/home/metagenomes/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
    File "/home/metagenomes/miniconda3/envs/qiime2-2023.5/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/qiime2/metagenomes/data/d4a8ce6d-cd4d-412b-9726-a3964968575d/data', '--output_path', '/tmp/tmpgedjfixe/output.tsv.biom', '--output_track', '/tmp/tmpgedjfixe/track.tsv', '--removed_primer_directory', '/tmp/tmpgedjfixe/nop', '--filtered_directory', '/tmp/tmpgedjfixe/filt', '--forward_primer', 'AGAGTTTGATCCTGGCTCAG', '--reverse_primer', 'GNTACCTTGTTACGACTT', '--max_mismatch', '2', '--indels', 'False', '--truncation_length', '0', '--trim_left', '0', '--max_expected_errors', '2.0', '--truncation_quality_score', '2', '--min_length', '1000', '--max_length', '1600', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '3.5', '--allow_one_off', 'False', '--num_threads', '1', '--learn_min_reads', '1000000', '--homopolymer_gap_penalty', 'NULL', '--band_size', '32']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/metagenomes/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2cli/commands.py", line 468, in call
results = action(**arguments)
File "", line 2, in denoise_ccs
File "/home/metagenomes/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 274, in bound_callable
outputs = self.callable_executor(
File "/home/metagenomes/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 509, in callable_executor
output_views = self._callable(**view_args)
File "/home/metagenomes/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 449, in denoise_ccs
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.
I don’t know why this happened. I did some attempts and did not find a suitable solution.
Can anyone help me?
Thank you very much!

Hi @N2ORM,

Welcome to the :qiime2: forum!

Here is where the error is coming from:

There is most likely an extraneous line in this file that's causing the issue (within your imported data file). I would run qiime tools validate on your imported.qza file to see if that exposes the exact location of the offending line - otherwise I can take a look at it on my end (feel free to share here or in a DM). Cheers :lizard:

1 Like

2 off-topic replies have been split into a new topic: error codes 9 and then 1 when running DADA2

Please keep replies on-topic in the future.

Thank you very much for your valuable advice! I removed the problem file and the above error was resolved

1 Like

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