sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
185 stars 80 forks source link

Some peak groups have very wide rtmin and rtmax ranges (~ 30 sec) despite choosing a very small bw (3 sec) #307

Open etrh opened 6 years ago

etrh commented 6 years ago

I am seeing very strange results in converted_to_xset@groups

      mzmed    mzmin    mzmax    rtmed    rtmin     rtmax npeaks KO WT
51 163.0761 163.0040 163.1485 75.01957 65.97203  87.13606     38     8  7
62 170.1337 170.1336 170.1339 84.96534 77.85358 104.96188     24     9 11

Peaks that are almost 30 seconds apart are grouped into the same group!

These are the parameters I have used in retention time correction and alignment steps:

pdp <- PeakDensityParam(sampleGroups = xdata$sample_group, 
                        bw = 3, binSize = 0.05, 
                        minFraction = 0.5, minSamples = 5)

xdata <- groupChromPeaks(xdata, param = pdp)

pgp <- PeakGroupsParam(minFraction = 0.5, span = 0.55)
xdata <- adjustRtime(xdata, param = pgp)

pdp <- PeakDensityParam(sampleGroups = xdata$sample_group, minFraction = 0.8, bw = 2)
xdata <- groupChromPeaks(xdata, param = pdp)

xdata <- fillChromPeaks(xdata)

converted_to_xset <- as(xdata, "xcmsSet")
converted_to_xset@groups %>% View

What is happening?

jorainer commented 6 years ago

You can use the plotChromPeakDensity function on the m/z slice with your strange peak groups to check how the peak group was defined:

mzr <- c(163.0040, 163.1485)
par(mfrow = c(2, 1))
plot(chromatogram(xdata, mz = mzr, aggregationFun = "max"))
highlightChromPeaks(xdata, mz = mzr, whichPeaks = "apex_within")
plotChromPeakDensity(xdata, type = "apex_within", mz = mzr, param = pgp)

This should provide you with some more information on the specific peak group.