sneumann / xcms

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

Detecting small peak between large peaks of same m/z #591

Closed breidan closed 2 years ago

breidan commented 2 years ago

Hi, I have an issue with findChromPeaks and CentWaveParam and detecting a very small peak between two closely spaced large peaks. This stems from LC-HRMS of mono saccharides as Cs adducts. In three runs of a QC the small peak is detected twice but not the third time. I have played around with the CentWaveParams but to no avail. Attached are the XICs of the peak in question in the second run of the QC (qc4) and the third run (qc16). Detected here: qc4

Not detected here: qc16

The broader picture (the peak @ 270 s needs detection): qc16broad

And here the CentWaveParams:

Object of class: CentWaveParam Parameters: ppm: 20 peakwidth: 5, 20 snthresh: 3 prefilter: 3, 100 mzCenterFun: wMean integrate: 2 mzdiff: 0.01 fitgauss: TRUE noise: 10 verboseColumns: FALSE roiList length: 0 firstBaselineCheck TRUE roiScales length: 0

Any help on how to solve this and get consistent detection would be highly appreciated. The presence of the small peak in unknown samples is of importance. And I would prefer to deal with this in findChromPeaks and not with fillChromPeaks because aligning and grouping of the many closely spaced peaks of the same m/zs is already a pain :-)

breidan commented 2 years ago

Hi, since someone else might also run into this kind of problem here my solution for it: after extensively experimenting with different CentWaveParam settings I ended up with peak width being the most influential and most sensitive parameter for detecting my peaks. Not only may the first value be too small but also the second value may not be too large. So c(5,20) detects in 04_qc and not 16_qc but c(4,10) detects in both. Yet no matter how much I tried I did not find settings that would consistently detect in all samples where the small peak at 270 s was present. So I gave up on findChromPeaks-centWave to solve this problem and turned to findChromPeaks-matchedFilter.

What I do now is the following: I read in all the MS data, extract a slice with filterMz and filterRt and do findChromPeaks-matcheFilter on that slice. For the totality of the MS data I use findChromPeaks-centWave to find peaks. Then rbind the chromPeaksmatrix of the centWave detection and the chromPeaks matrix of the matchedFilter detection (here the right columns need to be selected: c(1:9,12:13)) and feed back into the XCMSnExp object of the centWave detection. Same for the chromPeakData. After a refineChromPeaks with MergeNeighboringPeaksParam a regular adjustRtime and groupChromPeaks is run.

This approach provides me a consistent detection of the very minor monosaccharide in all injections plus the regular detections all in a proper XCMSnExp object for further processing.

Hope this might be of help to someone.