Skip to content

Commit

Permalink
Merge pull request #719 from pablovgd/issue716
Browse files Browse the repository at this point in the history
fix issue #716 in XcmsExperiment-functions.R
  • Loading branch information
sneumann committed Feb 19, 2024
2 parents 1cf7cda + b703edc commit b1ae819
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
8 changes: 6 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: xcms
Version: 4.1.7
Version: 4.1.8
Title: LC-MS and GC-MS Data Analysis
Description: Framework for processing and visualization of chromatographically
separated and single-spectra mass spectral data. Imports from AIA/ANDI NetCDF,
Expand Down Expand Up @@ -35,7 +35,11 @@ Authors@R: c(
person(given = "Philippine", family = "Louail",
email = "philippine.louail@eurac.edu",
role = "aut",
comment = c(ORCID = "0009-0007-5429-6846"))
comment = c(ORCID = "0009-0007-5429-6846")),
person(given = "Pablo", family = "Vangeenderhuysen",
email = "pablo.vangeenderhuysen@ugent.be",
role = "ctb",
comment = c(ORCID = "0000-0002-5492-6904"))
)
Depends:
R (>= 4.0.0),
Expand Down
2 changes: 1 addition & 1 deletion R/XcmsExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@
NULL

.empty_chrom_peaks <- function(sample = TRUE) {
cols <- c(.REQ_PEAKS_COLS, "maxo")
cols <- c(.REQ_PEAKS_COLS, "maxo","sn")
if (!sample)
cols <- cols[cols != "sample"]
matrix(numeric(), ncol = length(cols), nrow = 0,
Expand Down
5 changes: 5 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Changes in version 4.1.8
----------------------
- Fixing issue #716: edit of `.empty_chrom_peaks` function so an `sn` column is
returned. Fixes extracting and plotting of peaks after using `manualChromPeaks`

Changes in version 4.1.7
----------------------

Expand Down
7 changes: 6 additions & 1 deletion tests/testthat/test_XcmsExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mse_dia <- readMsExperiment(fl)
test_that(".empty_chrom_peaks works", {
res <- .empty_chrom_peaks()
expect_true(nrow(res) == 0)
expect_equal(colnames(res), c(.REQ_PEAKS_COLS, "maxo"))
expect_equal(colnames(res), c(.REQ_PEAKS_COLS, "maxo","sn"))

res <- .empty_chrom_peaks(sample = FALSE)
expect_true(nrow(res) == 0)
Expand Down Expand Up @@ -995,8 +995,13 @@ test_that("manualChromPeaks,XcmsExperiment works", {
expect_equal(unname(pks[, c("mz", "into", "maxo")]),
unname(pks_2[, c("mz", "into", "maxo")]))

chr_pks <- chromPeaks(res)
expect_true("sn" %in% colnames(chr_pks)

res2 <- manualChromPeaks(tmp, pks, samples = 2)
expect_equal(unname(chromPeaks(res2)), unname(pks_2))


})

test_that("filterChromPeaks,XcmsExperiment works", {
Expand Down

0 comments on commit b1ae819

Please sign in to comment.