Skip to main content
Topic: export XCMS2 fragments (Read 4227 times) previous topic - next topic

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.

Re: export XCMS2 fragments

Reply #1
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
--
IPB Halle                          Mass spectrometry & Bioinformatics
Dr. Steffen Neumann         http://www.IPB-Halle.DE
Weinberg 3 06120 Halle     Tel. +49 (0) 345 5582 - 1470
sneumann(at)IPB-Halle.DE

Re: export XCMS2 fragments

Reply #2
Hi,

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

Regards,
Goh.

Re: export XCMS2 fragments

Reply #3
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.