Metabolomics Society Forum

Software => R => XCMS => Topic started by: bo2014 on November 25, 2014, 09:34:58 AM

Title: XCMS for UPLC-Waters G2-S Q-TOF
Post by: bo2014 on November 25, 2014, 09:34:58 AM
Hi All,
Does anyone know how to set the parameters of XCMS for the data generated by UPLC-Waters G2-S Q-TOF?
My code is below, is it good for that data?
xset<-xcmsSet(cdffiles,
                        method="centWave",
                        ppm=15,
                        peakwidth=c(2,25),
                        snthresh=10,
                        prefilter=c(3,500),
                        mzCenterFun="wMean",
                        integrate=2,
                        mzdiff=0.01,
                        noise=0,
                        verbose.columns=TRUE,
                        fitgauss=FALSE,
                        sleep=0,
                        polarity="positive"
                        )
Best regards!
Bo
Title: Re: XCMS for UPLC-Waters G2-S Q-TOF
Post by: Jan Stanstrup on November 25, 2014, 10:04:41 AM
Some impressions:


edit: default step size is 0.1 not 1.
Title: Re: XCMS for UPLC-Waters G2-S Q-TOF
Post by: bo2014 on November 25, 2014, 11:03:00 AM
Quote from: "Jan Stanstrup"
Some impressions:
  • An overlooked parameter is the step size. It can be set with profparam = list(step=0.005). The default of 1 (!?) is way too high. See http://metabolomics-forum.com/viewtopic.php?f=8&t=576 (http://metabolomics-forum.com/viewtopic.php?f=8&t=576) for a brief explanation.

    Hi Jan,
    Thank you very much for your answers.

    I have checked the parameter "profparam", it's only useful for profile data. If the data I provided is centroid, then I don't need to set the parameter. Is that true?

    Best regards!
    Bo
Title: Re: XCMS for UPLC-Waters G2-S Q-TOF
Post by: Jan Stanstrup on November 26, 2014, 04:42:31 AM
No. The profparam has nothing to do with profile data.

The step size passed in profparam is used during fillPeaks. fillPeaks passes the parameter to getPeaks internally. getPeaks is responsible for integrating the peaks during fillPeaks. It does so by generating extracted ion chromatograms (EIC) with the width of the step argument. This means that closely eluting peaks with a mass difference of less than the "step" size could both fall into the same EIC and therefore be integrated together. Therefore it is preferable to lower the step size. What happens when the step size is set to something low is that the EICs are simply combined to correspond to the expected variation in the m/z that was observed in the initial peak picking.

To make life more complicated this can have some problematic consequences when your instrument is very accurate. Sometimes the observed deviation in the m/z in the initial peak picking is extremely low. This means that when you then look in other samples in this very narrow m/z range it might not be found even if it is clearly there.
Had we not altered the step size the range we would look for the peak in would have been a window of 0.1 Da and thus the observed deviation would be irrelevant. But that would have left the problem described above of not discriminating close masses.
For this reason I have suggested changes to fillPeaks, but they are not yet in the official xcms. You can read about that here: https://github.com/sneumann/xcms/pull/3 ... t-41792003 (https://github.com/sneumann/xcms/pull/3#issuecomment-41792003)
What my modification does is allow you to set a minimum width for the m/z range in which fillPeaks will look for the peak in the other samples. You can thus control yourself how close the m/z of peaks need to be to be considered the same.


Sorry for this long and complicated explanation but I thought it was better to fully explain how things work so you can better decide on your parameters.
Title: Re: XCMS for UPLC-Waters G2-S Q-TOF
Post by: bo2014 on November 26, 2014, 06:31:21 AM
Hi Jan,
Thank you so much for your detailed reply.
Best regards!
Bo