Error running qiime denoise-paired (return code 1: Error in getErrors(err, enforce = TRUE) : Error matrix is NULL.))

Hello! I am running qiime2 2024.5 on a PC with paired-end demultiplexed sequences. I keep getting code 1 errors when running the following code. I tried decreasing my threads (from 0 to 15 to 8 to 4) as suggested in a previous post, but I keep getting an error. I have posted the command and verbose error. Any help would be greatly appreciated!

(qiime2-amplicon-2024.5) userselu@BI0326D00090294:~/Desktop/Students/CLB$ qiime dada2 denoise-paired --i-demultiplexed-seqs s12-correct-demux-paired-end-trimmed.qza --p-trunc-len-f 145 --p-trunc-len-r 132 --o-representative-sequences s12-rep-seqs.qza --o-table s12-table.qza --o-denoising-stats s12-denoising-stats.qza --verbose --p-n-threads 4
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/tmpneh5c27_/forward --input_directory_reverse /tmp/tmpneh5c27_/reverse --output_path /tmp/tmpneh5c27_/output.tsv.biom --output_track /tmp/tmpneh5c27_/track.tsv --filtered_directory /tmp/tmpneh5c27_/filt_f --filtered_directory_reverse /tmp/tmpneh5c27_/filt_r --truncation_length 145 --truncation_length_reverse 132 --trim_left 0 --trim_left_reverse 0 --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 4 --learn_min_reads 1000000

R version 4.3.3 (2024-02-29)
Loading required package: Rcpp
DADA2: 1.30.0 / Rcpp: 1.0.12 / RcppParallel: 5.1.6
2) Filtering .
3) Learning Error Rates
53592580 total bases in 369604 reads from 1 samples will be used for learning the error rates.
48787728 total bases in 369604 reads from 1 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 "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_dada2/denoise.py", line 350, in denoise_paired
run_commands([cmd])
File "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_dada2/denoise.py", line 37, in run_commands
subprocess.run(cmd, check=True)
File "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/tmpneh5c27
/forward', '--input_directory_reverse', '/tmp/tmpneh5c27
/reverse', '--output_path', '/tmp/tmpneh5c27_/output.tsv.biom', '--output_track', '/tmp/tmpneh5c27_/track.tsv', '--filtered_directory', '/tmp/tmpneh5c27_/filt_f', '--filtered_directory_reverse', '/tmp/tmpneh5c27_/filt_r', '--truncation_length', '145', '--truncation_length_reverse', '132', '--trim_left', '0', '--trim_left_reverse', '0', '--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', '4', '--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 "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 520, in call
results = self._execute_action(
File "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 581, in _execute_action
results = action(**arguments)
File "", line 2, in denoise_paired
File "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 576, in callable_executor
output_views = self._callable(**view_args)
File "/home/userselu/anaconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_dada2/_denoise.py", line 363, 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.

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.

[https://view.qiime2.org/visualization/?src=9a65e45c-89c3-4839-9f94-1cc4d4ae10f3]

Hi @camrynbigelow,

Welcome to the :qiime2: forum! :wave:

Here's the source of the error:

An error matrix being null typically indicates over filtering (i.e. too many samples are being removed with the truncation lengths you've selected). Have you chosen your truncation lengths after examining your demux summary for these sequences? I'd be interested to take a look at the interactive quality plot to see what those chosen truncation lengths would leave us with (as I suspect that's where the issue lies).

Cheers :lizard:

Thank you! Yes, I chose the truncation lengths after viewing them on qiime2 view. I tried linking it in the original post, but I can try and upload it here as well.

s12-correct-demux-paired-end-trimmed.qzv (317.2 KB)

Hi @camrynbigelow,

Thanks for sharing that file! Upon closer examination of your error, it actually looks like the issue is this:

This will also cause your error matrix to be null. Do you have more samples available that you can add to this analysis?

1 Like

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