Skip to main content
Topic: xcmsRaw constructor and mslevel (Read 4217 times) previous topic - next topic

xcmsRaw constructor and mslevel

Code: [Select]
files <- list.files("/home/zeleniy/workspace/mass/peaks/xcms", recursive=FALSE, full.names=TRUE)
xraw = xcmsRaw(
  files,
  profstep = 1,
  profmethod = "intlin",
  profparam = list(),
  includeMSn=FALSE,
  mslevel=NULL
)
peaks <- findPeaks.centWave(xraw, ppm=20, snthresh=5)
Execution:
Code: [Select]
zeleniy@zeleniy-HP-Pro-3400:~/workspace/mass/peaks$ Rscript xcms.r 
Loading required package: methods

 Detecting mass traces at 20 ppm ...
 % finished: 0 10 20 30 40 50 60 70 80 90 100
 2778 m/z ROI's.

 Detecting chromatographic peaks ...
 % finished: 0 10 20 30 40 50 60 70 80 90 100
 1053  Peaks.
Set mslevel:
Code: [Select]
xraw = xcmsRaw(
  files,
  profstep = 1,
  profmethod = "intlin",
  profparam = list(),
  includeMSn=FALSE,
  mslevel=1
)
Execution:
Code: [Select]
zeleniy@zeleniy-HP-Pro-3400:~/workspace/mass/peaks$ Rscript xcms.r 
Loading required package: methods
Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "findPeaks.centWave", for signature "NULL"
Calls: findPeaks.centWave -> <Anonymous>
Execution halted
Why ?

Re: xcmsRaw constructor and mslevel

Reply #1
Zeleniy,

I believe what you want is :
Code: [Select]
> xraw = xcmsRaw(files[11], mslevel=2, includeMSn=T)
Warning message:
In split.xcmsRaw(object, f = object@msnLevel == mslevel) :
  MSn information will be dropped
> xraw
An "xcmsRaw" object with 25786 mass spectra

Time range: 0.7-10497 seconds (0-175 minutes)
Mass range: 25.0657-1499.2973 m/z
Intensity range: 0-110124

MSn data on  3422  mass(es)
   with  25786  MSn spectra
Profile method: bin
Profile step: 1 m/z (1475 grid points from 25 to 1499 m/z)

Memory usage: 301 MB
Code: [Select]
> xr<-xcmsRaw(files[11], includeMSn=T)
> xr
An "xcmsRaw" object with 13201 mass spectra

Time range: 0.2-10496.6 seconds (0-174.9 minutes)
Mass range: 99.993-1499.3656 m/z
Intensity range: 200-755285

MSn data on  3422  mass(es)
   with  25786  MSn spectra
Profile method: bin
Profile step: 1 m/z (1400 grid points from 100 to 1499 m/z)

Memory usage: 177 MB

The above will be a normal xcmsRaw object with ms/ms scans in xr@env$msnMz. Where as xraw will have the msn scans in xraw@env$mz
Also xcmsRaw does not read multiple files. The class is set for reading raw data. The xcmsSet class is made for reading multiple files and doing peak detection on these. There is another class the xcmsFragments class, which you might be interested in. Have a look at the documentation for more details how how to use this class. http://www.bioconductor.org/packages/re ... cmsMSn.pdf
Code: [Select]
> image(xr)
> dev.new();image(xraw)


Quick check to see the different and see what you're trying to peak pick.
~~
H. Paul Benton
Scripps Research Institute
If you have an error with XCMS Online please send me the JOBID and submit an error via the XCMS Online contact page

Re: xcmsRaw constructor and mslevel

Reply #2
I'm still try to process single mzXML file with MS1 data and positive polarization. And now i have that code:
Code: [Select]
xraw = xcmsRaw(
  "/home/zeleniy/workspace/mass/peaks/xcms/ecoli1_600_pos_1.mzXML",
  profstep = 1,
  profmethod = "intlin",
  profparam = list(),
  includeMSn=FALSE,
  mslevel=NULL
)

print(xraw)
peaks <- findPeaks.centWave(xraw, ppm=20, peakwidth = c(20, 50), snthresh=5)
table <- peaks[];
write.table(table, "ecoli1_600_pos_1.mzXML.csv", sep="t");
Do i need to specify polarization for xcmsRaw object ? If yes - how ? For example, xcmsSet class have parameter "polarity", but xcmsRaw - no.
At the end of the end, i just want to reproduce with R results of Maven peak peaking procedure... and now my data and data from Maven are different.

So, how i can specify intensity threshold to 1000, for example ?

[attachment deleted by admin]