Metabolomics Society Forum

Software => R => XCMS => Topic started by: nhabibi on November 24, 2021, 04:30:40 AM

Title: Saving the intermediate xcmsSet objects
Post by: nhabibi on November 24, 2021, 04:30:40 AM
Hi all,

I am working on a metabolic dataset using XCMS pipeline.

Is there a way to save the intermediate xcmsSet objects as a file which can be loaded and used later by the needed functions? e.g. loading the result of the xcmsSet() inside the group().

Thanks
Title: Re: Saving the intermediate xcmsSet objects
Post by: johannes.rainer on November 24, 2021, 06:21:15 AM
You can always save R objects with
Code: [Select]
save(objectname, file = "objectname.RData")
which can then be reloaded again into R with
Code: [Select]
load("objectname.RData")
. Note however that I would suggest to switch from the old xcms workflow to the new functionality and objects to analyse data with xcms (http://sneumann.github.io/xcms/articles/xcms.html).

best, jo
Title: Re: Saving the intermediate xcmsSet objects
Post by: nhabibi on November 24, 2021, 11:50:21 PM
Dear Johannes

Many thanks for your quick help :)


Bests
Narges
Title: Re: Saving the intermediate xcmsSet objects
Post by: nhabibi on November 27, 2021, 12:14:14 AM
Dear Johannes

I save and load the xcmsSet object:

save(xset, file = "xset.RData")
xset = load("xset.RData")

But I think it needs type conversion after being loaded. Would you please tell me how to convert it to an xcmsSet object?

I just found type.convert(), but it dose not work in this case.

Thanks in advance
Narges