From d117184e91ab94760df85e79e35422879aff0ffb Mon Sep 17 00:00:00 2001 From: Philippine Louail <127301965+philouail@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:23:24 +0100 Subject: [PATCH] fix dots handling --- R/XcmsExperiment.R | 2 +- tests/testthat/test_XcmsExperiment.R | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/XcmsExperiment.R b/R/XcmsExperiment.R index 3607bcf4..06a13f1f 100644 --- a/R/XcmsExperiment.R +++ b/R/XcmsExperiment.R @@ -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])) diff --git a/tests/testthat/test_XcmsExperiment.R b/tests/testthat/test_XcmsExperiment.R index 87d3a959..57703518 100644 --- a/tests/testthat/test_XcmsExperiment.R +++ b/tests/testthat/test_XcmsExperiment.R @@ -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") @@ -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") @@ -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)) })