Hello,
I have searched the forums and have found similar issues, but none were exactly the same, and the solutions offered in those threads did not work. I am running q2cli version 2025.4.0 in a conda on an HPC.
Here is the exact command I ran:
qiime dada2 denoise-paired \
--i-demultiplexed-seqs demux.qza \
--p-trim-left-f 0 --p-trim-left-r 0 \
--p-trunc-len-f 151 --p-trunc-len-r 151 \
--o-representative-sequences rep-seqs-dada2.qza \
--o-table table-dada2.qza \
--o-denoising-stats stats-dada2.qza --verbose
I tried it with minimal trimming (two bp from each end) and with no trimming, as shown above.
Here is the error message I have received:
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 /p/work1/tmp/madszi/tmpc_src91f/forward --input_directory_reverse /p/work1/tmp/madszi/tmpc_src91f/reverse --output_path /p/work1/tmp/madszi/tmpc_src91f/output.tsv.biom --output_track /p/work1/tmp/madszi/tmpc_src91f/track.tsv --filtered_directory /p/work1/tmp/madszi/tmpc_src91f/filt_f --filtered_directory_reverse /p/work1/tmp/madszi/tmpc_src91f/filt_r --truncation_length 150 --truncation_length_reverse 150 --trim_left 2 --trim_left_reverse 2 --max_expected_errors 2.0 --max_expected_errors_reverse 2.0 --truncation_quality_score 2 --min_overlap 12 --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 1 --learn_min_reads 1000000
R version 4.3.3 (2024-02-29)
Loading required package: Rcpp
DADA2: 1.30.0 / Rcpp: 1.0.14 / RcppParallel: 5.1.9
2) Filtering .............
3) Learning Error Rates
90961836 total bases in 614607 reads from 13 samples will be used for learning the error rates.
90961836 total bases in 614607 reads from 13 samples will be used for learning the error rates.
Error rates could not be estimated (this is usually because of very few reads).
Error in getErrors(err, enforce = TRUE) : Error matrix is NULL.
6: stop("Error matrix is NULL.")
5: getErrors(err, enforce = TRUE)
4: dada(drps, err = NULL, errorEstimationFunction = errorEstimationFunction,
selfConsist = TRUE, multithread = multithread, verbose = verbose,
MAX_CONSIST = MAX_CONSIST, OMEGA_C = OMEGA_C, ...)
3: learnErrors(filtsR, nreads = nreads.learn, multithread = multithread)
2: withCallingHandlers(expr, warning = function(w) if (inherits(w,
classes)) tryInvokeRestart("muffleWarning"))
1: suppressWarnings(learnErrors(filtsR, nreads = nreads.learn, multithread = multithread))
Traceback (most recent call last):
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/site-packages/q2_dada2/_denoise.py", line 341, in denoise_paired
run_commands([cmd])
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/site-packages/qiime2/plugin/util.py", line 65, in run_commands
subprocess.run(cmd, check=True)
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/p/work1/tmp/madszi/tmpc_src91f/forward', '--input_directory_reverse', '/p/work1/tmp/madszi/tmpc_src91f/reverse', '--output_path', '/p/work1/tmp/madszi/tmpc_src91f/output.tsv.biom', '--output_track', '/p/work1/tmp/madszi/tmpc_src91f/track.tsv', '--filtered_directory', '/p/work1/tmp/madszi/tmpc_src91f/filt_f', '--filtered_directory_reverse', '/p/work1/tmp/madszi/tmpc_src91f/filt_r', '--truncation_length', '150', '--truncation_length_reverse', '150', '--trim_left', '2', '--trim_left_reverse', '2', '--max_expected_errors', '2.0', '--max_expected_errors_reverse', '2.0', '--truncation_quality_score', '2', '--min_overlap', '12', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allow_one_off', 'False', '--num_threads', '1', '--learn_min_reads', '1000000']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/site-packages/q2cli/commands.py", line 529, in call
results = self._execute_action(
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/site-packages/q2cli/commands.py", line 601, in _execute_action
results = action(**arguments)
File "", line 2, in denoise_paired
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/site-packages/qiime2/sdk/action.py", line 221, in bound_callable
outputs = self.callable_executor(
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/site-packages/qiime2/sdk/action.py", line 359, in callable_executor
output_views = self._callable(**view_args)
File "/p/app/projects/FUNAN/.conda/envs/qiime2amplicon_env/lib/python3.10/site-packages/q2_dada2/_denoise.py", line 354, in denoise_paired
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.
From my search on the forums, I have gathered that the issue has something to do with the error matrix being null, but the suggested reasons for this don't apply (i.e., my dataset is more than one sample, I'm not overly trimming, and the quality of reads is good).