diff --git a/DESCRIPTION b/DESCRIPTION index 77a7e59..7a03957 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: MsBackendRawFileReader Type: Package Title: Mass Spectrometry Backend for Reading Thermo Fisher Scientific raw Files -Version: 1.11.3 +Version: 1.11.6 Authors@R: c(person(given = "Christian", family = "Panse", email = "cp@fgcz.ethz.ch", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-1975-3064")), @@ -17,7 +17,7 @@ Imports: MsCoreUtils, S4Vectors, IRanges, - rawrr (>= 1.10.1), + rawrr (>= 1.13.1), utils, BiocParallel Suggests: diff --git a/R/MsBackendRawFileReader-functions.R b/R/MsBackendRawFileReader-functions.R index bd40b3d..0b6635d 100644 --- a/R/MsBackendRawFileReader-functions.R +++ b/R/MsBackendRawFileReader-functions.R @@ -74,7 +74,7 @@ NULL hdr_full <- .get_spectrum_metadata(x) hdr <- cbind(hdr, hdr_full) - + ## Remove core spectra variables that contain only `NA` hdr <- S4Vectors::DataFrame(hdr[, !(MsCoreUtils::vapply1l(hdr, function(z) all(is.na(z))) & colnames(hdr) %in% diff --git a/R/MsBackendRawFileReader.R b/R/MsBackendRawFileReader.R index af8ffb5..d20beb4 100644 --- a/R/MsBackendRawFileReader.R +++ b/R/MsBackendRawFileReader.R @@ -106,18 +106,19 @@ setMethod("peaksData", "MsBackendRawFileReader", scanIndex, BPPARAM=BPPARAM) rv <- lapply(pls, function(p){ - if (all(c("centroid.mz", "centroid.intensity", "noises", - "resolutions", "baselines") %in% colnames(p))){ + if (all(c("centroid.mZ", "centroid.intensity", "noises", + "resolutions", "baselines") %in% names(p))){ m <- as.matrix(cbind(p$centroid.mZ, - p$centroid.intensity, - p$noises, - p$resolutions, - p$baselines)) + p$centroid.intensity)) +## TODO(cp): add it + #p$noises, + #p$resolutions, + #p$baselines)) - colnames(m) <- c("mz", "intensity", - "noises", "resolutions", "baselines") - }else if (all(c("centroid.mz", "centroid.intensity") %in% colnames(p) )){ + colnames(m) <- c("mz", "intensity") + # "noises", "resolutions", "baselines") + }else if (all(c("centroid.mZ", "centroid.intensity") %in% names(p) )){ m <- as.matrix(cbind(p$centroid.mZ, p$centroid.intensity)) colnames(m) <- c("mz", "intensity") }else if (length(p$mZ) > 0){ @@ -126,7 +127,7 @@ setMethod("peaksData", "MsBackendRawFileReader", colnames(m) <- c("mz", "intensity") } else{ - warning(paste0("Scan ", p$scan, " has an empyt peaklist!")) + warning(paste0("Scan ", p$scan, " has an empty peaklist!")) m <- matrix(, 0, 2) colnames(m) <- c("mz", "intensity") } @@ -171,7 +172,6 @@ setMethod("mz", "MsBackendRawFileReader", function(object, ..., BPPARAM = bppara IRanges::NumericList(lapply(peaksData(object, BPPARAM = BPPARAM), "[", , 1), compress = FALSE) }) - #' @exportMethod filterScan #' @rdname MsBackendRawFileReader #' @param object MsBackendRawFileReader object diff --git a/tests/testthat.R b/tests/testthat.R index 482d261..a616e10 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -37,6 +37,7 @@ be <- Spectra::backendInitialize(MsBackendRawFileReader::MsBackendRawFileReader( files = c(sample_raw_file)) ## Run the MsBackend spectra variable test suite + test_suite <- system.file("test_backends", "test_MsBackend", package = "Spectra")