Skip to content

Commit 811b863

Browse files
authored
Merge pull request #741 from NorStorz/fix/issue734
fix: filtering MsLevel for xic plot
2 parents 6e64dd7 + fed9e9a commit 811b863

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: xcms
2-
Version: 4.1.13
2+
Version: 4.1.14
33
Title: LC-MS and GC-MS Data Analysis
44
Description: Framework for processing and visualization of chromatographically
55
separated and single-spectra mass spectral data. Imports from AIA/ANDI NetCDF,

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# xcms 4.1
22

3+
## Changes in version 4.1.13
4+
5+
- Fix for issue #734. XIC plot is is now working with MS2 Data.
6+
7+
38
## Changes in version 4.1.13
49

510
- Add parameter `rtimeDifferenceThreshold` to `ObiwarpParam` allowing to

R/XcmsExperiment-plotting.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,13 @@ setMethod(
380380
fns <- basename(fileNames(x))
381381
for (i in seq_along(x)) {
382382
z <- x[i]
383-
lst <- as(filterMsLevel(spectra(z), msLevel = msLevel), "list")
383+
flt <- filterMsLevel(spectra(z), msLevel = msLevel)
384+
lst <- as(flt, "list")
384385
lns <- lengths(lst) / 2
385386
lst <- do.call(rbind, lst)
386387
if (!length(lst))
387388
next
388-
df <- data.frame(rt = rep(rtime(z), lns), lst)
389+
df <- data.frame(rt = rep(rtime(flt), lns), lst)
389390
colnames(df)[colnames(df) == "intensity"] <- "i"
390391
do.call(MSnbase:::.plotXIC,
391392
c(list(x = df, main = fns[i], layout = NULL), dots))

tests/testthat/test_XcmsExperiment-plotting.R

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ df <- data.frame(mzML_file = basename(fls),
44
dataOrigin = fls,
55
sample = c("ko15", "ko16", "ko18"))
66
mse <- readMsExperiment(spectraFiles = fls, sampleData = df)
7+
mse_ms2 <- readMsExperiment(msdata::proteomics(full.names=TRUE)[4])
78
p <- CentWaveParam(noise = 10000, snthresh = 40, prefilter = c(3, 10000))
89
xmse <- findChromPeaks(mse, param = p)
910
pdp <- PeakDensityParam(sampleGroups = rep(1, 3))
@@ -51,3 +52,8 @@ test_that("plot,XcmsExperiment and .xmse_plot_xic works", {
5152
tmp <- filterMz(filterRt(xmse, rt = c(2550, 2800)), mz = c(342.5, 344.5))
5253
plot(tmp)
5354
})
55+
56+
test_that(".xmse_plot_xic works with ms2 data", {
57+
tmp <- filterMz(filterRt(mse_ms2, rt= c(2160, 2190)), mz = c(990,1000))
58+
plot(tmp)
59+
})

0 commit comments

Comments
 (0)