xcms icon indicating copy to clipboard operation
xcms copied to clipboard

Regarding the steps of operating FillChromPeaksParam

Open v-v1150n opened this issue 8 months ago • 3 comments

The following are the steps I took to analyze GC-MS. When it comes to FillChromPeaksParam, this function requires the use of XCMSnExp objects. The objects I use in the fifth step will be XcmsExperiment objects. I don’t know if there is any way to handle the conversion of objects, or Are there any suggestions for optimization steps?

# 1.Mass detection
raw_path <- "/Users/v_v1150n/Desktop/EBC/DISEASE_cdf/20140327_B-169_S041_1.cdf"
raw_data <- readMsExperiment(spectraFiles = raw_path)
cwp <- CentWaveParam(peakwidth = c(5, 20), 
                     noise = 500,
                     prefilter = c(3, 100),
                     snthresh = 10,
                     mzCenterFun = "wMean",
                     integrate = 1,
                     fitgauss = FALSE,
                     )
xdata <- findChromPeaks(raw_data, param = cwp)

# 2.ADAP Chromatogram Builder (GC-MS)
adap_param <- CentWaveParam(
  peakwidth = c(5, 20),
  noise = 1000,
  prefilter = c(3, 1000),
  snthresh = 10,
  mzCenterFun = "wMean",
  integrate = 1,
  fitgauss = FALSE,
  mzdiff = 0.001,
  ppm = 30
)
xdata <- findChromPeaks(raw_data, param = adap_param)

# 3.ADAP Feature Resolver
cwt_param <- CentWaveParam(
  peakwidth = c(5, 40),
  noise = 500,
  snthresh = 4,
  mzdiff = 0.001,
  integrate = 1,
  fitgauss = FALSE,
  mzCenterFun = "wMean",
  prefilter = c(3, 1000),
  ppm = 30
)
xdata <- findChromPeaks(raw_data, param = cwt_param)

# 4.Multivariate Curve Resolution
mcr_param <- PeakDensityParam(
  sampleGroups = c(1),
  minFraction = 0.5,
  bw = 0.2,
  minSamples = 1,
  binSize = 0.05
)
xdata <- groupChromPeaks(xdata, param = mcr_param)

# 5.ADAP Alignment
align_param <- ObiwarpParam(
  binSize = 0.3,
  response = 1,
  distFun = "cor_opt",
  gapInit = 0.3,
  gapExtend = 2.4,
  factorDiag = 2,
  factorGap = 1,
  localAlignment = FALSE
)
xdata <- adjustRtime(xdata, param = align_param)

# 6.Gap filling
fill_param <- FillChromPeaksParam(ppm = 5)
xdata <- fillChromPeaks(xdata, param = fill_param)

v-v1150n avatar Jun 19 '24 05:06 v-v1150n