dada2 denoise-ccs: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

Hi,

I have 4 datasets of PacBio HiFi reads. Among those, 3 datasets have been successfully processed in denoise-cc2. On my other dataset, I had this error as stated in the error report:

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_ccs.R /tmp/qiime2-archive-rk4tqc1o/f1fd0c9a-518f-48a1-ad90-96d8d6b9d878/data /tmp/tmpkdgdncdg/output.tsv.biom /tmp/tmpkdgdncdg/track.tsv /tmp/tmpkdgdncdg/nop /tmp/tmpkdgdncdg/filt AGRGTTYGATYMTGGCTCAG RGYTACCTTGTTACGACTT 2 False 0 0 2.0 2 1000 1600 independent consensus 3.5 10 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) Removing Primers
Multiple matches to the primer(s) in some sequences. Using the longest possible match.
1644 sequences out of 3320 are being reverse-complemented.
Read in 3320, output 2973 (89.5%) filtered sequences.
21 sequences out of 37 are being reverse-complemented.
Read in 37, output 33 (89.2%) filtered sequences.
162 sequences out of 335 are being reverse-complemented.
Read in 335, output 304 (90.7%) filtered sequences.
2 sequences out of 12 are being reverse-complemented.
Read in 12, output 10 (83.3%) filtered sequences.
8 sequences out of 15 are being reverse-complemented.
Read in 15, output 14 (93.3%) filtered sequences.
5 sequences out of 12 are being reverse-complemented.
Read in 12, output 11 (91.7%) filtered sequences.
4251 sequences out of 8903 are being reverse-complemented.
Read in 8903, output 8003 (89.9%) filtered sequences.
20 sequences out of 34 are being reverse-complemented.
Read in 34, output 31 (91.2%) filtered sequences.
1763 sequences out of 3515 are being reverse-complemented.
Read in 3515, output 3154 (89.7%) filtered sequences.
10 sequences out of 18 are being reverse-complemented.
Read in 18, output 18 (100%) filtered sequences.
71 sequences out of 133 are being reverse-complemented.
Read in 133, output 117 (88%) filtered sequences.
6 sequences out of 12 are being reverse-complemented.
Read in 12, output 11 (91.7%) filtered sequences.
6 sequences out of 15 are being reverse-complemented.
Read in 15, output 14 (93.3%) filtered sequences.
30 sequences out of 80 are being reverse-complemented.
Read in 80, output 68 (85%) filtered sequences.
58 sequences out of 114 are being reverse-complemented.
Read in 114, output 104 (91.2%) filtered sequences.
385 sequences out of 766 are being reverse-complemented.
Read in 766, output 686 (89.6%) filtered sequences.
818 sequences out of 1627 are being reverse-complemented.
Read in 1627, output 1452 (89.2%) filtered sequences.
6 sequences out of 18 are being reverse-complemented.
Read in 18, output 15 (83.3%) filtered sequences.
758 sequences out of 1551 are being reverse-complemented.
Read in 1551, output 1401 (90.3%) filtered sequences.
6 sequences out of 10 are being reverse-complemented.
Read in 10, output 9 (90%) filtered sequences.
15 sequences out of 28 are being reverse-complemented.
Read in 28, output 27 (96.4%) filtered sequences.
2 sequences out of 5 are being reverse-complemented.
Read in 5, output 5 (100%) filtered sequences.
Read in 1, output 0 (0%) filtered sequences.
1917 sequences out of 3860 are being reverse-complemented.
Read in 3860, output 3511 (91%) filtered sequences.
32 sequences out of 61 are being reverse-complemented.
Read in 61, output 58 (95.1%) filtered sequences.
2 sequences out of 5 are being reverse-complemented.
Read in 5, output 4 (80%) filtered sequences.
15 sequences out of 22 are being reverse-complemented.
Read in 22, output 21 (95.5%) filtered sequences.
1674 sequences out of 3439 are being reverse-complemented.
Read in 3439, output 3095 (90%) filtered sequences.
433 sequences out of 868 are being reverse-complemented.
Read in 868, output 785 (90.4%) filtered sequences.
467 sequences out of 952 are being reverse-complemented.
Read in 952, output 852 (89.5%) filtered sequences.
2 sequences out of 4 are being reverse-complemented.
Read in 4, output 4 (100%) filtered sequences.
540 sequences out of 1139 are being reverse-complemented.
Read in 1139, output 1017 (89.3%) filtered sequences.
4 sequences out of 9 are being reverse-complemented.
Read in 9, output 8 (88.9%) filtered sequences.
502 sequences out of 1046 are being reverse-complemented.
Read in 1046, output 930 (88.9%) filtered sequences.
3634 sequences out of 7198 are being reverse-complemented.
Read in 7198, output 6514 (90.5%) filtered sequences.
34 sequences out of 77 are being reverse-complemented.
Read in 77, output 69 (89.6%) filtered sequences.
17317 sequences out of 35368 are being reverse-complemented.
Read in 35368, output 31254 (88.4%) filtered sequences.
273 sequences out of 592 are being reverse-complemented.
Read in 592, output 521 (88%) filtered sequences.
603 sequences out of 1336 are being reverse-complemented.
Read in 1336, output 1196 (89.5%) filtered sequences.
1054 sequences out of 2124 are being reverse-complemented.
Read in 2124, output 1939 (91.3%) filtered sequences.
64 sequences out of 132 are being reverse-complemented.
Read in 132, output 120 (90.9%) filtered sequences.
5 sequences out of 8 are being reverse-complemented.
Read in 8, output 7 (87.5%) filtered sequences.
25316 sequences out of 51452 are being reverse-complemented.
Read in 51452, output 46171 (89.7%) filtered sequences.
4268 sequences out of 8671 are being reverse-complemented.
Read in 8671, output 7731 (89.2%) filtered sequences.
7106 sequences out of 14293 are being reverse-complemented.
Read in 14293, output 12856 (89.9%) filtered sequences.
2014 sequences out of 4081 are being reverse-complemented.
Read in 4081, output 3659 (89.7%) filtered sequences.
99 sequences out of 212 are being reverse-complemented.
Read in 212, output 190 (89.6%) filtered sequences.
47 sequences out of 96 are being reverse-complemented.
Read in 96, output 82 (85.4%) filtered sequences.
118 sequences out of 274 are being reverse-complemented.
Read in 274, output 246 (89.8%) filtered sequences.
15 sequences out of 25 are being reverse-complemented.
Read in 25, output 22 (88%) filtered sequences.
147 sequences out of 287 are being reverse-complemented.
Read in 287, output 255 (88.9%) filtered sequences.
1 sequences out of 4 are being reverse-complemented.
Read in 4, output 3 (75%) filtered sequences.
3178 sequences out of 6534 are being reverse-complemented.
Read in 6534, output 5856 (89.6%) filtered sequences.
126 sequences out of 250 are being reverse-complemented.
Read in 250, output 224 (89.6%) filtered sequences.
7 sequences out of 14 are being reverse-complemented.
Read in 14, output 10 (71.4%) filtered sequences.
135 sequences out of 274 are being reverse-complemented.
Read in 274, output 251 (91.6%) filtered sequences.
5824 sequences out of 12033 are being reverse-complemented.
Read in 12033, output 10858 (90.2%) filtered sequences.
12182 sequences out of 24898 are being reverse-complemented.
Read in 24898, output 22021 (88.4%) filtered sequences.
189 sequences out of 407 are being reverse-complemented.
Read in 407, output 371 (91.2%) filtered sequences.
21 sequences out of 44 are being reverse-complemented.
Read in 44, output 39 (88.6%) filtered sequences.
136 sequences out of 257 are being reverse-complemented.
Read in 257, output 242 (94.2%) filtered sequences.
9 sequences out of 18 are being reverse-complemented.
Read in 18, output 18 (100%) filtered sequences.
19 sequences out of 43 are being reverse-complemented.
Read in 43, output 32 (74.4%) filtered sequences.
8 sequences out of 20 are being reverse-complemented.
Read in 20, output 16 (80%) filtered sequences.
3 sequences out of 9 are being reverse-complemented.
Read in 9, output 5 (55.6%) filtered sequences.
1 sequences out of 4 are being reverse-complemented.
Read in 4, output 2 (50%) filtered sequences.
625 sequences out of 1281 are being reverse-complemented.
Read in 1281, output 1152 (89.9%) filtered sequences.
32 sequences out of 77 are being reverse-complemented.
Read in 77, output 63 (81.8%) filtered sequences.
Some input samples had no reads pass the primer detection.
......................x.............................................
2) Filtering
...................................................................
3) Learning Error Rates
227459365 total bases in 157484 reads from 67 samples will be used for learning the error rates.
4) Denoise samples 
...................................................................
5) Remove chimeras (method = consensus)
6) Report read numbers through the pipeline
Error in cbind(prim, out[, 2], matrix(0, nrow = nrow(out), ncol = 2)) : 
  number of rows of matrices must match (see arg 3)
Execution halted
Traceback (most recent call last):
  File "/home/sandfishtrace/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 361, in denoise_ccs
    run_commands([cmd])
  File "/home/sandfishtrace/anaconda3/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/sandfishtrace/anaconda3/envs/qiime2-2022.2/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada_ccs.R', '/tmp/qiime2-archive-rk4tqc1o/f1fd0c9a-518f-48a1-ad90-96d8d6b9d878/data', '/tmp/tmpkdgdncdg/output.tsv.biom', '/tmp/tmpkdgdncdg/track.tsv', '/tmp/tmpkdgdncdg/nop', '/tmp/tmpkdgdncdg/filt', 'AGRGTTYGATYMTGGCTCAG', 'RGYTACCTTGTTACGACTT', '2', 'False', '0', '0', '2.0', '2', '1000', '1600', 'independent', 'consensus', '3.5', '10', '1000000']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sandfishtrace/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/commands.py", line 339, in __call__
    results = action(**arguments)
  File "<decorator-gen-207>", line 2, in denoise_ccs
  File "/home/sandfishtrace/anaconda3/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/sandfishtrace/anaconda3/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/sandfishtrace/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 370, in denoise_ccs
    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.


Hoping you can help me with this. Thank you!

Hi @acmaguila,

I think this error is due to some samples with zero reads passing the primer detection. A similar issue came up in this post, which may be helpful context for you to take a look at. Can you please provide your original command?

Hi, I think the reason behind this is the samples that has low read count. I tried to remove them from the dataset and the run worked properly. Thank you for the help!

1 Like

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