Skip to main content

Topic: export XCMS2 fragments (Read 42 times) previous topic - next topic

  • gooooh
  • [*]
export XCMS2 fragments
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.