sneumann / xcms

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

Error related with findChromPeaks method with mslevel 0 #338

Open raagbtitl opened 5 years ago

raagbtitl commented 5 years ago

I am getting following error when I am using findChromPeaks on mzXML files:

xdata <-

Error in (function (cl, name, valueClass) : ‘fromFile’ is not a slot in class “NULL” Information about parameters, raw_data and sessionInfo give below:

cwp Object of class: CentWaveParam Parameters: ppm: 5 peakwidth: 10, 60 snthresh: 5 prefilter: 3, 100 mzCenterFun: wMean integrate: 1 mzdiff: 0.005 fitgauss: FALSE noise: 0 verboseColumns: FALSE roiList length: 0 firstBaselineCheck TRUE roiScales length: 0

raw_data MSn experiment data ("OnDiskMSnExp") Object size in memory: 25.39 Mb

      • Spectra data - - - MS level(s): 0 1 Number of spectra: 106086 MSn retention times: 0:0 - 40:0 minutes
      • Processing information - - - Data loaded [Wed Dec 12 09:44:03 2018] MSnbase version: 2.7.3
      • Meta data - - - phenoData rowNames: 1 2 ... 6 (6 total) varLabels: sample_name sample_group varMetadata: labelDescription Loaded from: [1] blank_C18_NEG_23Oct18_3.mzXML... [6] Mouse_feces_C18_NEG_sa2_inj2.mzXML Use 'fileNames(.)' to see all files. protocolData: none featureData featureNames: F1.S00001 F1.S00002 ... F6.S17681 (106086 total) fvarLabels: fileIdx spIdx ... spectrum (29 total) fvarMetadata: labelDescription experimentData: use 'experimentData(object)'

sessionInfo() R version 3.5.0 (2018-04-23) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] xMSannotator_1.3.2 Rdisop_1.41.0 RcppClassic_0.9.11 [4] pcaMethods_1.73.0 flashClust_1.01-2 KEGGREST_1.21.1 [7] plyr_1.8.4 rjson_0.2.20 png_0.1-7 [10] SSOAP_0.9-0 doSNOW_1.0.16 snow_0.4-3 [13] iterators_1.0.10 foreach_1.4.4 RCurl_1.95-4.11 [16] bitops_1.0-6 WGCNA_1.63 fastcluster_1.1.25 [19] dynamicTreeCut_1.63-1 R2HTML_2.3.2 XML_3.98-1.16 [22] MSEAp_0.0.0.9000 MSEApdata_0.0.0.9000 dplyr_0.7.6 [25] optparse_1.6.0 magrittr_1.5 RColorBrewer_1.1-2 [28] MAIT_1.15.0 pls_2.6-0 CAMERA_1.37.0 [31] xcms_3.3.2 MSnbase_2.7.3 ProtGenerics_1.13.0 [34] mzR_2.15.1 Rcpp_0.12.18 Biobase_2.41.2 [37] BiocGenerics_0.27.1 BiocParallel_1.15.8

loaded via a namespace (and not attached): [1] questionr_0.6.3 tidyselect_0.2.4 robust_0.4-18 [4] plsgenomics_1.5-1 RSQLite_2.1.1 AnnotationDbi_1.43.1 [7] htmlwidgets_1.2 grid_3.5.0 combinat_0.0-8 [10] munsell_0.5.0 codetools_0.2-15 preprocessCore_1.43.0 [13] miniUI_0.1.1.1 withr_2.1.2 colorspace_1.3-2 [16] BiocInstaller_1.31.3 highr_0.7 knitr_1.20 [19] AlgDesign_1.1-7.3 rstudioapi_0.7 geometry_0.3-6 [22] stats4_3.5.0 robustbase_0.93-2 dimRed_0.1.0 [25] mzID_1.19.0 bit64_0.9-7 coda_0.19-1 [28] LearnBayes_2.15.1 ipred_0.9-6 R6_2.2.2 [31] doParallel_1.0.11 fields_9.6 DRR_0.0.3 [34] assertthat_0.2.0 promises_1.0.1 scales_1.0.0 [37] nnet_7.3-12 gtable_0.2.0 affy_1.59.0 [40] ddalpha_1.3.4 spam_2.2-0 timeDate_3043.102 [43] rlang_0.2.1 CVST_0.2-2 RcppRoll_0.3.0 [46] splines_3.5.0 lazyeval_0.2.1 ModelMetrics_1.2.0 [49] acepack_1.4.1 impute_1.55.0 broom_0.5.0 [52] checkmate_1.8.5 reshape2_1.4.3 abind_1.4-5 [55] backports_1.1.2 httpuv_1.4.5 Hmisc_4.1-1 [58] MassSpecWavelet_1.47.0 RBGL_1.57.0 caret_6.0-80 [61] lava_1.6.3 spData_0.2.9.3 ggplot2_3.0.0 [64] affyio_1.51.0 gplots_3.0.1 base64enc_0.1-3 [67] zlibbioc_1.27.0 purrr_0.2.5 rpart_4.1-13 [70] deldir_0.1-15 S4Vectors_0.19.19 sfsmisc_1.1-2 [73] cluster_2.0.7-1 data.table_1.11.4 XMLSchema_0.8-0 [76] gmodels_2.18.1 RANN_2.6 mvtnorm_1.0-8 [79] matrixStats_0.54.0 mime_0.5 xtable_1.8-2 [82] klaR_0.6-14 RhpcBLASctl_0.18-205 IRanges_2.15.16 [85] gridExtra_2.3 compiler_3.5.0 tibble_1.4.2 [88] maps_3.3.0 KernSmooth_2.23-15 crayon_1.3.4 [91] agricolae_1.2-8 htmltools_0.3.6 pcaPP_1.9-73 [94] later_0.7.3 spdep_0.7-7 Formula_1.2-3 [97] tidyr_0.8.1 rrcov_1.4-4 expm_0.999-2 [100] lubridate_1.7.4 DBI_1.0.0 magic_1.5-8 [103] MASS_7.3-50 boot_1.3-20 Matrix_1.2-14 [106] getopt_1.20.2 vsn_3.49.1 gdata_2.18.0 [109] dotCall64_1.0-0 bindr_0.1.1 gower_0.1.2 [112] igraph_1.2.2 pkgconfig_2.0.1 fit.models_0.5-14 [115] foreign_0.8-71 sp_1.3-1 recipes_0.1.3 [118] MALDIquant_1.18 XVector_0.21.3 multtest_2.37.0 [121] prodlim_2018.04.18 stringr_1.3.1 digest_0.6.15 [124] graph_1.59.0 Biostrings_2.49.1 htmlTable_1.12 [127] kernlab_0.9-27 shiny_1.1.0 gtools_3.8.1 [130] nlme_3.1-137 bindrcpp_0.2.2 limma_3.37.3 [133] pillar_1.3.0 lattice_0.20-35 httr_1.3.1 [136] DEoptimR_1.0-8 survival_2.42-6 GO.db_3.6.0 [139] glue_1.3.0 bit_1.1-14 class_7.3-14 [142] stringi_1.2.4 blob_1.1.1 latticeExtra_0.6-28 [145] caTools_1.17.1.1 memoise_1.1.0 e1071_1.7-0

stanstrup commented 5 years ago

msLevel=0? Is that UV data? Msnbase didn't work with msLevel=0 scans when I tried to abuse it for UV data.

jorainer commented 5 years ago

msLevel = 0? so the mzXML files still have spectra in it? What's the difference between MS1 and MS0? Can one assume such spectra are equivalent?

stanstrup commented 5 years ago

How were these files recorded and converted? This seem like a wrong implementation of the conversion. "polarity" is supposed to denote polarity with 0 for negative, +1 for positive. msLevel is supposed to be MS1 for scan data, MS2 for tandem experiments and so on.

jorainer commented 5 years ago

@stanstrup is right. The reason for your error essentially is that MSnbase does not know what to do with a MS level 0 data. The old xcms did not really care about MS levels or polarity, but know we support that too - and there is the possibility to filter your data set by polarity after reading it, if you have a data set that contains both positive and negative polarity data.

Lasseeli commented 3 years ago

msLevel=0? Is that UV data? Msnbase didn't work with msLevel=0 scans when I tried to abuse it for UV data.

Hey! I have UV data stored as MS0, and i am able to open them easily with SeeMS software, but how do i use MSnBase to access these? Or is there a package that can access it? Thanks in advance.

jorainer commented 3 years ago

In which file format do you have your data? one possiblity would be to replace the MS0 with MS1 in the raw data files... or maybe read them with Spectra, change the MS level and export again to mzML:

library(Spectra)
origfile <- <your original raw data file>
sps <- Spectra(origfile, MsBackendMzR())
sps$msLevel <- sps$msLevel + 1L
newfile <- <your new file name>
export(newfile, backend = MsBackendMzR())

After that you should be able to use your files with MSnbase and xcms.

Lasseeli commented 3 years ago

Thank you so much! I will try your solution soon and get back to you.

They came from a Waters Synapt g2 instrument and I used msconvert to both mzml and mzxml. In mzml the UV spectrum is detected and I think/assume it is lost when converting to XML (at least, it's not detected by SeeMS...).

Kind regards, Lasse

-------- Opprinnelig melding -------- Fra: Johannes Rainer @.> Dato: 10.06.2021 11:23 (GMT+01:00) Til: sneumann/xcms @.> Ko: Lasseeli @.>, Comment @.> Emne: Re: [sneumann/xcms] Error related with findChromPeaks method with mslevel 0 (#338)

In which file format do you have your data? one possiblity would be to replace the MS0 with MS1 in the raw data files... or maybe read them with Spectra, change the MS level and export again to mzML:

library(Spectra) origfile <- sps <- Spectra(origfile, MsBackendMzR()) sps$msLevel <- sps$msLevel + 1L newfile <- export(newfile, backend = MsBackendMzR())

After that you should be able to use your files with MSnbase and xcms.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/sneumann/xcms/issues/338#issuecomment-858462115, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANI6VDJZ5HPQ6BRPTLURBWDTSB77ZANCNFSM4GJ5JRRQ.