Dada2 error: address 0x2ac83afde87c, cause 'non-existent physical address'

Hello - I ran dada2 with the following command and got a lengthy error that I don’t know how to resolve. Has anyone ever come across this type of error before and knows how to fix it? Thank you for your help!

Command:

qiime dada2 denoise-paired \
--i-demultiplexed-seqs /rhome/epape/shared/ellen-pape/GSR/analysis-results/dada2/GSR-demux-PE-cutadapt-reads.qza \
--p-trim-left-f 2 \
--p-trim-left-r 2 \
--p-trunc-len-f 230 \
--p-trunc-len-r 160 \
--p-n-threads 12 \
--o-representative-sequences /rhome/epape/shared/ellen-pape/GSR/analysis-results/dada2/GSR-PE-cutadapt-rep-seqs.qza \
--o-table /rhome/epape/shared/ellen-pape/GSR/analysis-results/dada2/GSR-PE-cutadapt-table.qza

Error:

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/tmpy21dhbhp/forward /tmp/tmpy21dhbhp/reverse /tmp/tmpy21dhbhp/output.tsv.biom /tmp/tmpy21dhbhp/track.tsv /tmp/tmpy21dhbhp/filt_f /tmp/tmpy21dhbhp/filt_r 230 160 2 2 2.0 2 consensus 1.0 12 1000000

R version 3.4.1 (2017-06-30)
Loading required package: Rcpp
DADA2 R package version: 1.6.0
1) Filtering
 *** caught bus error ***
address 0x2ac83afde87c, cause 'non-existent physical address'

Traceback:
 1: readBin(con, raw(), n)
 2: reader(con, readerBlockSize)
 3: x$yield(...)
 4: yield(fF)
 5: yield(fF)
 6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
 7: suppressWarnings(fqF <- yield(fF))
 8: (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0,     0), maxLen = c(Inf, Inf), minLen = c(20, 20), trimLeft = c(0,     0), minQ = c(0, 0), maxEE = c(Inf, Inf), rm.phix = c(TRUE,     TRUE), matchIDs = FALSE, primer.fwd = NULL, id.sep = "\\s",     id.field = 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))    }    if (!is.character(fn) || length(fn) != 2)         stop("Two paired input file names required.")    if (!is.character(fout) || length(fout) != 2)         stop("Two paired output file names required.")    if (any(duplicated(c(fn, fout)))) {        stop("The output and input file names must be different.")    }    for (var in c("maxN", "truncQ", "truncLen", "maxLen", "minLen",         "trimLeft", "minQ", "maxEE", "rm.phix")) {        if (length(get(var)) == 1) {            assign(var, c(get(var), get(var)))        }        if (length(get(var)) != 2) {            stop(paste("Input variable", var, "must be length 1 or 2 (Forward, Reverse)."))        }    }    startF <- max(1, trimLeft[[1]] + 1, na.rm = TRUE)    startR <- max(1, trimLeft[[2]] + 1, na.rm = TRUE)    endF <- truncLen[[1]]    if (endF < startF) {        endF = NA    }    endF <- endF - startF + 1    endR <- truncLen[[2]]    if (endR < startR) {        endR = NA    }    endR <- endR - startR + 1    fF <- FastqStreamer(fn[[1]], n = n)    on.exit(close(fF))    fR <- FastqStreamer(fn[[2]], n = n)    on.exit(close(fR), add = TRUE)    if (file.exists(fout[[1]])) {        if (file.remove(fout[[1]])) {            if (verbose)                 message("Overwriting file:", fout[[1]])        }        else {            stop("Failed to overwrite file:", fout[[1]])        }    }    if (file.exists(fout[[2]])) {        if (file.remove(fout[[2]])) {            if (verbose)                 message("Overwriting file:", fout[[2]])        }        else {            stop("Failed to overwrite file:", fout[[2]])        }    }    first = TRUE    remainderF <- ShortReadQ()    remainderR <- ShortReadQ()    casava <- "Undetermined"    inseqs = 0    outseqs = 0    while (TRUE) {        suppressWarnings(fqF <- yield(fF))        suppressWarnings(fqR <- yield(fR))        if (length(fqF) == 0 && length(fqR) == 0) {            break        }        inseqs <- inseqs + length(fqF)        if (matchIDs) {            if (first) {                if (is.null(id.field)) {                  id1 <- as.character(id(fqF)[[1]])                  id.fields <- strsplit(id1, id.sep)[[1]]                  ncolon <- sapply(gregexpr(":", id.fields),                     length)                  ncoltab <- table(ncolon)                  if (max(ncolon) == 6 && ncoltab["6"] == 1) {                    casava <- "Current"                    id.field <- which(ncolon == 6)                  }                  else if (max(ncolon) == 4 && ncoltab["4"] ==                     1) {                    casava <- "Old"                    id.field <- which(ncolon == 4)                  }                  else {                    stop("Couldn't automatically detect the sequence identifier field in the fastq id string.")                  }                }            }            else {                fqF <- append(remainderF, fqF)                fqR <- append(remainderR, fqR)            }        }        else {            if (length(fqF) != length(fqR))                 stop("Mismatched forward and reverse sequence files: ",                   length(fqF), ", ", length(fqR), ".")        }        if (matchIDs) {            idsF <- sapply(strsplit(as.character(id(fqF)), id.sep),                 `[`, id.field)            idsR <- sapply(strsplit(as.character(id(fqR)), id.sep),                 `[`, id.field)            if (casava == "Old") {                idsF <- sapply(strsplit(idsF, "#"), `[`, 1)            }            lastF <- max(c(0, which(idsF %in% idsR)))            lastR <- max(c(0, which(idsR %in% idsF)))            if (lastF < length(fqF)) {                remainderF <- fqF[(lastF + 1):length(fqF)]            }            else {                remainderF <- ShortReadQ()            }            if (lastR < length(fqR)) {                remainderR <- fqR[(lastR + 1):length(fqR)]            }            else {                remainderR <- ShortReadQ()            }            fqF <- fqF[idsF %in% idsR]            fqR <- fqR[idsR %in% idsF]        }        if (!is.null(primer.fwd)) {            barlen <- nchar(primer.fwd)            keepF <- narrow(sread(fqF), 1, barlen) == primer.fwd            keepR <- (narrow(sread(fqR), 1, barlen) == primer.fwd) &                 !keepF            fq <- ShortReadQ(sread = c(sread(fqF[keepF]), sread(fqR[keepR])),                 quality = c(quality(quality(fqF[keepF])), quality(quality(fqR[keepR]))),                 id = c(id(fqF[keepF]), id(fqR[keepR])))            fqR <- ShortReadQ(sread = c(sread(fqR[keepF]), sread(fqF[keepR])),                 quality = c(quality(quality(fqR[keepF])), quality(quality(fqF[keepR]))),                 id = c(id(fqR[keepF]), id(fqF[keepR])))            fqF <- fq            rm(fq)        }        if (is.finite(maxLen[[1]]) || is.finite(maxLen[[2]])) {            keep <- width(fqF) <= maxLen[[1]] & width(fqR) <=                 maxLen[[2]]            fqF <- fqF[keep]            fqR <- fqR[keep]        }        keep <- (width(fqF) >= startF & width(fqR) >= startR)        fqF <- fqF[keep]        fqF <- narrow(fqF, start = startF, end = NA)        fqR <- fqR[keep]        fqR <- narrow(fqR, start = startR, end = NA)        encF <- encoding(quality(fqF))        encR <- encoding(quality(fqR))        if (is.numeric(truncQ)) {            indF <- which(encF == truncQ[[1]])            indR <- which(encR == truncQ[[2]])            if (!(length(indF) == 1 && length(indR) == 1))                 stop("Encoding for this truncQ value not found.")            truncQ <- c(names(encF)[[indF]], names(encR)[[indR]])        }        if (length(fqF) > 0) {            rngF <- trimTails(fqF, 1, truncQ[[1]], ranges = TRUE)            fqF <- narrow(fqF, 1, end(rngF))        }        if (length(fqR) > 0) {            rngR <- trimTails(fqR, 1, truncQ[[2]], ranges = TRUE)            fqR <- narrow(fqR, 1, end(rngR))        }        truncQ <- c(encF[truncQ[1]], encR[truncQ[2]])        keep <- (width(fqF) > 0 & width(fqR) > 0)        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        if (!is.na(endF)) {            keep <- keep & (width(fqF) >= endF)        }        if (!is.na(endR)) {            keep <- keep & (width(fqR) >= endR)        }        fqF <- fqF[keep]        fqR <- fqR[keep]        fqF <- narrow(fqF, start = 1, end = endF)        fqR <- narrow(fqR, start = 1, end = endR)        keep <- width(fqF) >= minLen[[1]] & width(fqR) >= minLen[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        suppressWarnings(keep <- nFilter(maxN[[1]])(fqF) & nFilter(maxN[[2]])(fqR))        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        qmat <- as(quality(fqF), "matrix")        if (minQ[[1]] > truncQ[[1]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[1]]))        if (maxEE[[1]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[1]]        qmat <- as(quality(fqR), "matrix")        if (minQ[[2]] > truncQ[[2]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[2]]))        if (maxEE[[2]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        rm(qmat)        if (length(fqF) != length(fqR))             stop("Filtering caused mismatch between forward and reverse sequence lists: ",                 length(fqF), ", ", length(fqR), ".")        if (rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)            is.phi <- is.phi | isPhiX(as(sread(fqR), "character"),                 ...)        }        else if (rm.phix[[1]] && !rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)        }        else if (!rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqR), "character"), ...)        }        if (any(rm.phix)) {            fqF <- fqF[!is.phi]            fqR <- fqR[!is.phi]        }        outseqs <- outseqs + length(fqF)        if (first) {            writeFastq(fqF, fout[[1]], "w", compress = compress)            writeFastq(fqR, fout[[2]], "w", compress = compress)            first = FALSE        }        else {            writeFastq(fqF, fout[[1]], "a", compress = compress)            writeFastq(fqR, fout[[2]], "a", compress = compress)        }    }    if (outseqs == 0) {    }    if (verbose) {        outperc <- round(outseqs * 100/inseqs, 1)        outperc <- paste(" (", outperc, "%)", sep = "")        message("Read in ", inseqs, " paired-sequences, output ",             outseqs, outperc, " filtered paired-sequences.",             sep = "")    }    if (outseqs == 0) {        message(paste("The filter removed all reads:", fout[[1]],             "and", fout[[2]], "not written."))        file.remove(fout[[1]])        file.remove(fout[[2]])    }    return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = c(230L, 160L), trimLeft = c(2L, 2L), maxLen = Inf, minLen = 20, maxN = 0,     minQ = 0, maxEE = 2, rm.phix = TRUE, primer.fwd = NULL, matchIDs = FALSE,     id.sep = "\\s", id.field = 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        msg <- conditionMessage(e)        sm <- strsplit(msg, "\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 && identical(getOption("show.error.messages"),         TRUE)) {        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)
21: mcmapply(fastqPairedFilter, mapply(c, fwd, rev, SIMPLIFY = FALSE),     mapply(c, filt, filt.rev, SIMPLIFY = FALSE), MoreArgs = list(truncQ = truncQ,         truncLen = truncLen, trimLeft = trimLeft, maxLen = maxLen,         minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE,         rm.phix = rm.phix, primer.fwd = primer.fwd, matchIDs = matchIDs,         id.sep = id.sep, id.field = id.field, n = n, OMP = OMP,         compress = compress, verbose = verbose), mc.cores = ncores,     mc.silent = TRUE)
22: filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF,     truncLenR), trimLeft = c(trimLeftF, trimLeftR), maxEE = maxEE,     truncQ = truncQ, rm.phix = TRUE, multithread = multithread)
23: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
24: suppressWarnings(filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR,     truncLen = c(truncLenF, truncLenR), trimLeft = c(trimLeftF,         trimLeftR), maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE,     multithread = multithread))
An irrecoverable exception occurred. R is aborting now ...

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

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

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

Traceback:
 1: readBin(con, raw(), n)
 2: reader(con, readerBlockSize)
 3: x$yield(...)
 4: yield(fF)
 5: yield(fF)
 6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
 7: suppressWarnings(fqF <- yield(fF))
 8: (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0,     0), maxLen = c(Inf, Inf), minLen = c(20, 20), trimLeft = c(0,     0), minQ = c(0, 0), maxEE = c(Inf, Inf), rm.phix = c(TRUE,     TRUE), matchIDs = FALSE, primer.fwd = NULL, id.sep = "\\s",     id.field = 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))    }    if (!is.character(fn) || length(fn) != 2)         stop("Two paired input file names required.")    if (!is.character(fout) || length(fout) != 2)         stop("Two paired output file names required.")    if (any(duplicated(c(fn, fout)))) {        stop("The output and input file names must be different.")    }    for (var in c("maxN", "truncQ", "truncLen", "maxLen", "minLen",         "trimLeft", "minQ", "maxEE", "rm.phix")) {        if (length(get(var)) == 1) {            assign(var, c(get(var), get(var)))        }        if (length(get(var)) != 2) {            stop(paste("Input variable", var, "must be length 1 or 2 (Forward, Reverse)."))        }    }    startF <- max(1, trimLeft[[1]] + 1, na.rm = TRUE)    startR <- max(1, trimLeft[[2]] + 1, na.rm = TRUE)    endF <- truncLen[[1]]    if (endF < startF) {        endF = NA    }    endF <- endF - startF + 1    endR <- truncLen[[2]]    if (endR < startR) {        endR = NA    }    endR <- endR - startR + 1    fF <- FastqStreamer(fn[[1]], n = n)    on.exit(close(fF))    fR <- FastqStreamer(fn[[2]], n = n)    on.exit(close(fR), add = TRUE)    if (file.exists(fout[[1]])) {        if (file.remove(fout[[1]])) {            if (verbose)                 message("Overwriting file:", fout[[1]])        }        else {            stop("Failed to overwrite file:", fout[[1]])        }    }    if (file.exists(fout[[2]])) {        if (file.remove(fout[[2]])) {            if (verbose)                 message("Overwriting file:", fout[[2]])        }        else {            stop("Failed to overwrite file:", fout[[2]])        }    }    first = TRUE    remainderF <- ShortReadQ()    remainderR <- ShortReadQ()    casava <- "Undetermined"    inseqs = 0    outseqs = 0    while (TRUE) {        suppressWarnings(fqF <- yield(fF))        suppressWarnings(fqR <- yield(fR))        if (length(fqF) == 0 && length(fqR) == 0) {            break        }        inseqs <- inseqs + length(fqF)        if (matchIDs) {            if (first) {                if (is.null(id.field)) {                  id1 <- as.character(id(fqF)[[1]])                  id.fields <- strsplit(id1, id.sep)[[1]]                  ncolon <- sapply(gregexpr(":", id.fields),                     length)                  ncoltab <- table(ncolon)                  if (max(ncolon) == 6 && ncoltab["6"] == 1) {                    casava <- "Current"                    id.field <- which(ncolon == 6)                  }                  else if (max(ncolon) == 4 && ncoltab["4"] ==                     1) {                    casava <- "Old"                    id.field <- which(ncolon == 4)                  }                  else {                    stop("Couldn't automatically detect the sequence identifier field in the fastq id string.")                  }                }            }            else {                fqF <- append(remainderF, fqF)                fqR <- append(remainderR, fqR)            }        }        else {            if (length(fqF) != length(fqR))                 stop("Mismatched forward and reverse sequence files: ",                   length(fqF), ", ", length(fqR), ".")        }        if (matchIDs) {            idsF <- sapply(strsplit(as.character(id(fqF)), id.sep),                 `[`, id.field)            idsR <- sapply(strsplit(as.character(id(fqR)), id.sep),                 `[`, id.field)            if (casava == "Old") {                idsF <- sapply(strsplit(idsF, "#"), `[`, 1)            }            lastF <- max(c(0, which(idsF %in% idsR)))            lastR <- max(c(0, which(idsR %in% idsF)))            if (lastF < length(fqF)) {                remainderF <- fqF[(lastF + 1):length(fqF)]            }            else {                remainderF <- ShortReadQ()            }            if (lastR < length(fqR)) {                remainderR <- fqR[(lastR + 1):length(fqR)]            }            else {                remainderR <- ShortReadQ()            }            fqF <- fqF[idsF %in% idsR]            fqR <- fqR[idsR %in% idsF]        }        if (!is.null(primer.fwd)) {            barlen <- nchar(primer.fwd)            keepF <- narrow(sread(fqF), 1, barlen) == primer.fwd            keepR <- (narrow(sread(fqR), 1, barlen) == primer.fwd) &                 !keepF            fq <- ShortReadQ(sread = c(sread(fqF[keepF]), sread(fqR[keepR])),                 quality = c(quality(quality(fqF[keepF])), quality(quality(fqR[keepR]))),                 id = c(id(fqF[keepF]), id(fqR[keepR])))            fqR <- ShortReadQ(sread = c(sread(fqR[keepF]), sread(fqF[keepR])),                 quality = c(quality(quality(fqR[keepF])), quality(quality(fqF[keepR]))),                 id = c(id(fqR[keepF]), id(fqF[keepR])))            fqF <- fq            rm(fq)        }        if (is.finite(maxLen[[1]]) || is.finite(maxLen[[2]])) {            keep <- width(fqF) <= maxLen[[1]] & width(fqR) <=                 maxLen[[2]]            fqF <- fqF[keep]            fqR <- fqR[keep]        }        keep <- (width(fqF) >= startF & width(fqR) >= startR)        fqF <- fqF[keep]        fqF <- narrow(fqF, start = startF, end = NA)        fqR <- fqR[keep]        fqR <- narrow(fqR, start = startR, end = NA)        encF <- encoding(quality(fqF))        encR <- encoding(quality(fqR))        if (is.numeric(truncQ)) {            indF <- which(encF == truncQ[[1]])            indR <- which(encR == truncQ[[2]])            if (!(length(indF) == 1 && length(indR) == 1))                 stop("Encoding for this truncQ value not found.")            truncQ <- c(names(encF)[[indF]], names(encR)[[indR]])        }        if (length(fqF) > 0) {            rngF <- trimTails(fqF, 1, truncQ[[1]], ranges = TRUE)            fqF <- narrow(fqF, 1, end(rngF))        }        if (length(fqR) > 0) {            rngR <- trimTails(fqR, 1, truncQ[[2]], ranges = TRUE)            fqR <- narrow(fqR, 1, end(rngR))        }        truncQ <- c(encF[truncQ[1]], encR[truncQ[2]])        keep <- (width(fqF) > 0 & width(fqR) > 0)        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        if (!is.na(endF)) {            keep <- keep & (width(fqF) >= endF)        }        if (!is.na(endR)) {            keep <- keep & (width(fqR) >= endR)        }        fqF <- fqF[keep]        fqR <- fqR[keep]        fqF <- narrow(fqF, start = 1, end = endF)        fqR <- narrow(fqR, start = 1, end = endR)        keep <- width(fqF) >= minLen[[1]] & width(fqR) >= minLen[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        suppressWarnings(keep <- nFilter(maxN[[1]])(fqF) & nFilter(maxN[[2]])(fqR))        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        qmat <- as(quality(fqF), "matrix")        if (minQ[[1]] > truncQ[[1]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[1]]))        if (maxEE[[1]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[1]]        qmat <- as(quality(fqR), "matrix")        if (minQ[[2]] > truncQ[[2]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[2]]))        if (maxEE[[2]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        rm(qmat)        if (length(fqF) != length(fqR))             stop("Filtering caused mismatch between forward and reverse sequence lists: ",                 length(fqF), ", ", length(fqR), ".")        if (rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)            is.phi <- is.phi | isPhiX(as(sread(fqR), "character"),                 ...)        }        else if (rm.phix[[1]] && !rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)        }        else if (!rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqR), "character"), ...)        }        if (any(rm.phix)) {            fqF <- fqF[!is.phi]            fqR <- fqR[!is.phi]        }        outseqs <- outseqs + length(fqF)        if (first) {            writeFastq(fqF, fout[[1]], "w", compress = compress)            writeFastq(fqR, fout[[2]], "w", compress = compress)            first = FALSE        }        else {            writeFastq(fqF, fout[[1]], "a", compress = compress)            writeFastq(fqR, fout[[2]], "a", compress = compress)        }    }    if (outseqs == 0) {    }    if (verbose) {        outperc <- round(outseqs * 100/inseqs, 1)        outperc <- paste(" (", outperc, "%)", sep = "")        message("Read in ", inseqs, " paired-sequences, output ",             outseqs, outperc, " filtered paired-sequences.",             sep = "")    }    if (outseqs == 0) {        message(paste("The filter removed all reads:", fout[[1]],             "and", fout[[2]], "not written."))        file.remove(fout[[1]])        file.remove(fout[[2]])    }    return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = c(230L, 160L), trimLeft = c(2L, 2L), maxLen = Inf, minLen = 20, maxN = 0,     minQ = 0, maxEE = 2, rm.phix = TRUE, primer.fwd = NULL, matchIDs = FALSE,     id.sep = "\\s", id.field = 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        msg <- conditionMessage(e)        sm <- strsplit(msg, "\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 && identical(getOption("show.error.messages"),         TRUE)) {        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)
21: mcmapply(fastqPairedFilter, mapply(c, fwd, rev, SIMPLIFY = FALSE),     mapply(c, filt, filt.rev, SIMPLIFY = FALSE), MoreArgs = list(truncQ = truncQ,         truncLen = truncLen, trimLeft = trimLeft, maxLen = maxLen,         minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE,         rm.phix = rm.phix, primer.fwd = primer.fwd, matchIDs = matchIDs,         id.sep = id.sep, id.field = id.field, n = n, OMP = OMP,         compress = compress, verbose = verbose), mc.cores = ncores,     mc.silent = TRUE)
22: filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF,     truncLenR), trimLeft = c(trimLeftF, trimLeftR), maxEE = maxEE,     truncQ = truncQ, rm.phix = TRUE, multithread = multithread)
23: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
24: suppressWarnings(filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR,     truncLen = c(truncLenF, truncLenR), trimLeft = c(trimLeftF,         trimLeftR), maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE,     multithread = multithread))
An irrecoverable exception occurred. R is aborting now ...

Traceback:
 1: readBin(con, raw(), n)
 2: reader(con, readerBlockSize)
 3: x$yield(...)
 4: yield(fF)
 5: yield(fF)
 6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
 7: suppressWarnings(fqF <- yield(fF))
 8: (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0,     0), maxLen = c(Inf, Inf), minLen = c(20, 20), trimLeft = c(0,     0), minQ = c(0, 0), maxEE = c(Inf, Inf), rm.phix = c(TRUE,     TRUE), matchIDs = FALSE, primer.fwd = NULL, id.sep = "\\s",     id.field = 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))    }    if (!is.character(fn) || length(fn) != 2)         stop("Two paired input file names required.")    if (!is.character(fout) || length(fout) != 2)         stop("Two paired output file names required.")    if (any(duplicated(c(fn, fout)))) {        stop("The output and input file names must be different.")    }    for (var in c("maxN", "truncQ", "truncLen", "maxLen", "minLen",         "trimLeft", "minQ", "maxEE", "rm.phix")) {        if (length(get(var)) == 1) {            assign(var, c(get(var), get(var)))        }        if (length(get(var)) != 2) {            stop(paste("Input variable", var, "must be length 1 or 2 (Forward, Reverse)."))        }    }    startF <- max(1, trimLeft[[1]] + 1, na.rm = TRUE)    startR <- max(1, trimLeft[[2]] + 1, na.rm = TRUE)    endF <- truncLen[[1]]    if (endF < startF) {        endF = NA    }    endF <- endF - startF + 1    endR <- truncLen[[2]]    if (endR < startR) {        endR = NA    }    endR <- endR - startR + 1    fF <- FastqStreamer(fn[[1]], n = n)    on.exit(close(fF))    fR <- FastqStreamer(fn[[2]], n = n)    on.exit(close(fR), add = TRUE)    if (file.exists(fout[[1]])) {        if (file.remove(fout[[1]])) {            if (verbose)                 message("Overwriting file:", fout[[1]])        }        else {            stop("Failed to overwrite file:", fout[[1]])        }    }    if (file.exists(fout[[2]])) {        if (file.remove(fout[[2]])) {            if (verbose)                 message("Overwriting file:", fout[[2]])        }        else {            stop("Failed to overwrite file:", fout[[2]])        }    }    first = TRUE    remainderF <- ShortReadQ()    remainderR <- ShortReadQ()    casava <- "Undetermined"    inseqs = 0    outseqs = 0    while (TRUE) {        suppressWarnings(fqF <- yield(fF))        suppressWarnings(fqR <- yield(fR))        if (length(fqF) == 0 && length(fqR) == 0) {            break        }        inseqs <- inseqs + length(fqF)        if (matchIDs) {            if (first) {                if (is.null(id.field)) {                  id1 <- as.character(id(fqF)[[1]])                  id.fields <- strsplit(id1, id.sep)[[1]]                  ncolon <- sapply(gregexpr(":", id.fields),                     length)                  ncoltab <- table(ncolon)                  if (max(ncolon) == 6 && ncoltab["6"] == 1) {                    casava <- "Current"                    id.field <- which(ncolon == 6)                  }                  else if (max(ncolon) == 4 && ncoltab["4"] ==                     1) {                    casava <- "Old"                    id.field <- which(ncolon == 4)                  }                  else {                    stop("Couldn't automatically detect the sequence identifier field in the fastq id string.")                  }                }            }            else {                fqF <- append(remainderF, fqF)                fqR <- append(remainderR, fqR)            }        }        else {            if (length(fqF) != length(fqR))                 stop("Mismatched forward and reverse sequence files: ",                   length(fqF), ", ", length(fqR), ".")        }        if (matchIDs) {            idsF <- sapply(strsplit(as.character(id(fqF)), id.sep),                 `[`, id.field)            idsR <- sapply(strsplit(as.character(id(fqR)), id.sep),                 `[`, id.field)            if (casava == "Old") {                idsF <- sapply(strsplit(idsF, "#"), `[`, 1)            }            lastF <- max(c(0, which(idsF %in% idsR)))            lastR <- max(c(0, which(idsR %in% idsF)))            if (lastF < length(fqF)) {                remainderF <- fqF[(lastF + 1):length(fqF)]            }            else {                remainderF <- ShortReadQ()            }            if (lastR < length(fqR)) {                remainderR <- fqR[(lastR + 1):length(fqR)]            }            else {                remainderR <- ShortReadQ()            }            fqF <- fqF[idsF %in% idsR]            fqR <- fqR[idsR %in% idsF]        }        if (!is.null(primer.fwd)) {            barlen <- nchar(primer.fwd)            keepF <- narrow(sread(fqF), 1, barlen) == primer.fwd            keepR <- (narrow(sread(fqR), 1, barlen) == primer.fwd) &                 !keepF            fq <- ShortReadQ(sread = c(sread(fqF[keepF]), sread(fqR[keepR])),                 quality = c(quality(quality(fqF[keepF])), quality(quality(fqR[keepR]))),                 id = c(id(fqF[keepF]), id(fqR[keepR])))            fqR <- ShortReadQ(sread = c(sread(fqR[keepF]), sread(fqF[keepR])),                 quality = c(quality(quality(fqR[keepF])), quality(quality(fqF[keepR]))),                 id = c(id(fqR[keepF]), id(fqF[keepR])))            fqF <- fq            rm(fq)        }        if (is.finite(maxLen[[1]]) || is.finite(maxLen[[2]])) {            keep <- width(fqF) <= maxLen[[1]] & width(fqR) <=                 maxLen[[2]]            fqF <- fqF[keep]            fqR <- fqR[keep]        }        keep <- (width(fqF) >= startF & width(fqR) >= startR)        fqF <- fqF[keep]        fqF <- narrow(fqF, start = startF, end = NA)        fqR <- fqR[keep]        fqR <- narrow(fqR, start = startR, end = NA)        encF <- encoding(quality(fqF))        encR <- encoding(quality(fqR))        if (is.numeric(truncQ)) {            indF <- which(encF == truncQ[[1]])            indR <- which(encR == truncQ[[2]])            if (!(length(indF) == 1 && length(indR) == 1))                 stop("Encoding for this truncQ value not found.")            truncQ <- c(names(encF)[[indF]], names(encR)[[indR]])        }        if (length(fqF) > 0) {            rngF <- trimTails(fqF, 1, truncQ[[1]], ranges = TRUE)            fqF <- narrow(fqF, 1, end(rngF))        }        if (length(fqR) > 0) {            rngR <- trimTails(fqR, 1, truncQ[[2]], ranges = TRUE)            fqR <- narrow(fqR, 1, end(rngR))        }        truncQ <- c(encF[truncQ[1]], encR[truncQ[2]])        keep <- (width(fqF) > 0 & width(fqR) > 0)        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        if (!is.na(endF)) {            keep <- keep & (width(fqF) >= endF)        }        if (!is.na(endR)) {            keep <- keep & (width(fqR) >= endR)        }        fqF <- fqF[keep]        fqR <- fqR[keep]        fqF <- narrow(fqF, start = 1, end = endF)        fqR <- narrow(fqR, start = 1, end = endR)        keep <- width(fqF) >= minLen[[1]] & width(fqR) >= minLen[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        suppressWarnings(keep <- nFilter(maxN[[1]])(fqF) & nFilter(maxN[[2]])(fqR))        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        qmat <- as(quality(fqF), "matrix")        if (minQ[[1]] > truncQ[[1]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[1]]))        if (maxEE[[1]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[1]]        qmat <- as(quality(fqR), "matrix")        if (minQ[[2]] > truncQ[[2]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[2]]))        if (maxEE[[2]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        rm(qmat)        if (length(fqF) != length(fqR))             stop("Filtering caused mismatch between forward and reverse sequence lists: ",                 length(fqF), ", ", length(fqR), ".")        if (rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)            is.phi <- is.phi | isPhiX(as(sread(fqR), "character"),                 ...)        }        else if (rm.phix[[1]] && !rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)        }        else if (!rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqR), "character"), ...)        }        if (any(rm.phix)) {            fqF <- fqF[!is.phi]            fqR <- fqR[!is.phi]        }        outseqs <- outseqs + length(fqF)        if (first) {            writeFastq(fqF, fout[[1]], "w", compress = compress)            writeFastq(fqR, fout[[2]], "w", compress = compress)            first = FALSE        }        else {            writeFastq(fqF, fout[[1]], "a", compress = compress)            writeFastq(fqR, fout[[2]], "a", compress = compress)        }    }    if (outseqs == 0) {    }    if (verbose) {        outperc <- round(outseqs * 100/inseqs, 1)        outperc <- paste(" (", outperc, "%)", sep = "")        message("Read in ", inseqs, " paired-sequences, output ",             outseqs, outperc, " filtered paired-sequences.",             sep = "")    }    if (outseqs == 0) {        message(paste("The filter removed all reads:", fout[[1]],             "and", fout[[2]], "not written."))        file.remove(fout[[1]])        file.remove(fout[[2]])    }    return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = c(230L, 160L), trimLeft = c(2L, 2L), maxLen = Inf, minLen = 20, maxN = 0,     minQ = 0, maxEE = 2, rm.phix = TRUE, primer.fwd = NULL, matchIDs = FALSE,     id.sep = "\\s", id.field = 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        msg <- conditionMessage(e)        sm <- strsplit(msg, "\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 && identical(getOption("show.error.messages"),         TRUE)) {        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)
21: mcmapply(fastqPairedFilter, mapply(c, fwd, rev, SIMPLIFY = FALSE),     mapply(c, filt, filt.rev, SIMPLIFY = FALSE), MoreArgs = list(truncQ = truncQ,         truncLen = truncLen, trimLeft = trimLeft, maxLen = maxLen,         minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE,         rm.phix = rm.phix, primer.fwd = primer.fwd, matchIDs = matchIDs,         id.sep = id.sep, id.field = id.field, n = n, OMP = OMP,         compress = compress, verbose = verbose), mc.cores = ncores,     mc.silent = TRUE)
22: filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF,     truncLenR), trimLeft = c(trimLeftF, trimLeftR), maxEE = maxEE,     truncQ = truncQ, rm.phix = TRUE, multithread = multithread)
23: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
24: suppressWarnings(filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR,     truncLen = c(truncLenF, truncLenR), trimLeft = c(trimLeftF,         trimLeftR), maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE,     multithread = multithread))
An irrecoverable exception occurred. R is aborting now ...

Traceback:
 1: readBin(con, raw(), n)
 2: reader(con, readerBlockSize)
 3: x$yield(...)
 4: yield(fF)
 5: yield(fF)
 6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
 7: suppressWarnings(fqF <- yield(fF))
 8: (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0,     0), maxLen = c(Inf, Inf), minLen = c(20, 20), trimLeft = c(0,     0), minQ = c(0, 0), maxEE = c(Inf, Inf), rm.phix = c(TRUE,     TRUE), matchIDs = FALSE, primer.fwd = NULL, id.sep = "\\s",     id.field = 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))    }    if (!is.character(fn) || length(fn) != 2)         stop("Two paired input file names required.")    if (!is.character(fout) || length(fout) != 2)         stop("Two paired output file names required.")    if (any(duplicated(c(fn, fout)))) {        stop("The output and input file names must be different.")    }    for (var in c("maxN", "truncQ", "truncLen", "maxLen", "minLen",         "trimLeft", "minQ", "maxEE", "rm.phix")) {        if (length(get(var)) == 1) {            assign(var, c(get(var), get(var)))        }        if (length(get(var)) != 2) {            stop(paste("Input variable", var, "must be length 1 or 2 (Forward, Reverse)."))        }    }    startF <- max(1, trimLeft[[1]] + 1, na.rm = TRUE)    startR <- max(1, trimLeft[[2]] + 1, na.rm = TRUE)    endF <- truncLen[[1]]    if (endF < startF) {        endF = NA    }    endF <- endF - startF + 1    endR <- truncLen[[2]]    if (endR < startR) {        endR = NA    }    endR <- endR - startR + 1    fF <- FastqStreamer(fn[[1]], n = n)    on.exit(close(fF))    fR <- FastqStreamer(fn[[2]], n = n)    on.exit(close(fR), add = TRUE)    if (file.exists(fout[[1]])) {        if (file.remove(fout[[1]])) {            if (verbose)                 message("Overwriting file:", fout[[1]])        }        else {            stop("Failed to overwrite file:", fout[[1]])        }    }    if (file.exists(fout[[2]])) {        if (file.remove(fout[[2]])) {            if (verbose)                 message("Overwriting file:", fout[[2]])        }        else {            stop("Failed to overwrite file:", fout[[2]])        }    }    first = TRUE    remainderF <- ShortReadQ()    remainderR <- ShortReadQ()    casava <- "Undetermined"    inseqs = 0    outseqs = 0    while (TRUE) {        suppressWarnings(fqF <- yield(fF))        suppressWarnings(fqR <- yield(fR))        if (length(fqF) == 0 && length(fqR) == 0) {            break        }        inseqs <- inseqs + length(fqF)        if (matchIDs) {            if (first) {                if (is.null(id.field)) {                  id1 <- as.character(id(fqF)[[1]])                  id.fields <- strsplit(id1, id.sep)[[1]]                  ncolon <- sapply(gregexpr(":", id.fields),                     length)                  ncoltab <- table(ncolon)                  if (max(ncolon) == 6 && ncoltab["6"] == 1) {                    casava <- "Current"                    id.field <- which(ncolon == 6)                  }                  else if (max(ncolon) == 4 && ncoltab["4"] ==                     1) {                    casava <- "Old"                    id.field <- which(ncolon == 4)                  }                  else {                    stop("Couldn't automatically detect the sequence identifier field in the fastq id string.")                  }                }            }            else {                fqF <- append(remainderF, fqF)                fqR <- append(remainderR, fqR)            }        }        else {            if (length(fqF) != length(fqR))                 stop("Mismatched forward and reverse sequence files: ",                   length(fqF), ", ", length(fqR), ".")        }        if (matchIDs) {            idsF <- sapply(strsplit(as.character(id(fqF)), id.sep),                 `[`, id.field)            idsR <- sapply(strsplit(as.character(id(fqR)), id.sep),                 `[`, id.field)            if (casava == "Old") {                idsF <- sapply(strsplit(idsF, "#"), `[`, 1)            }            lastF <- max(c(0, which(idsF %in% idsR)))            lastR <- max(c(0, which(idsR %in% idsF)))            if (lastF < length(fqF)) {                remainderF <- fqF[(lastF + 1):length(fqF)]            }            else {                remainderF <- ShortReadQ()            }            if (lastR < length(fqR)) {                remainderR <- fqR[(lastR + 1):length(fqR)]            }            else {                remainderR <- ShortReadQ()            }            fqF <- fqF[idsF %in% idsR]            fqR <- fqR[idsR %in% idsF]        }        if (!is.null(primer.fwd)) {            barlen <- nchar(primer.fwd)            keepF <- narrow(sread(fqF), 1, barlen) == primer.fwd            keepR <- (narrow(sread(fqR), 1, barlen) == primer.fwd) &                 !keepF            fq <- ShortReadQ(sread = c(sread(fqF[keepF]), sread(fqR[keepR])),                 quality = c(quality(quality(fqF[keepF])), quality(quality(fqR[keepR]))),                 id = c(id(fqF[keepF]), id(fqR[keepR])))            fqR <- ShortReadQ(sread = c(sread(fqR[keepF]), sread(fqF[keepR])),                 quality = c(quality(quality(fqR[keepF])), quality(quality(fqF[keepR]))),                 id = c(id(fqR[keepF]), id(fqF[keepR])))            fqF <- fq            rm(fq)        }        if (is.finite(maxLen[[1]]) || is.finite(maxLen[[2]])) {            keep <- width(fqF) <= maxLen[[1]] & width(fqR) <=                 maxLen[[2]]            fqF <- fqF[keep]            fqR <- fqR[keep]        }        keep <- (width(fqF) >= startF & width(fqR) >= startR)        fqF <- fqF[keep]        fqF <- narrow(fqF, start = startF, end = NA)        fqR <- fqR[keep]        fqR <- narrow(fqR, start = startR, end = NA)        encF <- encoding(quality(fqF))        encR <- encoding(quality(fqR))        if (is.numeric(truncQ)) {            indF <- which(encF == truncQ[[1]])            indR <- which(encR == truncQ[[2]])            if (!(length(indF) == 1 && length(indR) == 1))                 stop("Encoding for this truncQ value not found.")            truncQ <- c(names(encF)[[indF]], names(encR)[[indR]])        }        if (length(fqF) > 0) {            rngF <- trimTails(fqF, 1, truncQ[[1]], ranges = TRUE)            fqF <- narrow(fqF, 1, end(rngF))        }        if (length(fqR) > 0) {            rngR <- trimTails(fqR, 1, truncQ[[2]], ranges = TRUE)            fqR <- narrow(fqR, 1, end(rngR))        }        truncQ <- c(encF[truncQ[1]], encR[truncQ[2]])        keep <- (width(fqF) > 0 & width(fqR) > 0)        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        if (!is.na(endF)) {            keep <- keep & (width(fqF) >= endF)        }        if (!is.na(endR)) {            keep <- keep & (width(fqR) >= endR)        }        fqF <- fqF[keep]        fqR <- fqR[keep]        fqF <- narrow(fqF, start = 1, end = endF)        fqR <- narrow(fqR, start = 1, end = endR)        keep <- width(fqF) >= minLen[[1]] & width(fqR) >= minLen[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        suppressWarnings(keep <- nFilter(maxN[[1]])(fqF) & nFilter(maxN[[2]])(fqR))        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        qmat <- as(quality(fqF), "matrix")        if (minQ[[1]] > truncQ[[1]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[1]]))        if (maxEE[[1]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[1]]        qmat <- as(quality(fqR), "matrix")        if (minQ[[2]] > truncQ[[2]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[2]]))        if (maxEE[[2]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        rm(qmat)        if (length(fqF) != length(fqR))             stop("Filtering caused mismatch between forward and reverse sequence lists: ",                 length(fqF), ", ", length(fqR), ".")        if (rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)            is.phi <- is.phi | isPhiX(as(sread(fqR), "character"),                 ...)        }        else if (rm.phix[[1]] && !rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)        }        else if (!rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqR), "character"), ...)        }        if (any(rm.phix)) {            fqF <- fqF[!is.phi]            fqR <- fqR[!is.phi]        }        outseqs <- outseqs + length(fqF)        if (first) {            writeFastq(fqF, fout[[1]], "w", compress = compress)            writeFastq(fqR, fout[[2]], "w", compress = compress)            first = FALSE        }        else {            writeFastq(fqF, fout[[1]], "a", compress = compress)            writeFastq(fqR, fout[[2]], "a", compress = compress)        }    }    if (outseqs == 0) {    }    if (verbose) {        outperc <- round(outseqs * 100/inseqs, 1)        outperc <- paste(" (", outperc, "%)", sep = "")        message("Read in ", inseqs, " paired-sequences, output ",             outseqs, outperc, " filtered paired-sequences.",             sep = "")    }    if (outseqs == 0) {        message(paste("The filter removed all reads:", fout[[1]],             "and", fout[[2]], "not written."))        file.remove(fout[[1]])        file.remove(fout[[2]])    }    return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = c(230L, 160L), trimLeft = c(2L, 2L), maxLen = Inf, minLen = 20, maxN = 0,     minQ = 0, maxEE = 2, rm.phix = TRUE, primer.fwd = NULL, matchIDs = FALSE,     id.sep = "\\s", id.field = 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        msg <- conditionMessage(e)        sm <- strsplit(msg, "\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 && identical(getOption("show.error.messages"),         TRUE)) {        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)
21: mcmapply(fastqPairedFilter, mapply(c, fwd, rev, SIMPLIFY = FALSE),     mapply(c, filt, filt.rev, SIMPLIFY = FALSE), MoreArgs = list(truncQ = truncQ,         truncLen = truncLen, trimLeft = trimLeft, maxLen = maxLen,         minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE,         rm.phix = rm.phix, primer.fwd = primer.fwd, matchIDs = matchIDs,         id.sep = id.sep, id.field = id.field, n = n, OMP = OMP,         compress = compress, verbose = verbose), mc.cores = ncores,     mc.silent = TRUE)
22: filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF,     truncLenR), trimLeft = c(trimLeftF, trimLeftR), maxEE = maxEE,     truncQ = truncQ, rm.phix = TRUE, multithread = multithread)
23: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
24: suppressWarnings(filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR,     truncLen = c(truncLenF, truncLenR), trimLeft = c(trimLeftF,         trimLeftR), maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE,     multithread = multithread))
An irrecoverable exception occurred. R is aborting now ...

 *** caught bus error ***

 *** caught segfault ***
address 0x2ac83afdfb2b, cause 'non-existent physical address'
address (nil), cause 'unknown'

Traceback:
 1: readBin(con, raw(), n)
 2: reader(con, readerBlockSize)
 3: x$yield(...)
 4: yield(fF)
 5: yield(fF)
 6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
 7: suppressWarnings(fqF <- yield(fF))
 8: (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0,     0), maxLen = c(Inf, Inf), minLen = c(20, 20), trimLeft = c(0,     0), minQ = c(0, 0), maxEE = c(Inf, Inf), rm.phix = c(TRUE,     TRUE), matchIDs = FALSE, primer.fwd = NULL, id.sep = "\\s",     id.field = 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))    }    if (!is.character(fn) || length(fn) != 2)         stop("Two paired input file names required.")    if (!is.character(fout) || length(fout) != 2)         stop("Two paired output file names required.")    if (any(duplicated(c(fn, fout)))) {        stop("The output and input file names must be different.")    }    for (var in c("maxN", "truncQ", "truncLen", "maxLen", "minLen",         "trimLeft", "minQ", "maxEE", "rm.phix")) {        if (length(get(var)) == 1) {            assign(var, c(get(var), get(var)))        }        if (length(get(var)) != 2) {            stop(paste("Input variable", var, "must be length 1 or 2 (Forward, Reverse)."))        }    }    startF <- max(1, trimLeft[[1]] + 1, na.rm = TRUE)    startR <- max(1, trimLeft[[2]] + 1, na.rm = TRUE)    endF <- truncLen[[1]]    if (endF < startF) {        endF = NA    }    endF <- endF - startF + 1    endR <- truncLen[[2]]    if (endR < startR) {        endR = NA    }    endR <- endR - startR + 1    fF <- FastqStreamer(fn[[1]], n = n)    on.exit(close(fF))    fR <- FastqStreamer(fn[[2]], n = n)    on.exit(close(fR), add = TRUE)    if (file.exists(fout[[1]])) {        if (file.remove(fout[[1]])) {            if (verbose)                 message("Overwriting file:", fout[[1]])        }        else {            stop("Failed to overwrite file:", fout[[1]])        }    }    if (file.exists(fout[[2]])) {        if (file.remove(fout[[2]])) {            if (verbose)                 message("Overwriting file:", fout[[2]])        }        else {            stop("Failed to overwrite file:", fout[[2]])        }    }    first = TRUE    remainderF <- ShortReadQ()    remainderR <- ShortReadQ()    casava <- "Undetermined"    inseqs = 0    outseqs = 0    while (TRUE) {        suppressWarnings(fqF <- yield(fF))        suppressWarnings(fqR <- yield(fR))        if (length(fqF) == 0 && length(fqR) == 0) {            break        }        inseqs <- inseqs + length(fqF)        if (matchIDs) {            if (first) {                if (is.null(id.field)) {                  id1 <- as.character(id(fqF)[[1]])                  id.fields <- strsplit(id1, id.sep)[[1]]                  ncolon <- sapply(gregexpr(":", id.fields),                     length)                  ncoltab <- table(ncolon)                  if (max(ncolon) == 6 && ncoltab["6"] == 1) {                    casava <- "Current"                    id.field <- which(ncolon == 6)                  }                  else if (max(ncolon) == 4 && ncoltab["4"] ==                     1) {                    casava <- "Old"                    id.field <- which(ncolon == 4)                  }                  else {                    stop("Couldn't automatically detect the sequence identifier field in the fastq id string.")                  }                }            }            else {                fqF <- append(remainderF, fqF)                fqR <- append(remainderR, fqR)            }        }        else {            if (length(fqF) != length(fqR))                 stop("Mismatched forward and reverse sequence files: ",                   length(fqF), ", ", length(fqR), ".")        }        if (matchIDs) {            idsF <- sapply(strsplit(as.character(id(fqF)), id.sep),                 `[`, id.field)            idsR <- sapply(strsplit(as.character(id(fqR)), id.sep),                 `[`, id.field)            if (casava == "Old") {                idsF <- sapply(strsplit(idsF, "#"), `[`, 1)            }            lastF <- max(c(0, which(idsF %in% idsR)))            lastR <- max(c(0, which(idsR %in% idsF)))            if (lastF < length(fqF)) {                remainderF <- fqF[(lastF + 1):length(fqF)]            }            else {                remainderF <- ShortReadQ()            }            if (lastR < length(fqR)) {                remainderR <- fqR[(lastR + 1):length(fqR)]            }            else {                remainderR <- ShortReadQ()            }            fqF <- fqF[idsF %in% idsR]            fqR <- fqR[idsR %in% idsF]        }        if (!is.null(primer.fwd)) {            barlen <- nchar(primer.fwd)            keepF <- narrow(sread(fqF), 1, barlen) == primer.fwd            keepR <- (narrow(sread(fqR), 1, barlen) == primer.fwd) &                 !keepF            fq <- ShortReadQ(sread = c(sread(fqF[keepF]), sread(fqR[keepR])),                 quality = c(quality(quality(fqF[keepF])), quality(quality(fqR[keepR]))),                 id = c(id(fqF[keepF]), id(fqR[keepR])))            fqR <- ShortReadQ(sread = c(sread(fqR[keepF]), sread(fqF[keepR])),                 quality = c(quality(quality(fqR[keepF])), quality(quality(fqF[keepR]))),                 id = c(id(fqR[keepF]), id(fqF[keepR])))            fqF <- fq            rm(fq)        }        if (is.finite(maxLen[[1]]) || is.finite(maxLen[[2]])) {            keep <- width(fqF) <= maxLen[[1]] & width(fqR) <=                 maxLen[[2]]            fqF <- fqF[keep]            fqR <- fqR[keep]        }        keep <- (width(fqF) >= startF & width(fqR) >= startR)        fqF <- fqF[keep]        fqF <- narrow(fqF, start = startF, end = NA)        fqR <- fqR[keep]        fqR <- narrow(fqR, start = startR, end = NA)        encF <- encoding(quality(fqF))        encR <- encoding(quality(fqR))        if (is.numeric(truncQ)) {            indF <- which(encF == truncQ[[1]])            indR <- which(encR == truncQ[[2]])            if (!(length(indF) == 1 && length(indR) == 1))                 stop("Encoding for this truncQ value not found.")            truncQ <- c(names(encF)[[indF]], names(encR)[[indR]])        }        if (length(fqF) > 0) {            rngF <- trimTails(fqF, 1, truncQ[[1]], ranges = TRUE)            fqF <- narrow(fqF, 1, end(rngF))        }        if (length(fqR) > 0) {            rngR <- trimTails(fqR, 1, truncQ[[2]], ranges = TRUE)            fqR <- narrow(fqR, 1, end(rngR))        }        truncQ <- c(encF[truncQ[1]], encR[truncQ[2]])        keep <- (width(fqF) > 0 & width(fqR) > 0)        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        if (!is.na(endF)) {            keep <- keep & (width(fqF) >= endF)        }        if (!is.na(endR)) {            keep <- keep & (width(fqR) >= endR)        }        fqF <- fqF[keep]        fqR <- fqR[keep]        fqF <- narrow(fqF, start = 1, end = endF)        fqR <- narrow(fqR, start = 1, end = endR)        keep <- width(fqF) >= minLen[[1]] & width(fqR) >= minLen[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        suppressWarnings(keep <- nFilter(maxN[[1]])(fqF) & nFilter(maxN[[2]])(fqR))        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        qmat <- as(quality(fqF), "matrix")        if (minQ[[1]] > truncQ[[1]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[1]]))        if (maxEE[[1]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[1]]        qmat <- as(quality(fqR), "matrix")        if (minQ[[2]] > truncQ[[2]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[2]]))        if (maxEE[[2]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        rm(qmat)        if (length(fqF) != length(fqR))             stop("Filtering caused mismatch between forward and reverse sequence lists: ",                 length(fqF), ", ", length(fqR), ".")        if (rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)            is.phi <- is.phi | isPhiX(as(sread(fqR), "character"),                 ...)        }        else if (rm.phix[[1]] && !rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)        }        else if (!rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqR), "character"), ...)        }        if (any(rm.phix)) {            fqF <- fqF[!is.phi]            fqR <- fqR[!is.phi]        }        outseqs <- outseqs + length(fqF)        if (first) {            writeFastq(fqF, fout[[1]], "w", compress = compress)            writeFastq(fqR, fout[[2]], "w", compress = compress)            first = FALSE        }        else {            writeFastq(fqF, fout[[1]], "a", compress = compress)            writeFastq(fqR, fout[[2]], "a", compress = compress)        }    }    if (outseqs == 0) {    }    if (verbose) {        outperc <- round(outseqs * 100/inseqs, 1)        outperc <- paste(" (", outperc, "%)", sep = "")        message("Read in ", inseqs, " paired-sequences, output ",             outseqs, outperc, " filtered paired-sequences.",             sep = "")    }    if (outseqs == 0) {        message(paste("The filter removed all reads:", fout[[1]],             "and", fout[[2]], "not written."))        file.remove(fout[[1]])        file.remove(fout[[2]])    }    return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = c(230L, 160L), trimLeft = c(2L, 2L), maxLen = Inf, minLen = 20, maxN = 0,     minQ = 0, maxEE = 2, rm.phix = TRUE, primer.fwd = NULL, matchIDs = FALSE,     id.sep = "\\s", id.field = 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        msg <- conditionMessage(e)        sm <- strsplit(msg, "\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 && identical(getOption("show.error.messages"),         TRUE)) {        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)
21: mcmapply(fastqPairedFilter, mapply(c, fwd, rev, SIMPLIFY = FALSE),     mapply(c, filt, filt.rev, SIMPLIFY = FALSE), MoreArgs = list(truncQ = truncQ,         truncLen = truncLen, trimLeft = trimLeft, maxLen = maxLen,         minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE,         rm.phix = rm.phix, primer.fwd = primer.fwd, matchIDs = matchIDs,         id.sep = id.sep, id.field = id.field, n = n, OMP = OMP,         compress = compress, verbose = verbose), mc.cores = ncores,     mc.silent = TRUE)
22: filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF,     truncLenR), trimLeft = c(trimLeftF, trimLeftR), maxEE = maxEE,     truncQ = truncQ, rm.phix = TRUE, multithread = multithread)
23: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
24: suppressWarnings(filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR,     truncLen = c(truncLenF, truncLenR), trimLeft = c(trimLeftF,         trimLeftR), maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE,     multithread = multithread))
An irrecoverable exception occurred. R is aborting now ...

Traceback:
 1: readBin(con, raw(), n)
 2: reader(con, readerBlockSize)
 3: x$yield(...)
 4: yield(fF)
 5: yield(fF)
 6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
 7: suppressWarnings(fqF <- yield(fF))
 8: (function (fn, fout, maxN = c(0, 0), truncQ = c(2, 2), truncLen = c(0,     0), maxLen = c(Inf, Inf), minLen = c(20, 20), trimLeft = c(0,     0), minQ = c(0, 0), maxEE = c(Inf, Inf), rm.phix = c(TRUE,     TRUE), matchIDs = FALSE, primer.fwd = NULL, id.sep = "\\s",     id.field = 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))    }    if (!is.character(fn) || length(fn) != 2)         stop("Two paired input file names required.")    if (!is.character(fout) || length(fout) != 2)         stop("Two paired output file names required.")    if (any(duplicated(c(fn, fout)))) {        stop("The output and input file names must be different.")    }    for (var in c("maxN", "truncQ", "truncLen", "maxLen", "minLen",         "trimLeft", "minQ", "maxEE", "rm.phix")) {        if (length(get(var)) == 1) {            assign(var, c(get(var), get(var)))        }        if (length(get(var)) != 2) {            stop(paste("Input variable", var, "must be length 1 or 2 (Forward, Reverse)."))        }    }    startF <- max(1, trimLeft[[1]] + 1, na.rm = TRUE)    startR <- max(1, trimLeft[[2]] + 1, na.rm = TRUE)    endF <- truncLen[[1]]    if (endF < startF) {        endF = NA    }    endF <- endF - startF + 1    endR <- truncLen[[2]]    if (endR < startR) {        endR = NA    }    endR <- endR - startR + 1    fF <- FastqStreamer(fn[[1]], n = n)    on.exit(close(fF))    fR <- FastqStreamer(fn[[2]], n = n)    on.exit(close(fR), add = TRUE)    if (file.exists(fout[[1]])) {        if (file.remove(fout[[1]])) {            if (verbose)                 message("Overwriting file:", fout[[1]])        }        else {            stop("Failed to overwrite file:", fout[[1]])        }    }    if (file.exists(fout[[2]])) {        if (file.remove(fout[[2]])) {            if (verbose)                 message("Overwriting file:", fout[[2]])        }        else {            stop("Failed to overwrite file:", fout[[2]])        }    }    first = TRUE    remainderF <- ShortReadQ()    remainderR <- ShortReadQ()    casava <- "Undetermined"    inseqs = 0    outseqs = 0    while (TRUE) {        suppressWarnings(fqF <- yield(fF))        suppressWarnings(fqR <- yield(fR))        if (length(fqF) == 0 && length(fqR) == 0) {            break        }        inseqs <- inseqs + length(fqF)        if (matchIDs) {            if (first) {                if (is.null(id.field)) {                  id1 <- as.character(id(fqF)[[1]])                  id.fields <- strsplit(id1, id.sep)[[1]]                  ncolon <- sapply(gregexpr(":", id.fields),                     length)                  ncoltab <- table(ncolon)                  if (max(ncolon) == 6 && ncoltab["6"] == 1) {                    casava <- "Current"                    id.field <- which(ncolon == 6)                  }                  else if (max(ncolon) == 4 && ncoltab["4"] ==                     1) {                    casava <- "Old"                    id.field <- which(ncolon == 4)                  }                  else {                    stop("Couldn't automatically detect the sequence identifier field in the fastq id string.")                  }                }            }            else {                fqF <- append(remainderF, fqF)                fqR <- append(remainderR, fqR)            }        }        else {            if (length(fqF) != length(fqR))                 stop("Mismatched forward and reverse sequence files: ",                   length(fqF), ", ", length(fqR), ".")        }        if (matchIDs) {            idsF <- sapply(strsplit(as.character(id(fqF)), id.sep),                 `[`, id.field)            idsR <- sapply(strsplit(as.character(id(fqR)), id.sep),                 `[`, id.field)            if (casava == "Old") {                idsF <- sapply(strsplit(idsF, "#"), `[`, 1)            }            lastF <- max(c(0, which(idsF %in% idsR)))            lastR <- max(c(0, which(idsR %in% idsF)))            if (lastF < length(fqF)) {                remainderF <- fqF[(lastF + 1):length(fqF)]            }            else {                remainderF <- ShortReadQ()            }            if (lastR < length(fqR)) {                remainderR <- fqR[(lastR + 1):length(fqR)]            }            else {                remainderR <- ShortReadQ()            }            fqF <- fqF[idsF %in% idsR]            fqR <- fqR[idsR %in% idsF]        }        if (!is.null(primer.fwd)) {            barlen <- nchar(primer.fwd)            keepF <- narrow(sread(fqF), 1, barlen) == primer.fwd            keepR <- (narrow(sread(fqR), 1, barlen) == primer.fwd) &                 !keepF            fq <- ShortReadQ(sread = c(sread(fqF[keepF]), sread(fqR[keepR])),                 quality = c(quality(quality(fqF[keepF])), quality(quality(fqR[keepR]))),                 id = c(id(fqF[keepF]), id(fqR[keepR])))            fqR <- ShortReadQ(sread = c(sread(fqR[keepF]), sread(fqF[keepR])),                 quality = c(quality(quality(fqR[keepF])), quality(quality(fqF[keepR]))),                 id = c(id(fqR[keepF]), id(fqF[keepR])))            fqF <- fq            rm(fq)        }        if (is.finite(maxLen[[1]]) || is.finite(maxLen[[2]])) {            keep <- width(fqF) <= maxLen[[1]] & width(fqR) <=                 maxLen[[2]]            fqF <- fqF[keep]            fqR <- fqR[keep]        }        keep <- (width(fqF) >= startF & width(fqR) >= startR)        fqF <- fqF[keep]        fqF <- narrow(fqF, start = startF, end = NA)        fqR <- fqR[keep]        fqR <- narrow(fqR, start = startR, end = NA)        encF <- encoding(quality(fqF))        encR <- encoding(quality(fqR))        if (is.numeric(truncQ)) {            indF <- which(encF == truncQ[[1]])            indR <- which(encR == truncQ[[2]])            if (!(length(indF) == 1 && length(indR) == 1))                 stop("Encoding for this truncQ value not found.")            truncQ <- c(names(encF)[[indF]], names(encR)[[indR]])        }        if (length(fqF) > 0) {            rngF <- trimTails(fqF, 1, truncQ[[1]], ranges = TRUE)            fqF <- narrow(fqF, 1, end(rngF))        }        if (length(fqR) > 0) {            rngR <- trimTails(fqR, 1, truncQ[[2]], ranges = TRUE)            fqR <- narrow(fqR, 1, end(rngR))        }        truncQ <- c(encF[truncQ[1]], encR[truncQ[2]])        keep <- (width(fqF) > 0 & width(fqR) > 0)        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        if (!is.na(endF)) {            keep <- keep & (width(fqF) >= endF)        }        if (!is.na(endR)) {            keep <- keep & (width(fqR) >= endR)        }        fqF <- fqF[keep]        fqR <- fqR[keep]        fqF <- narrow(fqF, start = 1, end = endF)        fqR <- narrow(fqR, start = 1, end = endR)        keep <- width(fqF) >= minLen[[1]] & width(fqR) >= minLen[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        suppressWarnings(keep <- nFilter(maxN[[1]])(fqF) & nFilter(maxN[[2]])(fqR))        fqF <- fqF[keep]        fqR <- fqR[keep]        keep <- rep(TRUE, length(fqF))        qmat <- as(quality(fqF), "matrix")        if (minQ[[1]] > truncQ[[1]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[1]]))        if (maxEE[[1]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[1]]        qmat <- as(quality(fqR), "matrix")        if (minQ[[2]] > truncQ[[2]])             suppressWarnings(keep <- keep & (apply(qmat, 1, min) >                 minQ[[2]]))        if (maxEE[[2]] < Inf)             keep <- keep & C_matrixEE(qmat) <= maxEE[[2]]        fqF <- fqF[keep]        fqR <- fqR[keep]        rm(qmat)        if (length(fqF) != length(fqR))             stop("Filtering caused mismatch between forward and reverse sequence lists: ",                 length(fqF), ", ", length(fqR), ".")        if (rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)            is.phi <- is.phi | isPhiX(as(sread(fqR), "character"),                 ...)        }        else if (rm.phix[[1]] && !rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqF), "character"), ...)        }        else if (!rm.phix[[1]] && rm.phix[[2]]) {            is.phi <- isPhiX(as(sread(fqR), "character"), ...)        }        if (any(rm.phix)) {            fqF <- fqF[!is.phi]            fqR <- fqR[!is.phi]        }        outseqs <- outseqs + length(fqF)        if (first) {            writeFastq(fqF, fout[[1]], "w", compress = compress)            writeFastq(fqR, fout[[2]], "w", compress = compress)            first = FALSE        }        else {            writeFastq(fqF, fout[[1]], "a", compress = compress)            writeFastq(fqR, fout[[2]], "a", compress = compress)        }    }    if (outseqs == 0) {    }    if (verbose) {        outperc <- round(outseqs * 100/inseqs, 1)        outperc <- paste(" (", outperc, "%)", sep = "")        message("Read in ", inseqs, " paired-sequences, output ",             outseqs, outperc, " filtered paired-sequences.",             sep = "")    }    if (outseqs == 0) {        message(paste("The filter removed all reads:", fout[[1]],             "and", fout[[2]], "not written."))        file.remove(fout[[1]])        file.remove(fout[[2]])    }    return(invisible(c(reads.in = inseqs, reads.out = outseqs)))})(dots[[1L]][[1L]], dots[[2L]][[1L]], truncQ = 2L, truncLen = c(230L, 160L), trimLeft = c(2L, 2L), maxLen = Inf, minLen = 20, maxN = 0,     minQ = 0, maxEE = 2, rm.phix = TRUE, primer.fwd = NULL, matchIDs = FALSE,     id.sep = "\\s", id.field = 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        msg <- conditionMessage(e)        sm <- strsplit(msg, "\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 && identical(getOption("show.error.messages"),         TRUE)) {        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)
21: mcmapply(fastqPairedFilter, mapply(c, fwd, rev, SIMPLIFY = FALSE),     mapply(c, filt, filt.rev, SIMPLIFY = FALSE), MoreArgs = list(truncQ = truncQ,         truncLen = truncLen, trimLeft = trimLeft, maxLen = maxLen,         minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE,         rm.phix = rm.phix, primer.fwd = primer.fwd, matchIDs = matchIDs,         id.sep = id.sep, id.field = id.field, n = n, OMP = OMP,         compress = compress, verbose = verbose), mc.cores = ncores,     mc.silent = TRUE)
22: filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR, truncLen = c(truncLenF,     truncLenR), trimLeft = c(trimLeftF, trimLeftR), maxEE = maxEE,     truncQ = truncQ, rm.phix = TRUE, multithread = multithread)
23: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
24: suppressWarnings(filterAndTrim(unfiltsF, filtsF, unfiltsR, filtsR,     truncLen = c(truncLenF, truncLenR), trimLeft = c(trimLeftF,         trimLeftR), maxEE = maxEE, truncQ = truncQ, rm.phix = TRUE,     multithread = multithread))
An irrecoverable exception occurred. R is aborting now ...
Error in names(answer) <- names1 :
  'names' attribute [18] must be the same length as the vector [2]
Execution halted
Traceback (most recent call last):
  File "/bigdata/biklab/shared/pkgs/conda/qiime2-2018.8/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 229, in denoise_paired
    run_commands([cmd])
  File "/bigdata/biklab/shared/pkgs/conda/qiime2-2018.8/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
  File "/bigdata/biklab/shared/pkgs/conda/qiime2-2018.8/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmpy21dhbhp/forward', '/tmp/tmpy21dhbhp/reverse', '/tmp/tmpy21dhbhp/output.tsv.biom', '/tmp/tmpy21dhbhp/track.tsv', '/tmp/tmpy21dhbhp/filt_f', '/tmp/tmpy21dhbhp/filt_r', '230', '160', '2', '2', '2.0', '2', 'consensus', '1.0', '12', '1000000']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bigdata/biklab/shared/pkgs/conda/qiime2-2018.8/lib/python3.5/site-packages/q2cli/commands.py", line 274, in __call__
    results = action(**arguments)
  File "<decorator-gen-424>", line 2, in denoise_paired
  File "/bigdata/biklab/shared/pkgs/conda/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
    output_types, provenance)
  File "/bigdata/biklab/shared/pkgs/conda/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 362, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/bigdata/biklab/shared/pkgs/conda/qiime2-2018.8/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 244, in denoise_paired
    " and stderr to learn more." % e.returncode)
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.

Hi @tschuelke!

Yikes :grimacing:, there’s a few things this might be, and none of them particularly good…

  1. Something is up with your install (easy to fix, harder to diagnose). What does this command say if you run it in your QIIME 2 environment?

    R -e ".libPaths()"
    
  2. Something might be wrong with your hardware. Does this error happen consistently? If not, then we’re running into an issue somewhere between the process and the hardware. Last time we saw something like this, we weren’t able to reproduce it a second time, so our best guess was a malfunction of the RAM.

Another possibility, you ran out of disk space while a file was memory mapped…

What does:

df -h

say?

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