Cannot run denoise pluging

Dear Qiime2 forum,

I found the next error while I was running

qiime dada2 denoise-single plugin

This is the exact error I got:

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-we7p1374.log

Checking log file I got the following:

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/qiime2/laboratorio/data/40cc1556-b935-4dcc-9444-32f853e48484/data --output_path /tmp/tmp8ahi_nm2/output.tsv.biom --output_track /tmp/tmp8ahi_nm2/track.tsv --filtered_directory /tmp/tmp8ahi_nm2 --truncation_length 171 --trim_left 0 --max_expected_errors 2.0 --truncation_quality_score 2 --max_length Inf --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 0 --learn_min_reads 1000000 --homopolymer_gap_penalty NULL --band_size 16 Warning message: package ‘optparse’ was built under R version 4.2.3 R version 4.2.2 (2022-10-31) Loading required package: Rcpp DADA2: 1.26.0 / Rcpp: 1.0.12 / RcppParallel: 5.1.6 2) Filtering Error in filterAndTrim(unfilts, filts, truncLen = truncLen, trimLeft = trimLeft, : These are the errors (up to 5) encountered in individual cores... Error in add(bin) : internal: buf != <newline> Error in add(bin) : internal: buf != <newline> Error in add(bin) : internal: buf != <newline> 4: stop("These are the errors (up to 5) encountered in individual cores...\n", rval) 3: filterAndTrim(unfilts, filts, truncLen = truncLen, trimLeft = trimLeft, maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE, multithread = multithread, maxLen = maxLen) 2: withCallingHandlers(expr, warning = function(w) if (inherits(w, classes)) tryInvokeRestart("muffleWarning")) 1: suppressWarnings(filterAndTrim(unfilts, filts, truncLen = truncLen, trimLeft = trimLeft, maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE, multithread = multithread, maxLen = maxLen)) Traceback (most recent call last): File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 240, in _denoise_single run_commands([cmd]) File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 37, in run_commands subprocess.run(cmd, check=True) File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/qiime2/laboratorio/data/40cc1556-b935-4dcc-9444-32f853e48484/data', '--output_path', '/tmp/tmp8ahi_nm2/output.tsv.biom', '--output_track', '/tmp/tmp8ahi_nm2/track.tsv', '--filtered_directory', '/tmp/tmp8ahi_nm2', '--truncation_length', '171', '--trim_left', '0', '--max_expected_errors', '2.0', '--truncation_quality_score', '2', '--max_length', 'Inf', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allow_one_off', 'False', '--num_threads', '0', '--learn_min_reads', '1000000', '--homopolymer_gap_penalty', 'NULL', '--band_size', '16']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2cli/commands.py", line 520, in __call__ results = self._execute_action( File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2cli/commands.py", line 581, in _execute_action results = action(**arguments) File "<decorator-gen-70>", line 2, in denoise_single File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 342, in bound_callable outputs = self._callable_executor_( File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 566, in _callable_executor_ output_views = self._callable(**view_args) File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 266, in denoise_single return _denoise_single( File "/home/laboratorio/mambaforge/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 249, in _denoise_single 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.

Thank you for helping me.

Hello @Daniela_Ramirez,

The actual error appears to be Error in add(bin) : internal: buf != <newline> which based on this seems to suggest that at some point in your data you have sequences and quality scores that are not the same length.

The most likely cause of this is that your quality scores were longer than the actual sequences. The error suggests it was expecting a newline but did not find one which would happen if it read a sequence that was say 90 characters long then read the quality score expecting it to also be 90 characters but found more than 90.

Based on the link above, this most likely happened because primers/barcodes were trimmed off of your sequences at some point, but the corresponding quality scores were not removed.

3 Likes

Hello Oddant1,

Many thanks for your reply, it was so helpful!

I checked with the next command my data and I found the corresponding sequence with the error.
I let the command line for future reference and solution to this error.

library (microseq)

FMA1_seqs <- list.files ("../Secuencias/FMA1/")

seqs <-NULL

for (seqs in FMA1_seqs) {
seqs <-rbind(seqs,readFastq(paste0("../Secuencias/FMA1/", seq))
%>% mutate (file = seq)
)
}

bad_reads <- seqs%>%
mutate(check = nchar (Sequence) == nchar (Quality)) %>%
filter(!check)

Thank you!

1 Like

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