Metabolomics Society Forum

Software => R => XCMS => Topic started by: Ricca on July 27, 2013, 02:58:37 PM

Title: xcmsRaw and obiwarp
Post by: Ricca on July 27, 2013, 02:58:37 PM
Hi, I have several xcmsRaw object that I would like to align using the obiwarp method. Is there a way to do this without using xcmsSet?

Best Regards
Riccardo
Title: Re: xcmsRaw and obiwarp
Post by: sneumann on July 29, 2013, 12:45:13 AM
Hi,

the quick answer is "no". What's wrong with an xcmsSet ?

Yours,
Steffen
Title: Re: xcmsRaw and obiwarp
Post by: Ricca on July 29, 2013, 05:44:22 AM
Hi,
I generally use the xcmsSet approach but, in some cases, I have to perform some specific operation to the raw data so I prefear to use the xcmsRaw approach.

What about a slow answer?  ;)

 Best Regards, Riccardo
Title: Re: xcmsRaw and obiwarp
Post by: sneumann on July 29, 2013, 06:43:26 AM
Hm, in that case I'd have to check the source myself:
Look out for the retcorr.obiwarp() function
and see where it iterates over the raw files
and applies the obiwarp()ing.

Yours,
Steffen
Title: Re: xcmsRaw and obiwarp
Post by: Ricca on July 29, 2013, 09:20:05 AM
Hi,
thanks for your suggestion. I tried retcor.obiwarp() in the R console but I get the following error:

> retcor.obiwarp()
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘retcor.obiwarp’ for signature ‘"missing"’

Any suggestion?

Best Regards,
Riccardo
Title: Re: xcmsRaw and obiwarp
Post by: Ralf on July 29, 2013, 11:02:49 AM
If you really want to apply obiwarp without doing feature detection first, you could implement a simple "dummy" feature detection method, that does nothing but returns an empty peak matrix.
That way you could call xcmsSet(method="dummy",...) to create an xcmsSet that has all the meta-information and could be used to apply obiwarp.
The xcmsSet will then contain the new retention time vectors (but no peaks).
Title: Re: xcmsRaw and obiwarp
Post by: Ricca on July 30, 2013, 10:34:38 AM
The fact is that I do the feature detection using several xcmsRaw object. I would like to understand which slot should I use to perform retcor.obiwarp() 'by hand'.

Riccardo
Title: Re: xcmsRaw and obiwarp
Post by: Ralf on July 30, 2013, 12:12:26 PM
Maybe you can describe what you are trying to do in some more detail. 

obiwarp can only be applied to pairs of samples, retcor.obiwarp calculates retention time correction as a center-star alignment, based on the samples in the xcmsSet.
It creates the corrected retention time vectors (xcmsSet@rt$corrected) and eventually updates the the retention times in the @peaks table.
Title: Re: xcmsRaw and obiwarp
Post by: Ricca on July 31, 2013, 02:05:00 AM
My intent is to apply the obiwarp time correction to a several GCMS samples. I can not use use a xcmsSet object to apply the time warp because, as a previous step, I do some pre-treatment/corrections to each chromatogram. 

Quote
[...]obiwarp can only be applied to pairs of samples, retcor.obiwarp calculates retention time correction as a center-star alignment, [...]

As a next step I will write some piece of code to loop the correction to all my data-set and update the retention times of each chromatogram.