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

Bad istream when reading mzML file #249

Closed ricoderks closed 2 years ago

ricoderks commented 2 years ago

Hi Steffen,

I've been using XCMS for quite a while now and love it! I'am now trying to read some SIM data with the function readSRMData from MSnbase package, but I'am getting the following error:

Error: Can not open file /home/ricoderks/Documents/LUMC/Projects/prot_eisa/Data/mzML/sir/080621_sir_std_conv_100nM_1.mzML! Original error was: Error in pwizModule$open(filename): [SpectrumList_mzML::create()] Bad istream.
11.
stop("Can not open file ", filename, "! Original error was: ", e, call. = FALSE)
10.
value[[3L]](cond)
9.
tryCatchOne(expr, names, parentenv, handlers[[1L]])
8.
tryCatchList(expr, classes, parentenv, handlers)
7.
tryCatch(pwizModule$open(filename), error = function(e) { stop("Can not open file ", filename, "! Original error was: ", e, call. = FALSE) })
6.
mzR::openMSfile(x, backend = NULL)
5.
.openMSfile(x)
4.
FUN(X[[i]], ...)
3.
lapply(files, function(x) { msf <- .openMSfile(x) if (!is(msf, "mzRpwiz")) stop("Can only extract chromatogram information from a mzML file", ...
2.
lapply(files, function(x) { msf <- .openMSfile(x) if (!is(msf, "mzRpwiz")) stop("Can only extract chromatogram information from a mzML file", ...
1.
MSnbase::readSRMData(files = mzml_files[49])

I traced it back to openMSfile. I compared it to previous files I tried to read and the only difference I can find is the amount of SIM traces.

I'am using mzR 2.26.1, MSnbase 2.18.0 and xcms 3.14.1.

Can you help me with this? If needed I can send / upload you the mzML file.

Cheers, Rico

 version  R version 4.1.1 (2021-08-10)
 os       Ubuntu 20.04.2 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language en_GB                       
 collate  en_GB.UTF-8                 
 ctype    en_GB.UTF-8                 
 tz       Europe/Amsterdam            
 date     2021-08-16   

 package              * version  date       lib source                            
 affy                   1.70.0   2021-05-19 [1] Bioconductor                      
 affyio                 1.62.0   2021-05-19 [1] Bioconductor                      
 assertthat             0.2.1    2019-03-21 [1] CRAN (R 4.1.0)                    
 backports              1.2.1    2020-12-09 [1] CRAN (R 4.1.0)                    
 Biobase                2.52.0   2021-05-19 [1] Bioconductor                      
 BiocGenerics           0.38.0   2021-05-19 [1] Bioconductor                      
 BiocManager            1.30.16  2021-06-15 [1] CRAN (R 4.1.0)                    
 BiocParallel           1.26.1   2021-07-04 [1] Bioconductor                      
 bitops                 1.0-7    2021-04-24 [1] CRAN (R 4.1.0)                    
 broom                  0.7.9    2021-07-27 [1] CRAN (R 4.1.0)                    
 cellranger             1.1.0    2016-07-27 [1] CRAN (R 4.1.0)                    
 cli                    3.0.1    2021-07-17 [1] CRAN (R 4.1.0)                    
 clue                   0.3-59   2021-04-16 [1] CRAN (R 4.1.0)                    
 cluster                2.1.2    2021-04-17 [4] CRAN (R 4.0.5)                    
 codetools              0.2-18   2020-11-04 [4] CRAN (R 4.0.3)                    
 colorspace             2.0-2    2021-06-24 [1] CRAN (R 4.1.0)                    
 crayon                 1.4.1    2021-02-08 [1] CRAN (R 4.1.0)                    
 DBI                    1.1.1    2021-01-15 [1] CRAN (R 4.1.0)                    
 dbplyr                 2.1.1    2021-04-06 [1] CRAN (R 4.1.0)                    
 DelayedArray           0.18.0   2021-05-19 [1] Bioconductor                      
 DEoptimR               1.0-9    2021-05-24 [1] CRAN (R 4.1.0)                    
 digest                 0.6.27   2020-10-24 [1] CRAN (R 4.1.0)                    
 doParallel             1.0.16   2020-10-16 [1] CRAN (R 4.1.0)                    
 dplyr                * 1.0.7    2021-06-18 [1] CRAN (R 4.1.0)                    
 ellipsis               0.3.2    2021-04-29 [1] CRAN (R 4.1.0)                    
 evaluate               0.14     2019-05-28 [1] CRAN (R 4.1.0)                    
 fansi                  0.5.0    2021-05-25 [1] CRAN (R 4.1.0)                    
 farver                 2.1.0    2021-02-28 [1] CRAN (R 4.1.0)                    
 forcats              * 0.5.1    2021-01-27 [1] CRAN (R 4.1.0)                    
 foreach                1.5.1    2020-10-15 [1] CRAN (R 4.1.0)                    
 fs                     1.5.0    2020-07-31 [1] CRAN (R 4.1.0)                    
 generics               0.1.0    2020-10-31 [1] CRAN (R 4.1.0)                    
 GenomeInfoDb           1.28.1   2021-07-01 [1] Bioconductor                      
 GenomeInfoDbData       1.2.6    2021-06-24 [1] Bioconductor                      
 GenomicRanges          1.44.0   2021-05-19 [1] Bioconductor                      
 ggforce                0.3.3    2021-03-05 [1] CRAN (R 4.1.0)                    
 ggplot2              * 3.3.5    2021-06-25 [1] CRAN (R 4.1.0)                    
 glue                   1.4.2    2020-08-27 [1] CRAN (R 4.1.0)                    
 gtable                 0.3.0    2019-03-25 [1] CRAN (R 4.1.0)                    
 haven                  2.4.3    2021-08-04 [1] CRAN (R 4.1.0)                    
 here                 * 1.0.1    2020-12-13 [1] CRAN (R 4.1.0)                    
 hms                    1.1.0    2021-05-17 [1] CRAN (R 4.1.0)                    
 htmltools              0.5.1.1  2021-01-22 [1] CRAN (R 4.1.0)                    
 httr                   1.4.2    2020-07-20 [1] CRAN (R 4.1.0)                    
 impute                 1.66.0   2021-05-19 [1] Bioconductor                      
 IRanges                2.26.0   2021-05-19 [1] Bioconductor                      
 iterators              1.0.13   2020-10-15 [1] CRAN (R 4.1.0)                    
 jsonlite               1.7.2    2020-12-09 [1] CRAN (R 4.1.0)                    
 knitr                  1.33     2021-04-24 [1] CRAN (R 4.1.0)                    
 labeling               0.4.2    2020-10-20 [1] CRAN (R 4.1.0)                    
 lattice                0.20-44  2021-05-02 [4] CRAN (R 4.1.0)                    
 lifecycle              1.0.0    2021-02-15 [1] CRAN (R 4.1.0)                    
 limma                  3.48.2   2021-08-08 [1] Bioconductor                      
 lubridate              1.7.10   2021-02-26 [1] CRAN (R 4.1.0)                    
 magrittr               2.0.1    2020-11-17 [1] CRAN (R 4.1.0)                    
 MALDIquant             1.20     2021-07-29 [1] CRAN (R 4.1.0)                    
 MASS                   7.3-54   2021-05-03 [4] CRAN (R 4.0.5)                    
 MassSpecWavelet        1.58.0   2021-05-19 [1] Bioconductor                      
 Matrix                 1.3-4    2021-06-01 [4] CRAN (R 4.1.0)                    
 MatrixGenerics         1.4.2    2021-08-08 [1] Bioconductor                      
 matrixStats            0.60.0   2021-07-26 [1] CRAN (R 4.1.0)                    
 modelr                 0.1.8    2020-05-19 [1] CRAN (R 4.1.0)                    
 MsCoreUtils            1.4.0    2021-05-19 [1] Bioconductor                      
 MSnbase                2.18.0   2021-05-19 [1] Bioconductor                      
 munsell                0.5.0    2018-06-12 [1] CRAN (R 4.1.0)                    
 mzID                   1.30.0   2021-05-19 [1] Bioconductor                      
 mzR                    2.26.1   2021-06-20 [1] Bioconductor                      
 ncdf4                  1.17     2019-10-23 [1] CRAN (R 4.1.0)                    
 pcaMethods             1.84.0   2021-05-19 [1] Bioconductor                      
 pillar                 1.6.2    2021-07-29 [1] CRAN (R 4.1.0)                    
 pkgconfig              2.0.3    2019-09-22 [1] CRAN (R 4.1.0)                    
 plyr                   1.8.6    2020-03-03 [1] CRAN (R 4.1.0)                    
 polyclip               1.10-0   2019-03-14 [1] CRAN (R 4.1.0)                    
 preprocessCore         1.54.0   2021-05-19 [1] Bioconductor                      
 ProtGenerics           1.24.0   2021-05-19 [1] Bioconductor                      
 purrr                * 0.3.4    2020-04-17 [1] CRAN (R 4.1.0)                    
 R6                     2.5.0    2020-10-28 [1] CRAN (R 4.1.0)                    
 RANN                   2.6.1    2019-01-08 [1] CRAN (R 4.1.0)                    
 RColorBrewer           1.1-2    2014-12-07 [1] CRAN (R 4.1.0)                    
 Rcpp                   1.0.7    2021-07-07 [1] CRAN (R 4.1.0)                    
 RCurl                  1.98-1.3 2021-03-16 [1] CRAN (R 4.1.0)                    
 readr                * 2.0.1    2021-08-10 [1] CRAN (R 4.1.0)                    
 readxl                 1.3.1    2019-03-13 [1] CRAN (R 4.1.0)                    
 reprex                 2.0.1    2021-08-05 [1] CRAN (R 4.1.0)                    
 rlang                  0.4.11   2021-04-30 [1] CRAN (R 4.1.0)                    
 rmarkdown              2.10     2021-08-06 [1] CRAN (R 4.1.0)                    
 robustbase             0.93-8   2021-06-02 [1] CRAN (R 4.1.0)                    
 rprojroot              2.0.2    2020-11-15 [1] CRAN (R 4.1.0)                    
 rstudioapi             0.13     2020-11-12 [1] CRAN (R 4.1.0)                    
 rvest                  1.0.1    2021-07-26 [1] CRAN (R 4.1.0)                    
 S4Vectors              0.30.0   2021-05-19 [1] Bioconductor                      
 scales                 1.1.1    2020-05-11 [1] CRAN (R 4.1.0)                    
 sessioninfo            1.1.1    2018-11-05 [1] CRAN (R 4.1.0)                    
 stringi                1.7.3    2021-07-16 [1] CRAN (R 4.1.0)                    
 stringr              * 1.4.0    2019-02-10 [1] CRAN (R 4.1.0)                    
 SummarizedExperiment   1.22.0   2021-05-19 [1] Bioconductor                      
 tibble               * 3.1.3    2021-07-23 [1] CRAN (R 4.1.0)                    
 tidyr                * 1.1.3    2021-03-03 [1] CRAN (R 4.1.0)                    
 tidyselect             1.1.1    2021-04-30 [1] CRAN (R 4.1.0)                    
 tidyverse            * 1.3.1    2021-04-15 [1] CRAN (R 4.1.0)                    
 tweenr                 1.0.2    2021-03-23 [1] CRAN (R 4.1.0)                    
 tzdb                   0.1.2    2021-07-20 [1] CRAN (R 4.1.0)                    
 utf8                   1.2.2    2021-07-24 [1] CRAN (R 4.1.0)                    
 vctrs                  0.3.8    2021-04-29 [1] CRAN (R 4.1.0)                    
 vsn                    3.60.0   2021-05-19 [1] Bioconductor                      
 withr                  2.4.2    2021-04-18 [1] CRAN (R 4.1.0)                    
 xcms                   3.14.1   2021-07-27 [1] Bioconductor                      
 xfun                   0.25     2021-08-06 [1] CRAN (R 4.1.0)                    
 XML                    3.99-0.6 2021-03-16 [1] CRAN (R 4.1.0)                    
 xml2                   1.3.2    2020-04-23 [1] CRAN (R 4.1.0)                    
 XVector                0.32.0   2021-05-19 [1] Bioconductor                      
 yaml                   2.2.1    2020-02-01 [1] CRAN (R 4.1.0)                    
 zlibbioc               1.38.0   2021-05-19 [1] Bioconductor 
ricoderks commented 2 years ago

A small update. I recreated the mzML files with msconvert (using the docker container from proteowizard) with the parameter --noindex and now it is possbile to read the files. I don't know why it goes wrong if you don't use this parameter. It looks like the issue is not with mzR.