sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
188 stars 80 forks source link

Error in centWavePredIsoROIs #643

Open 13479776 opened 2 years ago

13479776 commented 2 years ago

Hi, guys,

I use the xcms for peak picking, the error was happened as follows when the centWavePredIsoROIs was used. However, no error was got when the centWave was used. The same parameters were used for centWavePredIsoROIs and centWave. Is this a bug? I request to a help. Thanks.

Error info. Detecting mass traces at 5 ppm ... OK Detecting chromatographic peaks in 3121 regions of interest ... OK: 1483 found. Detecting chromatographic peaks in 3873 regions of interest ... Error: BiocParallel errors 1 remote errors, element index: 1 2 unevaluated and other errors first remote error: Error in if (!(any(fd - baseline >= sdthr))) next: missing value where TRUE/FALSE needed

Best wishes, Hees

sneumann commented 2 years ago

Hi, I'd need to be able to reproduce this to give any help.

The error seems to be coming from this place: https://github.com/sneumann/xcms/blob/7cd6d61abd52a95d746745c510617c8b2fec9195/R/do_findChromPeaks-functions.R#L426

As described in the manpage, this will go two rounds and first obtain peaks with the parameters given, and then another round with more sensitive (but also prone to more false-positives) parameters on those ROIs that are predicted to be isotopes of peaks found in the first round. Yours, Steffen

13479776 commented 2 years ago

Hi Steffen,

I found the peakwidth caused the error. When the peakwidth was set as 20-80 instead of 20-50 (default in xcms), the error will be happened. I have uploaded the mzML data named QC11. Could you please give some help? thank you

best wishes, Hees

QC11.zip

Object of class: CentWavePredIsoParam Parameters:

Detecting mass traces at 5 ppm ... OK Detecting chromatographic peaks in 3220 regions of interest ... OK: 1467 found. Detecting chromatographic peaks in 5983 regions of interest ... Error: BiocParallel errors 1 remote errors, element index: 1 0 unevaluated and other errors first remote error: Error in if (!(any(fd - baseline >= sdthr))) next: missing value where TRUE/FALSE needed In addition: Warning message: In serialize(data, node$con) : 'package:stats' may not be available when loading

sneumann commented 2 years ago

can I have the cut&pasteable code snippet you used ? Yours, Steffen

13479776 commented 2 years ago

Hi, Steffen

I use the window system, the code was shown as follows,

library(xcms) dat <- readMSData("QC11.mzML",mode = c( "onDisk") ) p <- CentWavePredIsoParam() peakwidth(p) <- c(20,80) res <- findChromPeaks(dat, param = p)

error ######################################## Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:stats’:

IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, basename, cbind, colnames, dirname, do.call,
duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply,
Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply, union, unique, unsplit,
which.max, which.min

Welcome to Bioconductor

Vignettes contain introductory material; view with 'browseVignettes()'. To cite
Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

expand.grid, I, unname

Attaching package: ‘ProtGenerics’

The following object is masked from ‘package:stats’:

smooth

This is MSnbase version 2.22.0 Visit https://lgatto.github.io/MSnbase/ to get started.

Attaching package: ‘MSnbase’

The following object is masked from ‘package:base’:

trimws

This is xcms version 3.18.0

Attaching package: ‘xcms’

The following object is masked from ‘package:stats’:

sigma

Detecting mass traces at 25 ppm ... OK Detecting chromatographic peaks in 4049 regions of interest ... OK: 1472 found. Detecting chromatographic peaks in 9885 regions of interest ... Error: BiocParallel errors 1 remote errors, element index: 1 0 unevaluated and other errors first remote error: Error in if (!(any(fd - baseline >= sdthr))) next: missing value where TRUE/FALSE needed In addition: Warning message: In serialize(data, node$con) : 'package:stats' may not be available when loading