cnio-bu / beyondcell

Beyondcell is a computational methodology for identifying tumour cell subpopulations with distinct drug responses in single-cell RNA-seq and Spatial Transcriptomics data.
Other
40 stars 4 forks source link

Error in specifying PCs for bcUMAP #160

Closed katimbach closed 3 months ago

katimbach commented 3 months ago

I'm trying to run the pipeline with a spatial sample. I was having issues with bcUMAP without specifying any PCs, but after downgrading Seurat and SeuratObject versions to v4 it worked and generated an elbow plot, see below:

OVA4A_elbowplot

However, now when I try to specify 10 PCs to run, I get the following error:

Printing elbow plot...
Obtaining therapeutic clusters...
Computing nearest neighbor graph
Computing SNN
Error in validObject(.Object) : 
  invalid class "Graph" object: superclass "mMatrix" not defined in the environment of the object's class

Here is my sessionInfo:

> sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /mnt/beegfs/kimbach/bin/.conda/envs/beyondcell/lib/libopenblasp-r0.3.27.so

locale:
[1] C

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

other attached packages:
[1] ggplot2_3.5.1      SeuratObject_4.1.4 Seurat_4.4.0       beyondcell_2.1.0  

loaded via a namespace (and not attached):
  [1] Rtsne_0.17             colorspace_2.1-0       deldir_2.0-4          
  [4] class_7.3-22           ggridges_0.5.6         spatstat.data_3.0-4   
  [7] farver_2.1.1           leiden_0.4.3.1         listenv_0.9.1         
 [10] ggrepel_0.9.5          fansi_1.0.6            codetools_0.2-20      
 [13] splines_4.2.0          DMwR_0.4.1             polyclip_1.10-6       
 [16] jsonlite_1.8.8         ica_1.0-3              cluster_2.1.6         
 [19] png_0.1-8              uwot_0.1.16            shiny_1.8.1.1         
 [22] sctransform_0.4.1      spatstat.sparse_3.0-3  compiler_4.2.0        
 [25] httr_1.4.7             Matrix_1.6-5           fastmap_1.1.1         
 [28] lazyeval_0.2.2         cli_3.6.2              later_1.3.2           
 [31] htmltools_0.5.8.1      tools_4.2.0            igraph_1.4.2          
 [34] gtable_0.3.5           glue_1.7.0             RANN_2.6.1            
 [37] reshape2_1.4.4         dplyr_1.1.4            Rcpp_1.0.12           
 [40] scattermore_1.2        vctrs_0.6.5            spatstat.explore_3.2-6
 [43] nlme_3.1-164           progressr_0.14.0       lmtest_0.9-40         
 [46] spatstat.random_3.2-3  stringr_1.5.1          globals_0.16.3        
 [49] mime_0.12              miniUI_0.1.1.1         lifecycle_1.0.4       
 [52] irlba_2.3.5.1          goftest_1.2-3          future_1.33.2         
 [55] MASS_7.3-60.0.1        zoo_1.8-12             scales_1.3.0          
 [58] promises_1.3.0         spatstat.utils_3.0-4   parallel_4.2.0        
 [61] RColorBrewer_1.1-3     quantmod_0.4.26        curl_4.3.3            
 [64] reticulate_1.36.1      pbapply_1.7-2          see_0.8.3             
 [67] gridExtra_2.3          rpart_4.1.23           stringi_1.7.6         
 [70] TTR_0.24.4             rlang_1.1.3            pkgconfig_2.0.3       
 [73] matrixStats_1.3.0      lattice_0.22-6         ROCR_1.0-11           
 [76] purrr_1.0.2            tensor_1.5             patchwork_1.2.0       
 [79] htmlwidgets_1.6.4      labeling_0.4.3         cowplot_1.1.3         
 [82] tidyselect_1.2.1       parallelly_1.37.1      RcppAnnoy_0.0.22      
 [85] plyr_1.8.9             magrittr_2.0.3         R6_2.5.1              
 [88] generics_0.1.3         pillar_1.9.0           withr_3.0.0           
 [91] fitdistrplus_1.1-11    xts_0.13.2             survival_3.6-4        
 [94] abind_1.4-5            sp_2.1-3               tibble_3.2.1          
 [97] future.apply_1.11.2    KernSmooth_2.23-22     utf8_1.2.4            
[100] spatstat.geom_3.2-9    plotly_4.10.4          viridis_0.6.5         
[103] grid_4.2.0             data.table_1.14.8      digest_0.6.35         
[106] xtable_1.8-4           tidyr_1.3.1            httpuv_1.6.15         
[109] munsell_0.5.1          viridisLite_0.4.2   
katimbach commented 3 months ago

Based on this: https://stackoverflow.com/questions/77487154/invalid-class-graph-object-superclass-mmatrix-not-defined-seurat-r it seems that this is an issue with the Matrix version with older Seurat versions. I downgraded to r-matrix from 1.6_5 to 1.6_1.1 in my environment and now it runs without issue.

That being said, I really recommend specifying the correct versions of Seurat/SeuratObject packages and the Matrix dependency in the recipe to build r-beyondcell, because currently with the default install it is unusable.