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 Apr 24, 2024
2 parents ea35751 + 811b863 commit b0d48c4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions R/XcmsExperiment-plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test_XcmsExperiment-plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
})

0 comments on commit b0d48c4

Please sign in to comment.