Metabolomics Society Forum

Software => R => XCMS => Topic started by: gooooh on July 11, 2018, 08:04:03 PM

Title: export XCMS2 fragments
Post by: gooooh on July 11, 2018, 08:04:03 PM
Hi,

I used xcms2 on my lcmsms and have successfully executed the following commands.

Code: [Select]
#Load all libraries
library(xcms)

#Create and spacify filepath
path <- "G:/msms"
files <- list.files(path, full.names=TRUE, pattern="cp.mzXML", recursive = TRUE)


xrawctrl <- xcmsRaw(files[1], includeMSn = TRUE)
peaks <- findPeaks(xrawctrl, method="MS1")
xs <- xcmsSet(files, method="MS1")
xfrag <- xcmsFragments(xs)

Code: [Select]
> xfrag
An "xcmsFragments" object with  5819  peaks in 912 Spectra
From Level 1 to 2 Number of Samples:  1 .

Sample 1 :
    646 Peaks in Level 1
    5173 Peaks in Level 2

Memory usage: 0.402 MB

I know that the searchmetlin is no longer available in xcms2. May i know how to extract the fragments with the parent ions out so i can do compound annotations  ? I have tried the code as below but couldn't get it out.

Code: [Select]
xfragdata <- groupval(xfrag, value = "into")
write.csv(xfrag, file="xfrag.csv")


Thank you.

Regards.
Title: Re: export XCMS2 fragments
Post by: sneumann on August 20, 2018, 05:08:43 AM
Hi, the `xcmsFragments` is a rather old object class.
Your might want to look into the XCMS3 interface,
that heavily relies on MSnbase, which has much better
support for MS^n data. Yours, Steffen
Title: Re: export XCMS2 fragments
Post by: gooooh on September 01, 2018, 02:25:27 AM
Hi,

Thanks for the suggestion, i will look into your xcms3 in github,

Regards,
Goh.
Title: Re: export XCMS2 fragments
Post by: johannes.rainer on October 24, 2018, 02:03:01 AM
We're actually currently implementing some potentially interesting stuff. In the next version you'll have a featureSpectra and chromPeakSpectra function that returns MS2 spectra related to a feature or chromatographic peak.

stay tuned.