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

plot functions error: "Error in (function (cl, name, valueClass) : ... not a slot in class "list"" #498

Closed jmorim closed 4 years ago

jmorim commented 4 years ago

Occurs when trying to plot feature chromatograms (featureChromatograms(data)) or plot(xchr, col = sample_colors, peakBg = sample_colors[chromPeaks(xchr)[, "column"]]) from the vignette. Error in (function (cl, name, valueClass) : 'featureDefinitions' is not a slot in class "list" or Error in (function (cl, name, valueClass) : '.processHistory' is not a slot in class "list" Tried on xcms v 3.9.1

Someone else on stackoverflow is getting this error too https://stackoverflow.com/questions/62580066/how-to-debug-an-error-like-featuredefinitions-is-not-a-slot-in-class-list-w

jmorim commented 4 years ago

Went away after upgrading to R 4.0.2

sneumann commented 4 years ago

Thanks for reporting back, if that re-appears, it would be great if you could provide a unit test checking for that and preventing in the future. Yours, Steffen

jmorim commented 4 years ago

Seems I spoke to soon or was editing a different script. The error is only occurring for me when analyzing multiple files. Here's the traceback

plot(feature.chroms.multi[4, ])

Error in (function (cl, name, valueClass) : ‘featureDefinitions’ is not a slot in class “list”
9. stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
8. (function (cl, name, valueClass) { ClassDef <- getClass(cl) slotClass <- ClassDef@slots[[name]] ...
7. .local(x, i, j, ..., drop)
6. x[i, , drop = TRUE]
5. x[i, , drop = TRUE]
4. .plotChromatogramList(x[i, , drop = TRUE], col = col, lty = lty, type = type, xlab = xlab, ylab = ylab, main = main, ...)
3. .local(x, ...)
2. plot(feature.chroms.multi[4, ])
1. plot(feature.chroms.multi[4, ])
jmorim commented 4 years ago

I guess I didn't realize if it's multiple files then you need to subset the feature chromatogram before plotting, e.g. plot(feature.chroms.multi[, 1] where 1 is the file you want.

ebruginski commented 4 years ago

I tried to run the tutorial code and I had the same error.

plot(xchr, col = group_colors[chr_raw$sample_group])
Error in (function (cl, name, valueClass)  : 
  ‘.processHistory’ is not a slot in class “list”
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

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

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

other attached packages:
 [1] SummarizedExperiment_1.18.2 DelayedArray_0.14.1         matrixStats_0.56.0         
 [4] GenomicRanges_1.40.0        GenomeInfoDb_1.24.2         IRanges_2.22.2             
 [7] pheatmap_1.0.12             magrittr_1.5                pander_0.6.3               
[10] RColorBrewer_1.1-2          xcms_3.9.1                  MSnbase_2.14.2             
[13] ProtGenerics_1.20.0         S4Vectors_0.26.1            mzR_2.22.0                 
[16] Rcpp_1.0.5                  BiocParallel_1.22.0         Biobase_2.48.0             
[19] BiocGenerics_0.34.0        

loaded via a namespace (and not attached):
 [1] bitops_1.0-6           fs_1.5.0               usethis_1.6.1          devtools_2.3.1        
 [5] doParallel_1.0.15      rprojroot_1.3-2        tools_4.0.2            backports_1.1.8       
 [9] R6_2.4.1               affyio_1.58.0          colorspace_1.4-1       withr_2.2.0           
[13] tidyselect_1.1.0       prettyunits_1.1.1      processx_3.4.3         curl_4.3              
[17] compiler_4.0.2         MassSpecWavelet_1.54.0 preprocessCore_1.50.0  cli_2.0.2             
[21] desc_1.2.0             scales_1.1.1           DEoptimR_1.0-8         robustbase_0.93-6     
[25] affy_1.66.0            callr_3.4.3            digest_0.6.25          XVector_0.28.0        
[29] pkgconfig_2.0.3        sessioninfo_1.1.1      limma_3.44.3           rlang_0.4.7           
[33] rstudioapi_0.11        impute_1.62.0          farver_2.0.3           generics_0.0.2        
[37] mzID_1.26.0            dplyr_1.0.2            RCurl_1.98-1.2         GenomeInfoDbData_1.2.3
[41] MALDIquant_1.19.3      Matrix_1.2-18          munsell_0.5.0          fansi_0.4.1           
[45] lifecycle_0.2.0        vsn_3.56.0             MASS_7.3-51.6          zlibbioc_1.34.0       
[49] pkgbuild_1.1.0         plyr_1.8.6             grid_4.0.2             crayon_1.3.4          
[53] lattice_0.20-41        splines_4.0.2          multtest_2.44.0        ps_1.3.4              
[57] pillar_1.4.6           codetools_0.2-16       pkgload_1.1.0          XML_3.99-0.5          
[61] glue_1.4.1             pcaMethods_1.80.0      remotes_2.2.0          BiocManager_1.30.10   
[65] vctrs_0.3.2            foreach_1.5.0          testthat_2.3.2         gtable_0.3.0          
[69] RANN_2.6.1             purrr_0.3.4            assertthat_0.2.1       ggplot2_3.3.2         
[73] ncdf4_1.17             survival_3.1-12        snow_0.4-3             tibble_3.0.3          
[77] iterators_1.0.12       memoise_1.1.0          ellipsis_0.3.1
jorainer commented 4 years ago

Seems you have a new version of R but old versions of xcms, MSnbase et al. @ebruginski I suggest to update the packages/Bioconductor version with BiocManager::install(version = "3.11").