An error was encountered while running DADA2 with QIIME2

Suggestions to help me resolve this error would be greatly appreciated:

My original command:
qiime dada2 denoise-single
--i-demultiplexed-seqs cdiff.qza
--p-trunc-len 100
--output-dir dada2 --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.R --input_directory /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/qiime2/ra/data/60cb4f09-b184-44f2-8a2f-73bf15dc86b6/data --output_path /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmptlppfzng/output.tsv.biom --output_track /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmptlppfzng/track.tsv --filtered_directory /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmptlppfzng --truncation_length 150 --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 1 --learn_min_reads 1000000 --homopolymer_gap_penalty NULL --band_size 16

R version 4.3.3 (2024-02-29)
Loading required package: Rcpp
Error: package or namespace load failed for ‘dada2’:
package ‘reshape2’ was installed before R 4.0.0: please re-install it
8: stop(msg, call. = FALSE, domain = NA)
7: value[3L]
6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
4: tryCatch({
attr(package, "LibPath") <- which.lib.loc
ns <- loadNamespace(package, lib.loc)
env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
}, error = function(e) {
P <- if (!is.null(cc <- conditionCall(e)))
paste(" in", deparse(cc)[1L])
else ""
msg <- gettextf("package or namespace load failed for %s%s:\n %s",
sQuote(package), P, conditionMessage(e))
if (logical.return && !quietly)
message(paste("Error:", msg), domain = NA)
else stop(msg, call. = FALSE, domain = NA)
})
3: library(dada2)
2: withCallingHandlers(expr, warning = function(w) if (inherits(w,
classes)) tryInvokeRestart("muffleWarning"))
1: suppressWarnings(library(dada2))
Traceback (most recent call last):
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/site-packages/q2_dada2/_denoise.py", line 240, in _denoise_single
run_commands([cmd])
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/site-packages/q2_dada2/_denoise.py", line 37, in run_commands
subprocess.run(cmd, check=True)
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/qiime2/ra/data/60cb4f09-b184-44f2-8a2f-73bf15dc86b6/data', '--output_path', '/var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmptlppfzng/output.tsv.biom', '--output_track', '/var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmptlppfzng/track.tsv', '--filtered_directory', '/var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmptlppfzng', '--truncation_length', '150', '--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', '1', '--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 "/opt/miniconda3/envs/using-qiime2/lib/python3.9/site-packages/q2cli/commands.py", line 520, in call
results = self._execute_action(
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/site-packages/q2cli/commands.py", line 581, in _execute_action
results = action(**arguments)
File "", line 2, in denoise_single
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/site-packages/qiime2/sdk/action.py", line 576, in callable_executor
output_views = self._callable(**view_args)
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/site-packages/q2_dada2/_denoise.py", line 266, in denoise_single
return _denoise_single(
File "/opt/miniconda3/envs/using-qiime2/lib/python3.9/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.

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.

Hello @Ashka_Ban,

Do you have R installed outside of your QIIME 2 environment? It looks like it's trying to pull the R package from a different installation.

Dear Anthony,

I deeply appreciate your time and help. You gave me the clue and I could take care of the rest.
I installed R and its packages (DADA2) within the QIIME2 environment and I am happy to say that the problem has been resolved.
qiime dada2 denoise-single \

--i-demultiplexed-seqs cdiff.qza \

--p-trunc-len 150 \

--output-dir dada2 --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.R --input_directory /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/qiime2/ra/data/8de96202-d8e6-46da-8e20-0c7130fd240d/data --output_path /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmpwzl8urfy/output.tsv.biom --output_track /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmpwzl8urfy/track.tsv --filtered_directory /var/folders/4r/mck3yj056r19k9szj0pjjj440000gn/T/tmpwzl8urfy --truncation_length 150 --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 1 --learn_min_reads 1000000 --homopolymer_gap_penalty NULL --band_size 16

R version 4.3.3 (2024-02-29)

Loading required package: Rcpp

DADA2: 1.30.0 / Rcpp: 1.0.13.1 / RcppParallel: 5.1.9

  1. Filtering ........

  2. Learning Error Rates

79415850 total bases in 529439 reads from 8 samples will be used for learning the error rates.

  1. Denoise samples

........

  1. Remove chimeras (method = consensus)

  2. Report read numbers through the pipeline

  3. Write output

Saved FeatureTable[Frequency] to: dada2/table.qza

Saved FeatureData[Sequence] to: dada2/representative_sequences.qza

Saved SampleData[DADA2Stats] to: dada2/denoising_stats.qza

2 Likes

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