Closed mwgard closed 3 years ago
Hi, thanks for reporting. Are you able to reproduce with either the faahKO or mtbls2 data packages ? That makes debugging much easier. Yours, Steffen
I tried it out using the first datafile in the mtbls2 data package and receive the same error when fitgauss = T
.
library(xcms)
library(data.table)
library(Risa)
library(mtbls2)
ISAmtbls2 <- readISAtab(find.package("mtbls2"))
a.filename <- ISAmtbls2["assay.filenames"][[1]]
msfiles <- getAssayRawDataFilenames(ISAmtbls2@assay.tabs[[1]], full.path = TRUE)[,1]
adf <- getAnnotatedDataFrameAssay(ISAmtbls2, assay.filename = a.filename)
xcms_raw <- MSnbase::readMSData(files = msfiles[1],
pdata = new("NAnnotatedDataFrame", pData(adf)[1,]),
mode = "onDisk")
# fitgauss = F works
xcms_fList <- xcms::findChromPeaks(
xcms_raw,
param = xcms::CentWavePredIsoParam(ppm = 25, prefilter = c(3, 100),
peakwidth = c(20, 50), maxCharge = 1,
maxIso = 3, mzIntervalExtension = TRUE,
polarity = 'positive', snthresh = 10,
mzdiff = -0.001, fitgauss = F,
noise = 0, verboseColumns = TRUE,
firstBaselineCheck = TRUE),
BPPARAM = SerialParam())
Detecting mass traces at 25 ppm ... OK Detecting chromatographic peaks in 2686 regions of interest ... OK: 1580 found. Detecting chromatographic peaks in 4196 regions of interest ... OK: 204 found.
# fitgauss = T fails xcms_fList <- xcms::findChromPeaks( xcms_raw, param = xcms::CentWavePredIsoParam(ppm = 25, prefilter = c(3, 100), peakwidth = c(20, 50), maxCharge = 1, maxIso = 3, mzIntervalExtension = TRUE, polarity = 'positive', snthresh = 10, mzdiff = -0.001, fitgauss = T, noise = 0, verboseColumns = TRUE, firstBaselineCheck = TRUE), BPPARAM = SerialParam())
Detecting mass traces at 25 ppm ... OK Detecting chromatographic peaks in 2686 regions of interest ... OK: 1580 found. Error in do_findChromPeaks_addPredIsoROIs(mz = mz, int = int, scantime = scantime, : Error in scanrange
Great. Ok, not great. But definitely reproducible then. Thanks, Yours, Steffen
I'll look into it.
So far I was able to track that error down to the C++ getEIC
function. What puzzles me is how this can be related to fitgauss
.
So far I was able to track that error down to the C++
getEIC
function. What puzzles me is how this can be related tofitgauss
.
It re-extracts the EIC to do the fit?
actually, it re-extracts the EIC for the possible isotopes. I think the problem is that the scan indices somehow get messed up somewhere.
I guess it has to do with the chrom peak boundaries that are different with fitgauss = TRUE
and fitgauss = FALSE
.
I've fixed it now by avoiding to run the second centWave run on ROI with illegal boundaries (i.e. scan ranged). @mwgard you can install the version with the fix using:
Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true")
BiocManager::install("sneumann/xcms", ref = "RELEASE_3_12")
I'm closing the issue now. Feel free to re-open if the error persists
Thanks!
I have been consistently receiving an error when running
findChromPeaks-centWaveWithPredIsoROIs
as described below. It appears to be due to setting the argumentfitgauss = T
. The example below is for a single LC-HRAM-MS2 mzML datafile and I've been able to repeat this error using any of my datafiles. It appears to perform the first peak finding with centWave fine, but fails on the second peak finding with the isotope ROIs. I don't absolutely need to setfitgauss = T
, but I've typically used it in the past with previous versions of xcms (and other peak finding algorithms). I do not receive this error when I just runfindChromPeaks-centWave
. I'm guessing the ROIs are maybe being put outside the retention time window of mzML file due to poorly fit gaussian peak shapes. I'll be moving forward settingfitgauss = F
, but wanted to let you know about this issue I've been seeing. ThankssessionInfo()