# Error with dada2 plugin: Tried both single and paired-end reads

**URL:** <https://forum.qiime2.org/t/error-with-dada2-plugin-tried-both-single-and-paired-end-reads/14692>\
**Category:** User Support\
**Created:** [April 29, 2020, 12:43pm UTC](https://forum.qiime2.org/t/error-with-dada2-plugin-tried-both-single-and-paired-end-reads/14692 "2020-04-29T12:43:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hcunnin6](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/h/9e8a1a/32.png) [@hcunnin6](https://forum.qiime2.org/u/hcunnin6)\
**Post date:** [April 29, 2020, 12:43pm UTC](https://forum.qiime2.org/t/error-with-dada2-plugin-tried-both-single-and-paired-end-reads/14692/1 "2020-04-29T12:43:50Z")

</div>

Hello! I have read several helpful tutorial posts on the dada2 error, however after trying to re-run with single reads only, I still get this error:  
**Plugin error from dada2:**

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

The command I used for single-reads was: qiime dada2 denoise-single --i-demultiplexed-seqs demux-single-end.qza --p-trim-left 0 --p-trunc-len 250 --o-representative-sequences rep-seqs-single-dada2.qza --o-table table-single-dada2.qza --o-denoising-stats stats-single-dada2.qza --p-n-threads 0 --verbose

This was the warning output:  
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\_single.R /tmp/qiime2-archive-\_9d58djz/12dde99a-8e91-47f5-85b9-732ecd23c254/data /tmp/tmpqedh3p0i/output.tsv.biom /tmp/tmpqedh3p0i/track.tsv /tmp/tmpqedh3p0i 250 0 2.0 2 Inf consensus 1.0 0 1000000 NULL 16

R version 3.5.1 (2018-07-02)  
Loading required package: Rcpp  
DADA2: 1.10.0 / Rcpp: 1.0.2 / RcppParallel: 4.4.4

1. Filtering  
\*\*\* caught segfault \*\*\*  
address (nil), cause 'unknown'

Traceback:  
1: is(object, "classRepresentation")  
2: isClassDef(Class)  
3: isVirtualClass(class)  
4: initialize(value, ...)  
5: initialize(value, ...)  
6: methods::new(def, ...)  
7: g$new(con = path, path = descr, ...)  
8: .ShortReadFile(.FastqStreamer\_g, con, reader = .binReader, readerBlockSize = as.integer(readerBlockSize), skips = 0L, adds = n, ith = 0L, recycle = TRUE, sampler = streamer, verbose = verbose)  
9: .ShortReadFile(.FastqStreamer\_g, con, reader = .binReader, readerBlockSize = as.integer(readerBlockSize), skips = 0L, adds = n, ith = 0L, recycle = TRUE, sampler = streamer, verbose = verbose)  
10: FastqStreamer(fn, n = n)  
11: FastqStreamer(fn, n = n)  
12: (function (fn, fout, truncQ = 2, truncLen = 0, maxLen = Inf, minLen = 20, trimLeft = 0, trimRight = 0, maxN = 0, minQ = 0, maxEE = Inf, rm.phix = TRUE, orient.fwd = NULL, n = 1e+06, OMP = TRUE, compress = TRUE, verbose = FALSE, ...) { if (!OMP) { ompthreads \<- .Call(ShortRead:::.set\_omp\_threads, 1L) on.exit(.Call(ShortRead:::.set\_omp\_threads, ompthreads)) } start \<- max(1, trimLeft + 1, na.rm = TRUE) end \<- truncLen if (end \< start) { end = NA } end \<- end - start + 1 if (fn == fout) { stop("The output and input files must be different.") } f \<- FastqStreamer(fn, n = n) on.exit(close(f)) if (file.exists(fout)) { if (file.remove(fout)) { if (verbose) message("Overwriting file:", fout) } else { stop("Failed to overwrite file:", fout) } } first = TRUE inseqs = 0 outseqs = 0 while (length(suppressWarnings(fq \<- yield(f)))) { inseqs \<- inseqs + length(fq) if (!is.null(orient.fwd)) { if (!C\_isACGT(orient.fwd)) stop("Non-ACGT characters detected in orient.fwd") barlen \<- nchar(orient.fwd) fq.rc \<- reverseComplement(fq) keepF \<- narrow(sread(fq), 1, barlen) == orient.fwd keepR \<- narrow(sread(fq.rc), 1, barlen) == orient.fwd & !keepF fq \<- ShortReadQ(sread = c(sread(fq[keepF]), sread(fq.rc[keepR])), quality = c(quality(quality(fq[keepF])), quality(quality(fq.rc[keepR]))), id = c(id(fq[keepF]), id(fq.rc[keepR]))) } if (is.finite(maxLen)) { fq \<- fq[width(fq) \<= maxLen] } fq \<- fq[width(fq) \>= start] fq \<- narrow(fq, start = start, end = NA) if (trimRight \> 0) { fq \<- fq[width(fq) \> trimRight] fq \<- narrow(fq, start = NA, end = width(fq) - trimRight) } enc \<- encoding(quality(fq)) if (is.numeric(truncQ)) { ind \<- which(enc == truncQ) if (length(ind) != 1) stop("Encoding for this truncQ value not found.") truncQ \<- names(enc)[[ind]] } if (length(fq) \> 0) fq \<- trimTails(fq, 1, truncQ) truncQ \<- enc[truncQ] if (!is.na(end)) { fq \<- fq[width(fq) \>= end] } fq \<- narrow(fq, start = 1, end = end) fq \<- fq[width(fq) \>= minLen] fq \<- fq[nFilter(maxN)(fq)] keep \<- rep(TRUE, length(fq)) qq \<- as(quality(fq), "matrix") if (minQ \> truncQ) keep \<- keep & (apply(qq, 1, min, na.rm = TRUE) \> minQ) if (maxEE \< Inf) { keep \<- keep & C\_matrixEE(qq) \<= maxEE } fq \<- fq[keep] if (rm.phix) { is.phi \<- isPhiX(as(sread(fq), "character"), ...) fq \<- fq[!is.phi] } outseqs \<- outseqs + length(fq) if (first) { writeFastq(fq, fout, "w", compress = compress) first = FALSE } else { writeFastq(fq, fout, "a", compress = compress) } } if (verbose) { outperc \<- round(outseqs \* 100/inseqs, 1) outperc \<- paste(" (", outperc, "%)", sep = "") message("Read in ", inseqs, ", output ", outseqs, outperc, " filtered sequences.", sep = "") } if (outseqs == 0) { message(paste("The filter removed all reads:", fout, "not written.")) file.remove(fout) } return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = 250L, trimLeft = 0L, trimRight = 0, maxLen = Inf, minLen = 20, maxN = 0, minQ = 0, maxEE = 2, rm.phix = TRUE, orient.fwd = NULL, n = 1e+05, OMP = FALSE, compress = TRUE, verbose = FALSE)  
13: .mapply(FUN, dots, MoreArgs)  
14: FUN(X[[i]], ...)  
15: lapply(X = S, FUN = FUN, ...)  
16: doTryCatch(return(expr), name, parentenv, handler)  
17: tryCatchOne(expr, names, parentenv, handlers[[1L]])  
18: tryCatchList(expr, classes, parentenv, handlers)  
19: tryCatch(expr, error = function(e) { call \<- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call \<- sys.call(-4L) dcall \<- deparse(call)[1L] prefix \<- paste("Error in", dcall, ": ") LONG \<- 75L sm \<- strsplit(conditionMessage(e), "\n")[[1L]] w \<- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w \<- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w \> LONG) prefix \<- paste0(prefix, "\n ") } else prefix \<- "Error : " msg \<- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})  
20: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)  
21: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))  
22: FUN(X[[i]], ...)  
23: lapply(seq\_len(cores), inner.do)  
24: mclapply(seq\_len(n), do\_one, mc.preschedule = mc.preschedule, mc.set.seed = mc.set.seed, mc.silent = mc.silent, mc.cores = mc.cores, mc.cleanup = mc.cleanup, affinity.list = affinity.list)  
25: mcmapply(fastqFilter, fwd, filt, MoreArgs = list(truncQ = truncQ, truncLen = truncLen, trimLeft = trimLeft, trimRight = trimRight, maxLen = maxLen, minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE, rm.phix = rm.phix, orient.fwd = orient.fwd, n = n, OMP = OMP, compress = compress, verbose = verbose), mc.cores = ncores, mc.silent = TRUE)  
26: filterAndTrim(unfilts, filts, truncLen = truncLen, trimLeft = trimLeft, maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE, multithread = multithread, maxLen = maxLen)  
27: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))  
28: suppressWarnings(filterAndTrim(unfilts, filts, truncLen = truncLen, trimLeft = trimLeft, maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE, multithread = multithread, maxLen = maxLen))  
An irrecoverable exception occurred. R is aborting now ...

\*\*\* caught bus error \*\*\*  
address 0x2ae1b4527604, cause 'non-existent physical address'

Traceback:  
1: readBin(con, raw(), n)  
2: reader(con, readerBlockSize)  
3: x$yield(...)  
4: yield(f)  
5: yield(f)  
6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))  
7: suppressWarnings(fq \<- yield(f))  
8: (function (fn, fout, truncQ = 2, truncLen = 0, maxLen = Inf, minLen = 20, trimLeft = 0, trimRight = 0, maxN = 0, minQ = 0, maxEE = Inf, rm.phix = TRUE, orient.fwd = NULL, n = 1e+06, OMP = TRUE, compress = TRUE, verbose = FALSE, ...) { if (!OMP) { ompthreads \<- .Call(ShortRead:::.set\_omp\_threads, 1L) on.exit(.Call(ShortRead:::.set\_omp\_threads, ompthreads)) } start \<- max(1, trimLeft + 1, na.rm = TRUE) end \<- truncLen if (end \< start) { end = NA } end \<- end - start + 1 if (fn == fout) { stop("The output and input files must be different.") } f \<- FastqStreamer(fn, n = n) on.exit(close(f)) if (file.exists(fout)) { if (file.remove(fout)) { if (verbose) message("Overwriting file:", fout) } else { stop("Failed to overwrite file:", fout) } } first = TRUE inseqs = 0 outseqs = 0 while (length(suppressWarnings(fq \<- yield(f)))) { inseqs \<- inseqs + length(fq) if (!is.null(orient.fwd)) { if (!C\_isACGT(orient.fwd)) stop("Non-ACGT characters detected in orient.fwd") barlen \<- nchar(orient.fwd) fq.rc \<- reverseComplement(fq) keepF \<- narrow(sread(fq), 1, barlen) == orient.fwd keepR \<- narrow(sread(fq.rc), 1, barlen) == orient.fwd & !keepF fq \<- ShortReadQ(sread = c(sread(fq[keepF]), sread(fq.rc[keepR])), quality = c(quality(quality(fq[keepF])), quality(quality(fq.rc[keepR]))), id = c(id(fq[keepF]), id(fq.rc[keepR]))) } if (is.finite(maxLen)) { fq \<- fq[width(fq) \<= maxLen] } fq \<- fq[width(fq) \>= start] fq \<- narrow(fq, start = start, end = NA) if (trimRight \> 0) { fq \<- fq[width(fq) \> trimRight] fq \<- narrow(fq, start = NA, end = width(fq) - trimRight) } enc \<- encoding(quality(fq)) if (is.numeric(truncQ)) { ind \<- which(enc == truncQ) if (length(ind) != 1) stop("Encoding for this truncQ value not found.") truncQ \<- names(enc)[[ind]] } if (length(fq) \> 0) fq \<- trimTails(fq, 1, truncQ) truncQ \<- enc[truncQ] if (!is.na(end)) { fq \<- fq[width(fq) \>= end] } fq \<- narrow(fq, start = 1, end = end) fq \<- fq[width(fq) \>= minLen] fq \<- fq[nFilter(maxN)(fq)] keep \<- rep(TRUE, length(fq)) qq \<- as(quality(fq), "matrix") if (minQ \> truncQ) keep \<- keep & (apply(qq, 1, min, na.rm = TRUE) \> minQ) if (maxEE \< Inf) { keep \<- keep & C\_matrixEE(qq) \<= maxEE } fq \<- fq[keep] if (rm.phix) { is.phi \<- isPhiX(as(sread(fq), "character"), ...) fq \<- fq[!is.phi] } outseqs \<- outseqs + length(fq) if (first) { writeFastq(fq, fout, "w", compress = compress) first = FALSE } else { writeFastq(fq, fout, "a", compress = compress) } } if (verbose) { outperc \<- round(outseqs \* 100/inseqs, 1) outperc \<- paste(" (", outperc, "%)", sep = "") message("Read in ", inseqs, ", output ", outseqs, outperc, " filtered sequences.", sep = "") } if (outseqs == 0) { message(paste("The filter removed all reads:", fout, "not written.")) file.remove(fout) } return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = 250L, trimLeft = 0L, trimRight = 0, maxLen = Inf, minLen = 20, maxN = 0, minQ = 0, maxEE = 2, rm.phix = TRUE, orient.fwd = NULL, n = 1e+05, OMP = FALSE, compress = TRUE, verbose = FALSE)  
9: .mapply(FUN, dots, MoreArgs)  
10: FUN(X[[i]], ...)  
11: lapply(X = S, FUN = FUN, ...)  
12: doTryCatch(return(expr), name, parentenv, handler)  
13: tryCatchOne(expr, names, parentenv, handlers[[1L]])  
14: tryCatchList(expr, classes, parentenv, handlers)  
15: tryCatch(expr, error = function(e) { call \<- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call \<- sys.call(-4L) dcall \<- deparse(call)[1L] prefix \<- paste("Error in", dcall, ": ") LONG \<- 75L sm \<- strsplit(conditionMessage(e), "\n")[[1L]] w \<- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w \<- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w \> LONG) prefix \<- paste0(prefix, "\n ") } else prefix \<- "Error : " msg \<- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})  
16: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)  
17: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))  
18: FUN(X[[i]], ...)  
19: lapply(seq\_len(cores), inner.do)  
20: mclapply(seq\_len(n), do\_one, mc.preschedule = mc.preschedule, mc.set.seed = mc.set.seed, mc.silent = mc.silent, mc.cores = mc.cores, mc.cleanup = mc.cleanup, affinity.list = affinity.list)  
21: mcmapply(fastqFilter, fwd, filt, MoreArgs = list(truncQ = truncQ, truncLen = truncLen, trimLeft = trimLeft, trimRight = trimRight, maxLen = maxLen, minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE, rm.phix = rm.phix, orient.fwd = orient.fwd, n = n, OMP = OMP, compress = compress, verbose = verbose), mc.cores = ncores, mc.silent = TRUE)  
22: filterAndTrim(unfilts, filts, truncLen = truncLen, trimLeft = trimLeft, maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE, multithread = multithread, maxLen = maxLen)  
23: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))  
24: suppressWarnings(filterAndTrim(unfilts, filts, truncLen = truncLen, trimLeft = trimLeft, maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE, multithread = multithread, maxLen = maxLen))  
An irrecoverable exception occurred. R is aborting now ...  
Bus error

I have attached my demux qzv for both single and paired to view as well. [demux-paired-end.qzv](https://forum.qiime2.org/uploads/short-url/ytntEG4K4vVLneCJm6ZxBBbMXIF.qzv) (294.5 KB) [demux-single-end.qzv](https://forum.qiime2.org/uploads/short-url/djp3SgjtVcAp8UK4G0TegkIpXo9.qzv) (289.4 KB)

Perhaps I need to re-download and import my fastq.gz files from the IlluminaBase Space again?

Thank you for your help!  
Hannah

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [April 29, 2020, 2:30pm UTC](https://forum.qiime2.org/t/error-with-dada2-plugin-tried-both-single-and-paired-end-reads/14692/2 "2020-04-29T14:30:30Z")

</div>

Hi @hcunnin6!

> [@hcunnin6](#):
>
> Perhaps I need to re-download and import my fastq.gz files from the IlluminaBase Space again?

Hmm, maybe, but I'm not sure, mostly because of the main cause of the error message:

> [@hcunnin6](#):
>
> \*\*\* caught bus error \*\*\*  
> address 0x2ae1b4527604, cause ‘non-existent physical address’

This sounds like a memory issue. I noticed you're running `--p-n-threads 0` - I wonder if this is exhausting your system resources - maybe try running with a lower thread count (which ironically is a higher number for this parameter, since `0` represents the "auto" option). As for a recommendation for what value to use, I can't say, since it depends on the specifics of your computational environment.

:qiime2:

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [May 30, 2020, 8:30pm UTC](https://forum.qiime2.org/t/error-with-dada2-plugin-tried-both-single-and-paired-end-reads/14692/3 "2020-05-30T20:30:30Z")

</div>

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