diff --git a/DESCRIPTION b/DESCRIPTION index 18a614b1..f7c8ec14 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Spectra Title: Spectra Infrastructure for Mass Spectrometry Data -Version: 1.13.2 +Version: 1.13.3 Description: The Spectra package defines an efficient infrastructure for storing and handling mass spectrometry spectra and functionality to subset, process, visualize and compare spectra data. It provides different diff --git a/NEWS.md b/NEWS.md index bd40e31c..1800f8ff 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,10 @@ # Spectra 1.13 +## Changes in 1.13.3 + +- Fix issue in `setBackend` that might cause chunk-wise processing to be not + run. + ## Changes in 1.13.2 - Add possibility to enable and perform chunk-wise (parallel) processing to diff --git a/R/Spectra.R b/R/Spectra.R index b1efc2a2..b3230ddb 100644 --- a/R/Spectra.R +++ b/R/Spectra.R @@ -1551,7 +1551,7 @@ setMethod( "setBackend", c("Spectra", "MsBackend"), function(object, backend, f = processingChunkFactor(object), ..., BPPARAM = bpparam()) { - backend_class <- class(object@backend) + backend_class <- class(object@backend)[1L] BPPARAM <- backendBpparam(object@backend, BPPARAM) BPPARAM <- backendBpparam(backend, BPPARAM) if (!supportsSetBackend(backend)) @@ -1562,7 +1562,7 @@ setMethod( } else { if (!is.factor(f)) f <- force(factor(f, levels = unique(f))) - if (length(f) && length(levels(f) > 1)) { + if (length(f) && (length(levels(f)) > 1)) { if (length(f) != length(object)) stop("length of 'f' has to match the length of 'object'") bknds <- bplapply(