Metabolomics Society Forum

Software => R => XCMS => Topic started by: kheal on November 05, 2017, 08:47:46 PM

Title: Integration time range saved in xcms xset object?
Post by: kheal on November 05, 2017, 08:47:46 PM
Hello,

I am attempting to look at many peaks (hundreds) with an intereactive call-and-reponse in R.  Essentially, I'm using xcmsRaw() to access data from a representative sample, rawEIC() to extract a certain mz and rt range of a peak that xcms picked (and subsequent analysis has shown to have an interesting pattern in my dataset).  I use a processed xset object to extract the corrected retention time.  Then I can quickly plot the peak to check if it is a quality peak. 

I am wondering if the integration limits (that is the rt min and rt max that xcms uses to integrate each peak or each group, not the range in rt, but the actual integration limits) are saved anywhere in the xset object and if so, where are they?  I would like to plot these as well to check if the integration is in decent shape.

I know that getEIC() can do what I am proposing, but as many have noted before me, getEIC() and is excruciatingly slow, especially if looking at hundreds of peaks. 

Any advice is appreciated!
~Katherine
Title: Re: Integration time range saved in xcms xset object?
Post by: Jan Stanstrup on November 12, 2017, 04:08:33 AM
The peaks for each sample are in @peaks with rtmin and rtmax (from memory). That should be the integration limits.

You can use MSnbase instead to plot chromatograms. That should be faster. Some possible inspiration here: https://cdn.rawgit.com/stanstrup/xcms_ggplot2/8ac45aeb/ggplot.Chromatograms.html