sneumann / mzR

This is the git repository matching the Bioconductor package mzR: parser for netCDF, mzXML, mzData and mzML files (mass spectrometry data)
40 stars 26 forks source link

error parsing a converted mzML file #215

Closed rcastelo closed 4 years ago

rcastelo commented 4 years ago

Hi, This issue arose during the discussion on another issue in the MsBackendRawFileReader package.

I'm getting the error below when converting first a .raw file into a '.mzMLfile and then trying to parse it into anSpectra` object. These are the steps to reproduce the error.

  1. convert this .raw file into a .mzML file using mono and ThermoRawFileParser in the unix shell:
$ mono /opt/ThermoRawFileParser/ThermoRawFileParser.exe \
    -i=180506_S_ROCA_11_01_BS13.raw -o=output/
2019-12-12 18:07:54 INFO Started parsing 180506_S_ROCA_11_01_BS13.raw
2019-12-12 18:07:54 INFO Processing 27604 scans
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% 
2019-12-12 18:09:53 INFO Finished parsing 180506_S_ROCA_11_01_BS13.raw
$ ls output/
180506_S_ROCA_11_01_BS13.mzML
  1. Try to import the converted .mzML file into an Spectra object:
library(Spectra)

fls <- "output/180506_S_ROCA_11_01_BS13.mzML"
sp <- Spectra(fls, backend=MsBackendMzR())
Error: Can not open file /Users/robert/Lab/EuroBioC2019/Proteomics/output/180506_S_ROCA_11_01_BS13.mzML
! Original error was: Error in pwizModule$open(filename): Invalid cvParam accession "1002732"
traceback()
20: stop(e)
19: value[[3L]](cond)
18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
17: tryCatchList(expr, classes, parentenv, handlers)
16: tryCatch({
        FUN(...)
    }, error = handle_error)
15: withCallingHandlers({
        tryCatch({
            FUN(...)
        }, error = handle_error)
    }, warning = handle_warning)
14: FUN(...)
13: FUN(X[[i]], ...)
12: lapply(X, FUN_, ...)
11: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = param)
10: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = param)
9: bplapply(files, FUN = function(fl) {
       cbind(Spectra:::.mzR_header(fl), dataStorage = fl)
   }, BPPARAM = BPPARAM)
8: bplapply(files, FUN = function(fl) {
       cbind(Spectra:::.mzR_header(fl), dataStorage = fl)
   }, BPPARAM = BPPARAM)
7: do.call(rbind, bplapply(files, FUN = function(fl) {
       cbind(Spectra:::.mzR_header(fl), dataStorage = fl)
   }, BPPARAM = BPPARAM))
6: .local(object, ...)
5: backendInitialize(source, object, ..., BPPARAM = BPPARAM)
4: backendInitialize(source, object, ..., BPPARAM = BPPARAM)
3: .local(object, ...)
2: Spectra(fls, backend = MsBackendMzR())
1: Spectra(fls, backend = MsBackendMzR())
sessionInfo()
R Under development (unstable) (2019-11-05 r77372)
Platform: x86_64-apple-darwin16.7.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS:   /opt/R/R-devel/lib/R/lib/libRblas.dylib
LAPACK: /opt/R/R-devel/lib/R/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] Spectra_0.3.0       ProtGenerics_1.19.0 BiocParallel_1.21.0
[4] S4Vectors_0.25.6    BiocGenerics_0.33.0 colorout_1.2-2     

loaded via a namespace (and not attached):
[1] compiler_4.0.0    IRanges_2.21.2    tools_4.0.0       MsCoreUtils_0.0.2
[5] mzR_2.21.0        Rcpp_1.0.3        Biobase_2.47.1    codetools_0.2-16 
[9] ncdf4_1.17       

thanks!

robert.

jorainer commented 4 years ago

The error is a result of a CV ID which was written into the mzML file which proteowizard (at least the version we're using in mzR) does not recognize. The list of CV IDs can be found here. This is the ID for the MS used to record the sample:

[Term]
id: MS:1002732
name: Orbitrap Fusion Lumos
def: "Thermo Scientific Orbitrap Fusion Lumos mass spectrometer with Tribrid architecture consisting of quadrupole mass filter, linear ion trap and Orbitrap mass analyzers." [PSI:PI]
is_a: MS:1000494 ! Thermo Scientific instrument model

Probably the fastest way around would be to edit the mzML file (it's just a simple xml file) and delete the corresponding entry.

sneumann commented 4 years ago

Hi Robert, can you try the current sneumann/mzR or the 2.21.1 once it is out, possibly on Monday ? I just merged a new set of CV terms. Yours, Steffen

rcastelo commented 4 years ago

Steffen, Johannes, thank you very much for your fast response. I've updated to mzR 2.21.1 and now the 'Spectra()' function reads the converted .mzML file without any error.

Thanks again!!!