Skip to content

Commit

Permalink
fix peaksVar
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanse committed Aug 22, 2024
1 parent eced04e commit abf8286
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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.4
Authors@R: c(person(given = "Christian",
family = "Panse", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1975-3064")),
Expand Down Expand Up @@ -41,7 +41,7 @@ BugReports: https://github.com/fgcz/MsBackendRawFileReader/issues
Encoding: UTF-8
NeedsCompilation: yes
biocViews: MassSpectrometry, Proteomics, Metabolomics
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
License: GPL-3
SystemRequirements: mono-runtime 4.x or higher (including System.Data library)
on Linux/macOS, .Net Framework (>= 4.5.1) on Microsoft Windows.
Expand Down
2 changes: 1 addition & 1 deletion R/MsBackendRawFileReader-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
14 changes: 7 additions & 7 deletions R/MsBackendRawFileReader.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ setMethod("peaksData", "MsBackendRawFileReader",
"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")
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")
Expand Down Expand Up @@ -162,7 +163,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
Expand Down
1 change: 1 addition & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit abf8286

Please sign in to comment.