diff --git a/DESCRIPTION b/DESCRIPTION index 199754b8..2510aba0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: xcms -Version: 4.1.14 +Version: 4.1.15 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, diff --git a/NEWS.md b/NEWS.md index 0015c0c5..5651f264 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,11 +1,15 @@ # xcms 4.1 -## Changes in version 4.1.14 +## Changes in version 4.1.15 - Support excluding samples or sample groups from defining features with *PeakDensity* correspondence analysis (issue #742). - Add `plotPrecursorIons()` function. +## Changes in version 4.1.14 + +- Fix for issue #734. XIC plot is is now working with MS2 Data. + ## Changes in version 4.1.13 - Add parameter `rtimeDifferenceThreshold` to `ObiwarpParam` allowing to diff --git a/R/XcmsExperiment-plotting.R b/R/XcmsExperiment-plotting.R index ad70afd5..ed16537b 100644 --- a/R/XcmsExperiment-plotting.R +++ b/R/XcmsExperiment-plotting.R @@ -380,12 +380,13 @@ setMethod( fns <- basename(fileNames(x)) for (i in seq_along(x)) { z <- x[i] - lst <- as(filterMsLevel(spectra(z), msLevel = msLevel), "list") + flt <- filterMsLevel(spectra(z), msLevel = msLevel) + lst <- as(flt, "list") lns <- lengths(lst) / 2 lst <- do.call(rbind, lst) if (!length(lst)) next - df <- data.frame(rt = rep(rtime(z), lns), lst) + df <- data.frame(rt = rep(rtime(flt), lns), lst) colnames(df)[colnames(df) == "intensity"] <- "i" do.call(MSnbase:::.plotXIC, c(list(x = df, main = fns[i], layout = NULL), dots)) diff --git a/tests/testthat/test_XcmsExperiment-plotting.R b/tests/testthat/test_XcmsExperiment-plotting.R index ea467030..a4ab590a 100644 --- a/tests/testthat/test_XcmsExperiment-plotting.R +++ b/tests/testthat/test_XcmsExperiment-plotting.R @@ -4,6 +4,7 @@ df <- data.frame(mzML_file = basename(fls), dataOrigin = fls, sample = c("ko15", "ko16", "ko18")) mse <- readMsExperiment(spectraFiles = fls, sampleData = df) +mse_ms2 <- readMsExperiment(msdata::proteomics(full.names=TRUE)[4]) p <- CentWaveParam(noise = 10000, snthresh = 40, prefilter = c(3, 10000)) xmse <- findChromPeaks(mse, param = p) pdp <- PeakDensityParam(sampleGroups = rep(1, 3)) @@ -64,3 +65,8 @@ test_that("plotPrecursorIons works", { a <- readMsExperiment(fl) plotPrecursorIons(a) }) + +test_that(".xmse_plot_xic works with ms2 data", { + tmp <- filterMz(filterRt(mse_ms2, rt= c(2160, 2190)), mz = c(990,1000)) + plot(tmp) +})