get LCMS masses with more significant figures with xcmsRaw()
2
0
Entering edit mode
phoenix • 0
@phoenix-8372
Last seen 8.8 years ago
United States

I am new to unsing the bioconductor software, and recently I have been using xcmsSet() to find peaks and report masses from LCMS .cdf files. this gives me a dataframe with Masses and scan times, but the masses are often reported only up to one decimal point precision. I want additional significant figures. Is is possible to do this? I was looking into using from the documentation:

c <- xcmsRaw(path, profstep=0.1, profmethod="bin")

p <- findPeaks.centWave(c, ppm=10)

values <- groupval(p, value="into")

but I am having problems with that method.  I want a dataframe that looks like:

        WMMC122B_F301
177/887      868.5530
178/886      478.4295
179/887      946.3629
181/802      479.6062
191/889      236.8821
195/886     7801.7750

but with the first column having more significant figures, ex: 177.872

Thank you in advance

SessionInfo()

R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] xcms_1.44.0         Biobase_2.28.0      ProtGenerics_1.0.0  BiocGenerics_0.14.0
[5] mzR_2.2.1           Rcpp_0.11.6        

loaded via a namespace (and not attached):
[1] tools_3.2.0      codetools_0.2-11

R xcms xcmsRaw LC • 1.4k views
ADD COMMENT
0
Entering edit mode
phoenix • 0
@phoenix-8372
Last seen 8.8 years ago
United States

fixed problem with: 

path = file
 xraw <- xcmsRaw(file)
 p <- findPeaks.centWave(xraw, ppm=10, peakwidth=c(2,30), mzCenterFun="wMean", integrate=1, mzdiff=-0.001,  fitgauss=FALSE, verbose.columns=TRUE)

it looks like groupval() was the problem
  

ADD COMMENT
0
Entering edit mode
Johannes Rainer ★ 2.0k
@johannes-rainer-6987
Last seen 4 weeks ago
Italy

Dear phoenix!

Where in the documentation did you find this? I know it's not really that intuitive, but the "official" way to process the data would be (based on test data from the faahKO package):

library(faahKO)

cdfpath <- system.file("cdf", package = "faahKO")
cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)
## process the raw data and perform the peak detection for all files
xset <- xcmsSet(path, profmethod="bin", profparam=list(profstep=0.1), method="centWave", ppm=10, peakwidth=c(5, 12))
## group the peaks across samples/cdf files
xset <- group(xset)
## extract the group value
values <- groupval(xset)

The groupval method is only defined for an xcmsSet object, not an xcmsRaw object. Now, on the data from the example above there are no decimal points, but that's most likely due to the data and might be different on your data... It's a little counter-intuitive to not start from the raw data (i.e. xcmsRaw), but actually directly from an xcmsSet (which is build on the raw data). In case you need to get back to the raw object you can use the getXcmsRaw method on a xcmsSet object.

I hope this helps.

cheers, jo

 

ADD COMMENT

Login before adding your answer.

Traffic: 501 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6