Skip to content

Commit

Permalink
Merge branch 'devel' into jomain
Browse files Browse the repository at this point in the history
  • Loading branch information
jorainer committed Feb 27, 2024
2 parents 17b487f + 48ac5e0 commit 40c09c0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 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.9
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
4 changes: 2 additions & 2 deletions R/method-filterFeatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ setMethod("filterFeatures",
vals <- rowPercentMissing(featureValues(object, ...)[, spl_idx])
fts_idx <- c(fts_idx, which(vals <= filter@threshold))
}
fts_idx <- order(unique(fts_idx))
fts_idx <- sort(unique(fts_idx))
message(length(vals) - length(fts_idx), " features were removed")
ph <- XProcessHistory(param = filter,
date. = date(),
Expand All @@ -479,7 +479,7 @@ setMethod("filterFeatures",
vals <- rowPercentMissing(assay(object, assay)[, spl_idx])
fts_idx <- c(fts_idx, which(vals <= filter@threshold))
}
fts_idx <- order(unique(fts_idx))
fts_idx <- sort(unique(fts_idx))
message(length(vals) - length(fts_idx), " features were removed")
object[fts_idx]
}
Expand Down
11 changes: 11 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Changes in version 4.1.9
----------------------

- Fix bug in `filterFeatures,PercentMissingFilter`.

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 40c09c0

Please sign in to comment.