Skip to main content
Topic: How to export XCMS results (Read 4357 times) previous topic - next topic

How to export XCMS results

Hello everyone,
I'm totally new on XCMS (and R), but I'm trying to do my best to learn as fast as possible how to deal with these tools. I'm pretty sure that I've understood the global process, and I tested it with my GC-MS (single quad) data. However, after alignment - correspondence - filling missing peaks, I have no idea on how extract my data as excel table to visualize which peaks have been detected and to try to identify the analytes.

I found this instructions:
mydata = groupval(yourset,value="into")
write.table(mydata,sep=”\t”,quote=F)

but when I try them, I have this error message: Error in (function (classes, fdef, mtable)  :  unable to find an inherited method for function ‘groupval’ for signature ‘"XCMSnExp"’
So it is obvious that I've not understood which object to convert...I find just XCMSnExp in my environment and I really don't know what to do.
Sorry if I bother you with this basic question, but I would really appreciate some help
Thanks a lot!

Re: How to export XCMS results

Reply #1
Hi,

it looks like you are using the new interface and functions (aka XCMS3) - groupval is not available for the new result objects. To extract the definitions of the features (previously called "groups") you can use the featureDefinitions function and to extract the actual intensity matrix for the features you will have to use featureValues (ensure also to set value = "into" when calling this function to extract the intensities).

Eventually you should also have a look at the xcms vignette that tries to describe how you can access results etc: https://bioconductor.org/packages/release/bioc/vignettes/xcms/inst/doc/xcms.html

cheers, jo

Re: How to export XCMS results

Reply #2
Hi,

I'm using this:

## get data
featuresDef <- featureDefinitions(processedData)
featuresIntensities <- featureValues(processedData, value = "into")

## generate data table
dataTable <- merge(featuresDef, featuresIntensities, by=0, all=TRUE)
dataTable <- dataTable[,!(names(dataTable) %in% c("peakidx"))]
write.table(dataTable, "xcms_msv000080502_all.txt", sep = "\t", quote = FALSE, row.names = FALSE)

Where processedData represents the XCMSnExp

Best regards,

Michael

Re: How to export XCMS results

Reply #3
Thank you guys, it works! You saved me from madness XD

Cheers
B.