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

Can't use quantify to get result into summarizedexperiment #760

Closed pablovgd closed 4 months ago

pablovgd commented 4 months ago

Hi,

I'm having trouble to use quantify() to convert my XcmsExperiment object into a SummarizedExperiment. Following error occurs when running res <- quantify(result, method = "sum"):

Error in SummarizedExperiment(assays = list(raw = featureValues(object,  : 
  the rownames and colnames of the supplied assay(s) must be NULL or identical to those of the SummarizedExperiment object (or derivative) to construct

Never had this issue before, didn't do anything extraordinary: peak picking, alignment, grouping, etc.

You can download the XcmsExperiment object here: https://filesender.belnet.be/?s=download&token=14fe2865-b9b7-4ca0-a4dd-8c38a548b7e6

Thanks again for helping out.

> sessionInfo()
R Under development (unstable) (2024-01-22 r85820 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_Belgium.utf8  LC_CTYPE=English_Belgium.utf8    LC_MONETARY=English_Belgium.utf8 LC_NUMERIC=C                     LC_TIME=English_Belgium.utf8    

time zone: Europe/Brussels
tzcode source: internal

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

other attached packages:
 [1] preprocessCore_1.66.0       RaMS_1.4.0                  SummarizedExperiment_1.34.0 Biobase_2.64.0              GenomicRanges_1.56.1        GenomeInfoDb_1.40.1        
 [7] IRanges_2.38.1              MatrixGenerics_1.16.0       matrixStats_1.3.0           ggplot2_3.5.1               dplyr_1.1.4                 squallms_0.99.6            
[13] RColorBrewer_1.1-3          Spectra_1.14.1              S4Vectors_0.42.1            BiocGenerics_0.50.0         MsExperiment_1.6.0          ProtGenerics_1.36.0        
[19] xcms_4.2.2                  BiocParallel_1.38.0        

loaded via a namespace (and not attached):
  [1] rstudioapi_0.16.0           jsonlite_1.8.8              MultiAssayExperiment_1.30.3 magrittr_2.0.3              MALDIquant_1.22.2           rmarkdown_2.27             
  [7] fs_1.6.4                    zlibbioc_1.50.0             vctrs_0.6.5                 base64enc_0.1-3             htmltools_0.5.8.1           S4Arrays_1.4.1             
 [13] progress_1.2.3              pROC_1.18.5                 SparseArray_1.4.8           caret_6.0-94                mzID_1.42.0                 parallelly_1.38.0          
 [19] htmlwidgets_1.6.4           plyr_1.8.9                  lubridate_1.9.3             impute_1.78.0               plotly_4.10.4               igraph_2.0.3               
 [25] mime_0.12                   lifecycle_1.0.4             iterators_1.0.14            pkgconfig_2.0.3             Matrix_1.6-5                R6_2.5.1                   
 [31] fastmap_1.2.0               future_1.34.0               GenomeInfoDbData_1.2.12     shiny_1.9.0                 clue_0.3-65                 digest_0.6.36              
 [37] pcaMethods_1.96.0           colorspace_2.1-1            timechange_0.3.0            fansi_1.0.6                 httr_1.4.7                  abind_1.4-5                
 [43] compiler_4.4.0              withr_3.0.0                 doParallel_1.0.17           DBI_1.2.3                   lava_1.8.0                  MASS_7.3-60.2              
 [49] DelayedArray_0.30.1         mzR_2.38.0                  ModelMetrics_1.2.2.2        tools_4.4.0                 PSMatch_1.8.0               httpuv_1.6.15              
 [55] future.apply_1.11.2         nnet_7.3-19                 glue_1.7.0                  nlme_3.1-164                QFeatures_1.14.2            promises_1.3.0             
 [61] grid_4.4.0                  cluster_2.1.6               reshape2_1.4.4              generics_0.1.3              recipes_1.1.0               gtable_0.3.5               
 [67] class_7.3-22                tidyr_1.3.1                 data.table_1.15.4           hms_1.1.3                   MetaboCoreUtils_1.12.0      xml2_1.3.6                 
 [73] utf8_1.2.4                  XVector_0.44.0              foreach_1.5.2               pillar_1.9.0                stringr_1.5.1               limma_3.60.4               
 [79] later_1.3.2                 splines_4.4.0               lattice_0.22-5              survival_3.5-7              tidyselect_1.2.1            knitr_1.48                 
 [85] svglite_2.1.3               xfun_0.46                   hardhat_1.4.0               statmod_1.5.0               MSnbase_2.30.1              timeDate_4032.109          
 [91] stringi_1.8.4               UCSC.utils_1.0.0            lazyeval_0.2.2              yaml_2.3.10                 kableExtra_1.4.0            evaluate_0.24.0            
 [97] codetools_0.2-19            MsCoreUtils_1.16.0          tibble_3.2.1                BiocManager_1.30.23         cli_3.6.3                   affyio_1.74.0              
[103] rpart_4.1.23                xtable_1.8-4                systemfonts_1.1.0           munsell_0.5.1               Rcpp_1.0.13                 MassSpecWavelet_1.70.0     
[109] globals_0.16.3              XML_3.99-0.17               parallel_4.4.0              gower_1.0.1                 prettyunits_1.2.0           AnnotationFilter_1.28.0    
[115] listenv_0.9.1               viridisLite_0.4.2           keys_0.1.1                  ipred_0.9-15                prodlim_2024.06.25          MsFeatures_1.12.0          
[121] scales_1.3.0                affy_1.82.0                 ncdf4_1.22                  purrr_1.0.2                 crayon_1.5.3                rlang_1.1.4                
[127] vsn_3.72.0
pablovgd commented 4 months ago

Ok so of course I don't find the issue after 3 hours, but after 6 minutes of opening an issue I do:

The rownames of the sampleData() of my XcmsExperiment object were the FULL paths to the mzml files, while the to colnames in the featurevalues were only the "filexxxx.mzml" part.

My bad!

sneumann commented 4 months ago

Thanks for reporting back, indeed writing the issue sometimes resets the mind and things were hidden in plain sight :-) Yours, Steffen