Skip to main content
Topic: How are XCMS's retention times calculated (Read 4837 times) previous topic - next topic

How are XCMS's retention times calculated

Hi All,

I'm noticing some strange things regarding the reported RTs (xcmeSet@peaks[,"rt"]) from XCMS.  I'm using findPeaks.centWave.

My initial confusion was from the following data, a plot of the retention time difference between a M+0 peak and its isotope.  You can see the retention times come in discrete chunks rather than being continuously distributed.

[attachment=2:3bz8gt4p]discrete.png[/attachment:3bz8gt4p]

The bins appear to correspond to my scan rate which made me question how the RTs were being calculated - so I tried to figure out how this was done.  Unfortunately none of my methods reproduced the reported

[attachment=1:3bz8gt4p]a peak.png[/attachment:3bz8gt4p]
Black: xcms reported RT
Blue: Peak centroid (of all points within rtmin:rtmax and mzmin:mzmax using rawEIC)
Red: Peak maxo
Green: Half way through peak (rtmin:rtmax)


Additionally, I was surprised at how far off some the peaks were from my calculated centroid. For example this was good shaped peak where I can't figure out what the reported RT corresponds to.
[attachment=0:3bz8gt4p]rt_calc.png[/attachment:3bz8gt4p]

In summary:
1. How is the reported RT chosen - should it not be a continuous variable?
2. What do rtmin/rtmax correspond to (these are the limits of the above EICs)?

Thanks!
Ps.  I did not find the answer to these questions in the centWave paper.

[attachment deleted by admin]

Re: How are XCMS's retention times calculated

Reply #1
I have some updated information and refined questions.

The reported RT of a peak is the RT of the scan which lies halfway between the peak bounds as determined by centWave (scmin/scmax). An interesting, related point is that peaks are always defined as an even number of scans wide.  This also means that the resolution of retention time is at best the scan rate.

I would like to do my own analysis of the peaks.  But a stumbling point for me is the disparity between scmin/scmax (peak limits found by wavelets) and the rtmin/rtmax. 
Could someone help me understand how rtmin/rtmax are determined?

Scmin/scmax also return -1 in some cases - which precludes my analysis using them.
Why does this occur and do you have a suggestion for peak bounds to use in these cases? (rtmin/rtmax seem insufficient in cases as above, where the bounds are much larger than the peak)

How are lmin/lmax involved?

Thanks much,
Nathaniel