Error encountered running DADA2 in R

Hello, I apologise if this has been answered but I searched for this error and saw it has been answered previously, though my error seems to be different from others. I am getting an error running dada2 denoising with my demultiplexed data (16S metabarcoding data). This data was demultiplexed by the sequencing centre, and then I imported the data, trimmed primers, and tried dada2 denoising.

I am using QIIME2-2022.2 and will post my import through dada2 commands, followed by a verbose output from running my denoising commands. My sequence files are gzipped fastq's with names like 16S_485686R1.fastq.gz and the same R2 names. Any help deciphering the error would be very much appreciated.

########CODE####
conda activate qiime2-2022.2

#check currently active conda environment
conda info
#activate tab completion
source tab-qiime
#Now import our data using a 'manifest' file of all fastq file names
qiime tools import
--type 'SampleData[PairedEndSequencesWithQuality]'
--input-path pe33-16Smanifest
--input-format PairedEndFastqManifestPhred33V2
--output-path 16S-combined-demux.qza

#Now trim primers
qiime cutadapt trim-paired
--i-demultiplexed-sequences 16S-combined-demux.qza
--p-front-f AGCGYAATCACTTGTCTYTTAA
--p-front-r CRBGGTCGCCCCAACCRAA
--p-error-rate 0.11
--output-dir trimmed
--verbose

qiime dada2 denoise-paired \

--i-demultiplexed-seqs trimmed/trimmed_sequences.qza
--p-trunc-len-f 158
--p-trunc-len-r 158
--p-n-threads 0
--p-min-overlap 12
--p-pooling-method independent
--output-dir trimmed/dada2out
--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_paired.R /tmp/tmpv3r6rmfb/forward /tmp/tmpv3r6rmfb/reverse /tmp/tmpv3r6rmfb/output.tsv.biom /tmp/tmpv3r6rmfb/track.tsv /tmp/tmpv3r6rmfb/filt_f /tmp/tmpv3r6rmfb/filt_r 158 158 0 0 2.0 2.0 2 12 independent consensus 1.0 0 1000000

R version 4.1.3 (2022-03-10)
Loading required package: Rcpp
DADA2: 1.22.0 / Rcpp: 1.0.8.3 / RcppParallel: 5.1.5

  1. Filtering The filter removed all reads: /tmp/tmpv3r6rmfb/filt_f/Sample-111_110_L001_R1_001.fastq.gz and /tmp/tmpv3r6rmfb/filt_r/Sample-111_225_L001_R2_001.fastq.gz not written.
    The filter removed all reads: /tmp/tmpv3r6rmfb/filt_f/Sample-115_114_L001_R1_001.fastq.gz and /tmp/tmpv3r6rmfb/filt_r/Sample-115_229_L001_R2_001.fastq.gz not written.
    The filter removed all reads: /tmp/tmpv3r6rmfb/filt_f/Sample-114_113_L001_R1_001.fastq.gz and /tmp/tmpv3r6rmfb/filt_r/Sample-114_228_L001_R2_001.fastq.gz not written.
    The filter removed all reads: /tmp/tmpv3r6rmfb/filt_f/Sample-104_103_L001_R1_001.fastq.gz and /tmp/tmpv3r6rmfb/filt_r/Sample-104_218_L001_R2_001.fastq.gz not written.
    The filter removed all reads: /tmp/tmpv3r6rmfb/filt_f/Sample-3_2_L001_R1_001.fastq.gz and /tmp/tmpv3r6rmfb/filt_r/Sample-3_117_L001_R2_001.fastq.gz not written.
    The filter removed all reads: /tmp/tmpv3r6rmfb/filt_f/Sample-96_95_L001_R1_001.fastq.gz and /tmp/tmpv3r6rmfb/filt_r/Sample-96_210_L001_R2_001.fastq.gz not written.
    Some input samples had no reads pass the filter.
    ......x.......x..xx...................x........................................................................x...
  2. Learning Error Rates
    231020332 total bases in 1462154 reads from 2 samples will be used for learning the error rates.
    231020332 total bases in 1462154 reads from 2 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.
    Execution halted
    Traceback (most recent call last):
    File "/home/mcrg/Downloads/usr/bin/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 279, in denoise_paired
    run_commands([cmd])
    File "/home/mcrg/Downloads/usr/bin/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
    File "/home/mcrg/Downloads/usr/bin/envs/qiime2-2022.2/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmpv3r6rmfb/forward', '/tmp/tmpv3r6rmfb/reverse', '/tmp/tmpv3r6rmfb/output.tsv.biom', '/tmp/tmpv3r6rmfb/track.tsv', '/tmp/tmpv3r6rmfb/filt_f', '/tmp/tmpv3r6rmfb/filt_r', '158', '158', '0', '0', '2.0', '2.0', '2', '12', 'independent', 'consensus', '1.0', '0', '1000000']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/mcrg/Downloads/usr/bin/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/commands.py", line 339, in call
results = action(**arguments)
File "", line 2, in denoise_paired
File "/home/mcrg/Downloads/usr/bin/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
outputs = self.callable_executor(scope, callable_args,
File "/home/mcrg/Downloads/usr/bin/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 391, in callable_executor
output_views = self._callable(**view_args)
File "/home/mcrg/Downloads/usr/bin/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 292, 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.

Hello @Nick_Jeffery. This thread appears to be discussing a similar issue. Did you use an Illumina iSeq machine, and is it possible you are encountering the same issue? I suspect something similar is happening based on this

"Error rates could not be estimated (this is usually because of very few reads).
Error in getErrors(err, enforce = TRUE) : Error matrix is NULL."

appearing in both your error message and the one in that thread. Thank you.

1 Like

Hello @Oddant1, we used a NovaSeq 6000 but I suspect the issue is quality binning like that other thread. Thanks, I will try to work on a workaround or try deblur instead of DADA2.
Thanks again.

1 Like

You're welcome, if you can't find a work around let us know.

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