Skip to content

Commit

Permalink
fix dots handling
Browse files Browse the repository at this point in the history
  • Loading branch information
philouail committed Nov 21, 2024
1 parent 971db33 commit d117184
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/XcmsExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ setMethod(
object, msLevel = msLevel, expandRt = expandRt,
expandMz = expandMz, ppm = ppm, skipFilled = skipFilled,
peaks = unique(pindex),
addColumnsChromPeaksPrefix = addColumnsChromPeaksPrefix)
addColumnsChromPeaksPrefix = addColumnsChromPeaksPrefix, ...)
col <- paste0(addColumnsChromPeaksPrefix, "id")
mtch <- as.matrix(
findMatches(sps[[col]], rownames(.chromPeaks(object))[pindex]))
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test_XcmsExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,8 @@ test_that("chromPeakSpectra works", {
expect_equal(rtime(res2[1L]), rtime(res[res$chrom_peak_id == pks[1L]])[idx[1L]])
expect_equal(rtime(res2[2L]), rtime(res[res$chrom_peak_id == pks[2L]])[idx[2L]])
expect_equal(rtime(res2[3L]), rtime(res[res$chrom_peak_id == pks[3L]])[idx[3L]])
expect_true(all(c("chrom_peak_id", "chrom_peak_mz", "chrom_peak_rt") %in%
spectraVariables(res2)))

res2 <- chromPeakSpectra(xmse, msLevel = 1L, method = "largest_bpi",
peaks = pks, return.type = "List")
Expand All @@ -974,8 +976,6 @@ test_that("chromPeakSpectra works", {
expect_equal(rtime(res2[[1L]]), rtime(res[res$chrom_peak_id == pks[1L]])[idx[1L]])
expect_equal(rtime(res2[[2L]]), rtime(res[res$chrom_peak_id == pks[2L]])[idx[2L]])
expect_equal(rtime(res2[[3L]]), rtime(res[res$chrom_peak_id == pks[3L]])[idx[3L]])
expect(all(c("chrom_peak_id", "chrom_peak_mz", "chrom_peak_rt") %in%
spectraVariables(res2)))

## DDA data
fl <- system.file("TripleTOF-SWATH/PestMix1_DDA.mzML", package = "msdata")
Expand Down Expand Up @@ -1107,10 +1107,10 @@ test_that("featureSpectra works", {
res_2 <- featureSpectra(xmseg, msLevel = 1L, features = c("FT03", "FT01"),
return.type = "List")
expect_true(length(res[[1L]]) < length(res_2[[1L]]))
expect_true(all(res[[1L]]$peak_id %in% res_2[[1L]]$peak_id))
expect_true(all(res[[1L]]$chrom_peak_id %in% res_2[[1L]]$chrom_peak_id))
expect_equal(unique(res[[1L]]$feature_id), unique(res_2[[1L]]$feature_id))
expect_true(length(res[[2L]]) < length(res_2[[2L]]))
expect_true(all(res[[2L]]$peak_id %in% res_2[[2L]]$peak_id))
expect_true(all(res[[2L]]$chrom_peak_id %in% res_2[[2L]]$chrom_peak_id))
expect_equal(unique(res[[2L]]$feature_id), unique(res_2[[2L]]$feature_id))
})

Expand Down

0 comments on commit d117184

Please sign in to comment.