error while running dada2 denoise

Also...I might as well ask this here given the errors I am encountering trying to make this work. DADA2 is not working either...see code/error below! Again, I am very appreciative of your help and support!

(base) [anthony.frazier@ceres meta_analysis]$ qiime dada2 denoise-paired \

--i-demultiplexed-seqs fondue-output-new/paired_reads.qza
--p-trim-left-f 13
--p-trim-left-r 13
--p-trunc-len-f 300
--p-trunc-len-r 300
--o-table fondue-output-new/table.qza
--o-representative-sequences fondue-output-new/rep-seqs.qza
--o-denoising-stats fondue-output-new/denoising-stats.qza
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/tmpou4zdjbx/forward --input_directory_reverse /tmp/tmpou4zdjbx/reverse --output_path /tmp/tmpou4zdjbx/output.tsv.biom --output_track /tmp/tmpou4zdjbx/track.tsv --filtered_directory /tmp/tmpou4zdjbx/filt_f --filtered_directory_reverse /tmp/tmpou4zdjbx/filt_r --truncation_length 300 --truncation_length_reverse 300 --trim_left 13 --trim_left_reverse 13 --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

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.11 / RcppParallel: 5.1.6
2) Filtering ..................
3) Learning Error Rates
386876 total bases in 1348 reads from 18 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,
3: learnErrors(filts, nreads = nreads.learn, multithread = multithread)
2: withCallingHandlers(expr, warning = function(w) if (inherits(w,
classes)) tryInvokeRestart("muffleWarning"))
1: suppressWarnings(learnErrors(filts, nreads = nreads.learn, multithread = multithread))
Traceback (most recent call last):
File "/software/el9/apps/qiime2/2023.7/lib/python3.8/site-packages/q2_dada2/", line 326, in denoise_paired
File "/software/el9/apps/qiime2/2023.7/lib/python3.8/site-packages/q2_dada2/", line 36, in run_commands, check=True)
File "/software/el9/apps/qiime2/2023.7/lib/python3.8/", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/tmpou4zdjbx/forward', '--input_directory_reverse', '/tmp/tmpou4zdjbx/reverse', '--output_path', '/tmp/tmpou4zdjbx/output.tsv.biom', '--output_track', '/tmp/tmpou4zdjbx/track.tsv', '--filtered_directory', '/tmp/tmpou4zdjbx/filt_f', '--filtered_directory_reverse', '/tmp/tmpou4zdjbx/filt_r', '--truncation_length', '300', '--truncation_length_reverse', '300', '--trim_left', '13', '--trim_left_reverse', '13', '--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 "/software/el9/apps/qiime2/2023.7/lib/python3.8/site-packages/q2cli/", line 478, in call
results = self._execute_action(
File "/software/el9/apps/qiime2/2023.7/lib/python3.8/site-packages/q2cli/", line 539, in _execute_action
results = action(**arguments)
File "", line 2, in denoise_paired
File "/software/el9/apps/qiime2/2023.7/lib/python3.8/site-packages/qiime2/sdk/", line 342, in bound_callable
outputs = self.callable_executor(
File "/software/el9/apps/qiime2/2023.7/lib/python3.8/site-packages/qiime2/sdk/", line 566, in callable_executor
output_views = self._callable(**view_args)
File "/software/el9/apps/qiime2/2023.7/lib/python3.8/site-packages/q2_dada2/", line 339, 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.
(base) [anthony.frazier@ceres meta_analysis]$

Hi @nathan.frazier35,

Just a head's up, I've moved this comment to a new post as it is not directly related to your original post. Please make sure to keep each post on topic with respect to the original question/issue. This helps forum users and moderators to better search for topics in an organized manner. Thank you!

1 Like

Ohh I apologize for that confusion. It's all connected in my head but I understand the confusion it might cause you or others. I am very sorry.

1 Like


That's okay, thanks for your understanding!

Here's the source of the error:

There weren't enough reads post-filtering to generate an error matrix. Do you mind sharing your demux file? This will give us a better idea of whether there is an issue with the file itself, or if you are filtering too aggressively for dada2 to estimate errors. Thanks!


metadata.qza (15.9 KB)
metadata.qzv (1.2 MB)
paired_reads.qza (235.5 KB)
paired_reads.qzv (326.1 KB)

I have attached the files retrieved using q2-fondue from NCBI PRJNA830647.

I have also attached a screenshot of the demux-debug directory indicating the reads are there (I think).

Please let me know what else I can attach/send to resolve this! Again...I apologize for being a burden but I truly appreciate the assistance.

Hi @nathan.frazier35,

Apologies for the delay on this! I will take a closer look at these files this afternoon and follow up with next steps. Cheers :lizard:

Hello @nathan.frazier35. That is a concerningly small number of reads in most contexts, but you may still be able to work with it just not using dada2. You will need to use deblur which will require you to merge your reads first. You'll want to do the following:

  1. Run your paired_reads.qza through qiime vsearch merge-pairs
  2. Take the merged sequences from that action and summarize them to determine new trim and truncation values
  3. Run your merged reads through qiime deblur denoise-16S using those new trim and truncation values

Let me know if you have any further questions.

Thank you both for your assistance. I am going to try a different dataset to see if the reads are indeed the issue.

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