Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the steps of operating FillChromPeaksParam #754

Open
v-v1150n opened this issue Jun 19, 2024 · 3 comments
Open

Regarding the steps of operating FillChromPeaksParam #754

v-v1150n opened this issue Jun 19, 2024 · 3 comments

Comments

@v-v1150n
Copy link

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)
@jorainer
Copy link
Collaborator

Which versions of the packages are you using? could be that you use an old version of xcms.

@v-v1150n
Copy link
Author

My xcms package version is:

packageVersion("xcms")
[1] ‘4.3.1’

@jorainer
Copy link
Collaborator

I see, no, indeed, you are right. The use of FillChromPeaksParam is no longer supported with XcmsExperiment. This method notoriously underestimated the gap-filled data, thus it is highly suggested to use the ChromPeakAreaParam instead, that integrates the data from the m/z-rt ranges of the actually identified chromatographic peaks.

But note that I have also just recently implemented the possibility to change from a XcmsExperiment to XCMSnExp object - if you really want to apply the old method. This can be done with xdata <- as(xdata, "XCMSnExp") after installing the current xcms version from my branch (i.e. using BiocManager::install("sneumann/xcms", ref = "jomain").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants