Open rickhelmus opened 5 years ago
That is indeed unexpected! I will have a look into it.
Hi, I was able to reproduce the numbers in the example. I didn't find an explanation. Yours, Steffen
Getting closer to the explanation: reading just one file and comparing the content of the data. The xcmsSet
call reads each file with xcmsRaw
and performs peak detection on that.
xr <- xcmsRaw(files[1])
msd1 <- readMSData(files[1], msLevel = 1L, mode = "onDisk")
## Comparing the number of spectra:
length(xr@scantime)
2358
length(rtime(msd1))
2629
Apparently, the xcmsRaw
has fewer scans/spectra than what is available when reading the data with readMSData
. In fact, xcmsRaw
has an option dropEmptyScans = TRUE
which removes spectra without any peaks (because this can not be represented by the xcmsRaw
data structure).
To verify that the difference in spectra is due to that:
length(msd1) - sum(peaksCount(msd1) == 0)
2358
I will next check how this affected the peak detection, but I guess the explanation might be in this difference.
In fact, when the empty spectra are removed from the new object the results of centWave are identical:
tmp <- msd1[peaksCount(msd1) > 0]
res_new <- findChromPeaks(tmp, CentWaveParam())
res_old <- findPeaks.centWave(xr)
all.equal(res_old[, "mz"], unname(chromPeaks(res_new)[, "mz"]))
TRUE
all.equal(res_old[, "into"], unname(chromPeaks(res_new)[, "into"]))
TRUE
Hi XCMS team,
I finally got around trying the and improved XCMS3 interface :-) One thing I quickly noticed is that with some data files I get significantly different amounts of peaks. A small example is shown below.
The old
xcmsSet
function returns less than half of the peaks compared to the new interface (401 vs 911). As far as I could tell peak picking defaults remained the same, perhaps it's related to the different binning functions? In the end I am just curious if this is a bug or feature? :-)Outputs:
I am using R 3.6.1 with fully updated Bioc/R packages.
Cheers, Rick