sneumann / xcms

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

Error in object@backend$getPeakList(scans) : Invalid cvParam accession "1003007" #503

Open lingjuewang opened 4 years ago

lingjuewang commented 4 years ago

Dear contributors,

I encountered an error while using XCMS to process a mzML file with combined ion-mobility scans. This data file was converted using "combine ion mobility scans" function in MSconvert (3.0.20133-4ec330cb1).

Here are some info of my R script.

library(xcms)
library(magrittr)

mzml <- dir("./", pattern = "new.mzML")
pd <- data.frame(sample_name = sub(basename(mzml), pattern = ".mzML", replacement = "", fixed = TRUE),
                     sample_group = rep("new_IM_combined",1),
                     stringsAsFactors = FALSE)
raw_data <- readMSData(files = mzml, pdata = new("NAnnotatedDataFrame",pd),mode = "onDisk")
raw_data@featureData@data %>% head

cwp <- CentWaveParam(ppm = 20, peakwidth = c(5,40), prefilter = c(3,500), snthresh = 5)
xchr <- findChromPeaks(raw_data, param = cwp)

Error information:

Error in object@backend$getPeakList(scans) : 
  Invalid cvParam accession "1003007"

traceback():

> traceback()
16: stop(e)
15: value[[3L]](cond)
14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
13: tryCatchList(expr, classes, parentenv, handlers)
12: tryCatch({
        FUN(...)
    }, error = handle_error)
11: withCallingHandlers({
        tryCatch({
            FUN(...)
        }, error = handle_error)
    }, warning = handle_warning)
10: FUN(...)
9: FUN(X[[i]], ...)
8: lapply(X, FUN_, ...)
7: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = param)
6: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = param)
5: bplapply(object_mslevel, FUN = findChromPeaks_OnDiskMSnExp, method = "centWave", 
       param = param, BPPARAM = BPPARAM)
4: bplapply(object_mslevel, FUN = findChromPeaks_OnDiskMSnExp, method = "centWave", 
       param = param, BPPARAM = BPPARAM)
3: .local(object, param, ...)
2: findChromPeaks(raw_data, param = cwp)
1: findChromPeaks(raw_data, param = cwp)

Session Info:

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] magrittr_1.5        xcms_3.8.2          MSnbase_2.12.0      ProtGenerics_1.18.0 S4Vectors_0.24.4    mzR_2.20.0          Rcpp_1.0.4.6       
 [8] BiocParallel_1.20.1 Biobase_2.46.0      BiocGenerics_0.32.0

loaded via a namespace (and not attached):
 [1] RColorBrewer_1.1-2     DEoptimR_1.0-8         BiocManager_1.30.10    compiler_3.6.3         pillar_1.4.4           plyr_1.8.6            
 [7] iterators_1.0.12       zlibbioc_1.32.0        tools_3.6.3            digest_0.6.25          ncdf4_1.17             MALDIquant_1.19.3     
[13] lifecycle_0.2.0        tibble_3.0.2           preprocessCore_1.48.0  gtable_0.3.0           lattice_0.20-41        pkgconfig_2.0.3       
[19] rlang_0.4.6            Matrix_1.2-18          foreach_1.5.0          rstudioapi_0.11        dplyr_1.0.0            IRanges_2.20.2        
[25] generics_0.0.2         vctrs_0.3.1            multtest_2.42.0        grid_3.6.3             tidyselect_1.1.0       robustbase_0.93-6     
[31] glue_1.4.1             impute_1.60.0          R6_2.4.1               survival_3.1-12        XML_3.99-0.3           RANN_2.6.1            
[37] limma_3.42.2           ggplot2_3.3.2          purrr_0.3.4            splines_3.6.3          scales_1.1.1           pcaMethods_1.78.0     
[43] codetools_0.2-16       ellipsis_0.3.1         MASS_7.3-51.6          MassSpecWavelet_1.52.0 mzID_1.24.0            colorspace_1.4-1      
[49] affy_1.64.0            doParallel_1.0.15      munsell_0.5.0          vsn_3.54.0             crayon_1.3.4           affyio_1.56.0 

Does anyone have an idea on how this could be resolved? I have had no trouble running this before but could no longer make it work after MSConvert updated at some point. The only thing I could notice being changed was the "spectrumId" column in the OnDiskMSnExp object.

> raw_data@featureData@data %>% head
        fileIdx spIdx smoothed seqNum acquisitionNum msLevel polarity originalPeaksCount totIonCurrent retentionTime basePeakMZ basePeakIntensity
F1.S001       1     1       NA      1              1       1        1             100188       1420588         3.417          0                 0
F1.S002       1     2       NA      2              2       1        1              93503       1420733         4.562          0                 0
F1.S003       1     3       NA      3              3       1        1              99532       1440382         5.706          0                 0
F1.S004       1     4       NA      4              4       1        1             111433       1475069         6.851          0                 0
F1.S005       1     5       NA      5              5       1        1             101443       1466774         7.995          0                 0
F1.S006       1     6       NA      6              6       1        1              97472       1456877         9.140          0                 0
        collisionEnergy ionisationEnergy    lowMZ   highMZ precursorScanNum precursorMZ precursorCharge precursorIntensity mergedScan
F1.S001              NA                0 103.0579 1677.330               NA          NA              NA                 NA         NA
F1.S002              NA                0 104.3075 1617.811               NA          NA              NA                 NA         NA
F1.S003              NA                0 106.2480 1654.061               NA          NA              NA                 NA         NA
F1.S004              NA                0 104.9191 1636.054               NA          NA              NA                 NA         NA
F1.S005              NA                0 156.7585 1686.527               NA          NA              NA                 NA         NA
F1.S006              NA                0 124.2497 1647.860               NA          NA              NA                 NA         NA
        mergedResultScanNum mergedResultStartScanNum mergedResultEndScanNum injectionTime filterString       spectrumId centroided
F1.S001                  NA                       NA                     NA             0         <NA> merged=1 frame=1       TRUE
F1.S002                  NA                       NA                     NA             0         <NA> merged=2 frame=2       TRUE
F1.S003                  NA                       NA                     NA             0         <NA> merged=3 frame=3       TRUE
F1.S004                  NA                       NA                     NA             0         <NA> merged=4 frame=4       TRUE
F1.S005                  NA                       NA                     NA             0         <NA> merged=5 frame=5       TRUE
F1.S006                  NA                       NA                     NA             0         <NA> merged=6 frame=6       TRUE
        ionMobilityDriftTime isolationWindowTargetMZ isolationWindowLowerOffset isolationWindowUpperOffset scanWindowLowerLimit
F1.S001              29.9618                      NA                         NA                         NA             99.89902
F1.S002              29.9618                      NA                         NA                         NA             99.89902
F1.S003              29.9618                      NA                         NA                         NA             99.89902
F1.S004              29.9618                      NA                         NA                         NA             99.89902
F1.S005              29.9618                      NA                         NA                         NA             99.89902
F1.S006              29.9618                      NA                         NA                         NA             99.89902
        scanWindowUpperLimit spectrum
F1.S001             1699.315        1
F1.S002             1699.315        2
F1.S003             1699.315        3
F1.S004             1699.315        4
F1.S005             1699.315        5
F1.S006             1699.315        6

There was a related issue at mzR package a while ago that seems to rely on this column for spectra processing. [https://github.com/sneumann/mzR/issues/44] I will keep everyone posted if I figure out what is going on here.

Thanks for helping on this in advance.

Best, Lingjue

jorainer commented 4 years ago

I guess the solution to this would be to update the proteowizard version within mzR - and if I'm not wrong @sneumann tried to do that already but stumbled across some problems.