Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - zeleniy

1
XCMS / Re: xcmsRaw constructor and mslevel
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]
2
XCMS / Re: xcmsSet constructor and mslevel
It is very interesting. So, xcmsSet it is just a set/collection of xsmsRaw objects, which pass arguments from it constructor to constructors of it's inner xsmsRaw classes/objects ? And then automatically run findPeaks procedure width default peaker findPeaks.matchedFilter.
Ok, now i'm understand why constructions like this is works fine:
Code: [Select]
xcmsSet(mzXML.files, snames = snames, sclass = sclass, method = 'centWave', ppm = 10, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 1000), integrate = 1, mzdiff = -0.001, verbose.columns = TRUE, fitgauss = FALSE)
Thank you
3
XCMS / Re: xcmsSet constructor and mslevel
Ok, thanks for reply. Let's move on and try to findPeaks:
Code: [Select]
peaks <- findPeaks.centWave(xset, ppm=20, peakwidth = c(20, 50), snthresh=5)
Result:
Code: [Select]
zeleniy@zeleniy-HP-Pro-3400:~/workspace/mass/peaks$ Rscript xcms.r 
Loading required package: methods
ecoli1_600_pos_1: 80:0 130:18 180:47 230:74 280:103 330:135 380:169 430:202 480:223 530:229 580:236 630:265 680:279 730:306 780:348 830:354 880:356 930:356 980:356 1030:356 1080:356 1130:356 1180:356 1230:356 1280:356 1330:356 1380:356 1430:356 1480:356 1530:356 1580:356 1630:356 1680:356 1730:356 1780:356 1830:356 1880:356 1930:356 1980:356 2030:356 2080:356 2130:356 2180:356 2230:356 2280:356 2330:356 2380:356 2430:356 2480:356 2530:356 2580:356 2630:356 2680:356 2730:356 2780:356 2830:356 2880:356 2930:356 2980:356
Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "findPeaks.centWave", for signature "xcmsSet"
Calls: findPeaks.centWave -> <Anonymous>
Execution halted
Why ? Documentation for findPeaks.centWave:
Code: [Select]
findPeaks.centWave-methods        package:xcms         R Documentation

Feature detection for high resolution LC/MS data

Description:

    Peak density and wavelet based feature detection for high
    resolution LC/MS data in centroid mode

Arguments:

  object: ‘xcmsSet’ object

    ppm: maxmial tolerated m/z deviation in consecutive scans, in ppm
          (parts per million)

peakwidth: Chromatographic peak width, given as range (min,max) in
          seconds

snthresh: signal to noise ratio cutoff, definition see below.

prefilter: ‘prefilter=c(k,I)’. Prefilter step for the first phase. Mass
          traces are only retained if they contain at least ‘k’ peaks
          with intensity >= ‘I’.

mzCenterFun: Function to calculate the m/z center of the feature:
          ‘wMean’ intensity weighted mean of the feature m/z values,
          ‘mean’ mean of the feature m/z values, ‘apex’ use m/z value
          at peak apex, ‘wMeanApex3’ intensity weighted mean of the m/z
          value at peak apex and the m/z value left and right of it,
          ‘meanApex3’ mean of the m/z value at peak apex and the m/z
          value left and right of it.

integrate: Integration method. If ‘=1’ peak limits are found through
          descent on the mexican hat filtered data, if ‘=2’ the descent
          is done on the real data. Method 2 is very accurate but prone
          to noise, while method 1 is more robust to noise but less
          exact.

  mzdiff: minimum difference in m/z for peaks with overlapping
          retention times, can be negative to allow overlap

fitgauss: logical, if TRUE a Gaussian is fitted to each peak

scanrange: scan range to process

  noise: optional argument which is useful for data that was
          centroided without any intensity threshold, centroids with
          intensity < ‘noise’ are omitted from ROI detection

  sleep: number of seconds to pause between plotting peak finding
          cycles

verbose.columns: logical, if TRUE additional peak meta data columns are
          returned

Details:

    This algorithm is most suitable for high resolution
    LC/{TOF,OrbiTrap,FTICR}-MS data in centroid mode. In the first
    phase of the method mass traces (characterised as regions with
    less than ‘ppm’ m/z deviation in consecutive scans) in the LC/MS
    map are located.  In the second phase these mass traces are
    further analysed.  Continuous wavelet transform (CWT) is used to
    locate chromatographic peaks on different scales.

Value:

    A matrix with columns:

      mz: weighted (by intensity) mean of peak m/z across scans

  mzmin: m/z peak minimum

  mzmax: m/z peak maximum

      rt: retention time of peak midpoint

  rtmin: leading edge of peak retention time

  rtmax: trailing edge of peak retention time

    into: integrated peak intensity

intb: baseline corrected integrated peak intensity

    maxo: maximum peak intensity

      sn: Signal/Noise ratio, defined as ‘(maxo - baseline)/sd’, where
          ‘maxo’ is the maximum peak intensity,
          ‘baseline’ the estimated baseline value and
          ‘sd’ the standard deviation of local chromatographic noise.

  egauss: RMSE of Gaussian fit

        : if ‘verbose.columns’ is ‘TRUE’ additionally :

      mu: Gaussian parameter mu

  sigma: Gaussian parameter sigma

      h: Gaussian parameter h

      f: Region number of m/z ROI where the peak was localised

    dppm: m/z deviation of mass trace across scans in ppm

  scale: Scale on which the peak was localised

  scpos: Peak position found by wavelet analysis

  scmin: Left peak limit found by wavelet analysis (scan number)

  scmax: Right peak limit found by wavelet analysis (scan number)

Methods:

    object = "xcmsRaw" ‘ findPeaks.centWave(object, ppm=25,
          peakwidth=c(20,50), snthresh=10, prefilter=c(3,100),
          mzCenterFun="wMean", integrate=1, mzdiff=-0.001,
          fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0,
          verbose.columns=FALSE) ’

Author(s):

    Ralf Tautenhahn

References:

    Ralf Tautenhahn, Christoph Böttcher, and Steffen Neumann "Highly
    sensitive feature detection for high resolution LC/MS" BMC
    Bioinformatics 2008, 9:504

See Also:

    ‘findPeaks-methods’ ‘xcmsRaw-class’

4
XCMS / 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 ?
5
XCMS / xcmsSet constructor and mslevel
I'm trying to use xcms library by manual "LC/MS Preprocessing and Analysis with xcms. Colin A. Smith. November 27, 2011". Begin with simple. I just want to process mzXML file with MS1 data and positive polarization. Example:
Code: [Select]
files <- list.files("/home/zeleniy/workspace/mass/peaks/xcms", recursive=FALSE, full.names=TRUE)
xset <- xcmsSet(
  files,
  snames = NULL,
  sclass = NULL,
  phenoData = NULL,
  profmethod = "bin",
  profparam = list(),
  polarity = "positive",
  mslevel = NULL,
  nSlaves = 0,
  progressCallback = NULL
)
And then see this result:
Code: [Select]
zeleniy@zeleniy-HP-Pro-3400:~/workspace/mass/peaks$ Rscript xcms.r 
Loading required package: methods
ecoli1_600_pos_1: 80:0 130:18 180:47 230:74 280:103 330:135 380:169 430:202 480:223 530:229 580:236 630:265 680:279 730:306 780:348 830:354 880:356 930:356 980:356 1030:356 1080:356 1130:356 1180:356 1230:356 1280:356 1330:356 1380:356 1430:356 1480:356 1530:356 1580:356 1630:356 1680:356 1730:356 1780:356 1830:356 1880:356 1930:356 1980:356 2030:356 2080:356 2130:356 2180:356 2230:356 2280:356 2330:356 2380:356 2430:356 2480:356 2530:356 2580:356 2630:356 2680:356 2730:356 2780:356 2830:356 2880:356 2930:356 2980:356
Works fine. But when i'm specify "mslevel" parameter i have got an error:
Code: [Select]
xset <- xcmsSet(
  files,
  snames = NULL,
  sclass = NULL,
  phenoData = NULL,
  profmethod = "bin",
  profparam = list(),
  polarity = "positive",
  mslevel = 1,
  nSlaves = 0,
  progressCallback = NULL
)
Code: [Select]
zeleniy@zeleniy-HP-Pro-3400:~/workspace/mass/peaks$ Rscript xcms.r 
Loading required package: methods
ecoli1_600_pos_1: Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "findPeaks", for signature "NULL"
Calls: xcmsSet -> findPeaks -> <Anonymous>
Execution halted
What's problem ?
6
XCMS / Re: How to repeat the workflow of XCMS Online by XCMS manual
I still see this error:
Code: [Select]
Loading required package: methods
ecoli1_600_pos_1: Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "findPeaks", for signature "NULL"
Calls: xcmsSet -> findPeaks -> <Anonymous>
Execution halted
for code:
Code: [Select]
xSet = xcmsSet(inputFile, NULL, NULL, NULL, "bin", list(), "positive", 1);

Is it normal ? :)

P.S. Info:
Code: [Select]
> sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-pc-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8      LC_NUMERIC=C             
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8   
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8 
 [7] LC_PAPER=en_US.UTF-8      LC_NAME=C               
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C     

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

other attached packages:
[1] CAMERA_1.4.2 xcms_1.22.1

loaded via a namespace (and not attached):
[1] graph_1.26.0 RBGL_1.24.0  tools_2.11.1