UCLouvain-CBIO / scp

Single cell proteomics data processing
https://uclouvain-cbio.github.io/scp/index.html
19 stars 2 forks source link

Error plotting scp #33

Closed demar01 closed 1 year ago

demar01 commented 2 years ago

Hi @cvanderaa

I got this error when trying to plot scp. Thanks for your work improving scp!!

library(scp)
#> Loading required package: QFeatures
#> Loading required package: MultiAssayExperiment
#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#> 
#> Attaching package: 'MatrixGenerics'
#> The following objects are masked from 'package:matrixStats':
#> 
#>     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
#>     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
#>     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
#>     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
#>     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
#>     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
#>     colWeightedMeans, colWeightedMedians, colWeightedSds,
#>     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
#>     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
#>     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
#>     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
#>     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
#>     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
#>     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
#>     rowWeightedSds, rowWeightedVars
#> Loading required package: GenomicRanges
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> Loading required package: parallel
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:parallel':
#> 
#>     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
#>     clusterExport, clusterMap, parApply, parCapply, parLapply,
#>     parLapplyLB, parRapply, parSapply, parSapplyLB
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     anyDuplicated, append, as.data.frame, basename, cbind, colnames,
#>     dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
#>     grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
#>     order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
#>     rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
#>     union, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#> 
#> Attaching package: 'S4Vectors'
#> The following objects are masked from 'package:base':
#> 
#>     expand.grid, I, unname
#> Loading required package: IRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> 
#> Attaching package: 'Biobase'
#> The following object is masked from 'package:MatrixGenerics':
#> 
#>     rowMedians
#> The following objects are masked from 'package:matrixStats':
#> 
#>     anyMissing, rowMedians
#> 
#> Attaching package: 'QFeatures'
#> The following object is masked from 'package:MultiAssayExperiment':
#> 
#>     longFormat
#> The following object is masked from 'package:base':
#> 
#>     sweep
data("scp1")
plot(scp1)
#> Error in as.double(y): cannot coerce type 'S4' to vector of type 'double'

Created on 2021-10-22 by the reprex package (v2.0.1)

lgatto commented 2 years ago

What's your sessionInfo()? Plotting did require some recent packages, as far as I can remember.

demar01 commented 2 years ago
sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] knitr_1.33        magrittr_2.0.1    rlang_0.4.11      fansi_0.5.0      
#>  [5] stringr_1.4.0     styler_1.5.1      highr_0.9         tools_4.1.0      
#>  [9] xfun_0.25         utf8_1.2.2        withr_2.4.2       htmltools_0.5.1.1
#> [13] ellipsis_0.3.2    yaml_2.2.1        digest_0.6.27     tibble_3.1.3     
#> [17] lifecycle_1.0.0   crayon_1.4.1      purrr_0.3.4       vctrs_0.3.8      
#> [21] fs_1.5.0          glue_1.4.2        evaluate_0.14     rmarkdown_2.10   
#> [25] reprex_2.0.1      stringi_1.7.3     compiler_4.1.0    pillar_1.6.2     
#> [29] backports_1.2.1   pkgconfig_2.0.3

Created on 2021-10-22 by the reprex package (v2.0.1)

cvanderaa commented 2 years ago

Hello Maria, @demar01

As Laurent mentioned, the plot function was only recently implemented in the QFeatures package (v1.3.5, see NEWS file). Make sure to load scp first before sending your sessionInfo(), because I cannot see what version of QFeatures you are using, but I suspect you are working with QFeatures<1.3.5.

The best thing to do is to use BiocManager with the version 3.14 of Bioconductor (currently devel, but will become a stable release end of the week).

BiocManager::install(version = "3.14")
BiocManager::version() # should return "3.14"
BiocManager::install("scp")
cvanderaa commented 1 year ago

Meanwhile this functionality is available from stable releases and version constraints on dependencies have been updated. If the problem persists, please reinstall the latest QFeatures and scp (stable) versions from Bioconductor.