Nanostring-Biostats / InSituType

An R package for performing cell typing in SMI and other single cell data
Other
29 stars 11 forks source link

Bug: prepDataForSketching erroring with sparse matrix input #199

Open patrickjdanaher opened 10 months ago

patrickjdanaher commented 10 months ago

This is a new bug, presumably caused by version changes in dependencies.

image

And digging down we see the error arising from this line in prepDataForSketching:

image

Inputing "as.matrix(counts)" avoided the error.

sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               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    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

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

other attached packages:
 [1] wesanderson_0.3.7   InSituType_1.2.2    BiocGenerics_0.48.1 Seurat_5.0.1        ggpubr_0.6.0        RColorBrewer_1.1-3 
 [7] pheatmap_1.0.12     SpatialDecon_1.12.0 SeuratObject_5.0.1  sp_2.1-2            lubridate_1.9.3     forcats_1.0.0      
[13] stringr_1.5.1       dplyr_1.1.4         purrr_1.0.2         readr_2.1.4         tidyr_1.3.0         tibble_3.2.1       
[19] ggplot2_3.4.4       tidyverse_2.0.0    

loaded via a namespace (and not attached):
  [1] RcppAnnoy_0.0.21            splines_4.3.1               later_1.3.2                 bitops_1.0-7               
  [5] R.oo_1.25.0                 cellranger_1.1.0            polyclip_1.10-6             fastDummies_1.7.3          
  [9] lifecycle_1.0.4             rstatix_0.7.2               globals_0.16.2              lattice_0.21-8             
 [13] MASS_7.3-60                 SnowballC_0.7.1             backports_1.4.1             magrittr_2.0.3             
 [17] plotly_4.10.3               GeomxTools_3.5.0            httpuv_1.6.13               sctransform_0.4.1          
 [21] askpass_1.2.0               spam_2.10-0                 spatstat.sparse_3.0-3       reticulate_1.34.0          
 [25] cowplot_1.1.2               pbapply_1.7-2               minqa_1.2.6                 abind_1.4-5                
 [29] zlibbioc_1.48.0             GenomicRanges_1.54.1        EnvStats_2.8.1              Rtsne_0.17                 
 [33] R.cache_0.16.0              R.utils_2.12.3              RCurl_1.98-1.13             GenomeInfoDbData_1.2.11    
 [37] IRanges_2.36.0              S4Vectors_0.40.2            ggrepel_0.9.4               irlba_2.3.5.1              
 [41] spatstat.utils_3.0-4        listenv_0.9.0               umap_0.2.10.0               goftest_1.2-3              
 [45] RSpectra_0.16-1             spatstat.random_3.2-2       fitdistrplus_1.1-11         parallelly_1.36.0          
 [49] DelayedArray_0.28.0         leiden_0.4.3.1              codetools_0.2-19            tidyselect_1.2.0           
 [53] farver_2.1.1                viridis_0.6.4               lme4_1.1-35.1               spatstat.explore_3.2-5     
 [57] matrixStats_1.2.0           stats4_4.3.1                jsonlite_1.8.8              ellipsis_0.3.2             
 [61] progressr_0.14.0            ggridges_0.5.5              survival_3.5-5              systemfonts_1.0.5          
 [65] tools_4.3.1                 ica_1.0-3                   Rcpp_1.0.11                 glue_1.6.2                 
 [69] SparseArray_1.2.3           gridExtra_2.3               MatrixGenerics_1.14.0       ggthemes_5.0.0             
 [73] GenomeInfoDb_1.38.5         withr_2.5.2                 numDeriv_2016.8-1.1         fastmap_1.1.1              
 [77] NanoStringNCTools_1.10.0    GGally_2.2.0                repmis_0.5                  boot_1.3-28.1              
 [81] fansi_1.0.6                 openssl_2.1.1               digest_0.6.33               timechange_0.2.0           
 [85] R6_2.5.1                    mime_0.12                   colorspace_2.1-0            scattermore_1.2            
 [89] tensor_1.5                  spatstat.data_3.0-3         R.methodsS3_1.8.2           utf8_1.2.4                 
 [93] generics_0.1.3              data.table_1.14.10          S4Arrays_1.2.0              httr_1.4.7                 
 [97] htmlwidgets_1.6.4           ggstats_0.5.1               uwot_0.1.16                 pkgconfig_2.0.3            
[101] gtable_0.3.4                lmtest_0.9-40               SingleCellExperiment_1.24.0 XVector_0.42.0             
[105] htmltools_0.5.7             carData_3.0-5               dotCall64_1.1-1             scales_1.3.0               
[109] Biobase_2.62.0              png_0.1-8                   logNormReg_0.5-0            rstudioapi_0.15.0          
[113] tzdb_0.4.0                  reshape2_1.4.4              rjson_0.2.21                uuid_1.1-1                 
[117] nlme_3.1-162                nloptr_2.0.3                zoo_1.8-12                  KernSmooth_2.23-21         
[121] parallel_4.3.1              miniUI_0.1.1.1              vipor_0.4.7                 pillar_1.9.0               
[125] grid_4.3.1                  vctrs_0.6.5                 RANN_2.6.1                  lsa_0.73.3                 
[129] promises_1.2.1              car_3.1-2                   xtable_1.8-4                cluster_2.1.4              
[133] beeswarm_0.4.0              cli_3.6.2                   compiler_4.3.1              rlang_1.1.2                
[137] crayon_1.5.2                future.apply_1.11.1         ggsignif_0.6.4              labeling_0.4.3             
[141] mclust_6.0.1                plyr_1.8.9                  ggbeeswarm_0.7.2            ggiraph_0.8.8              
[145] stringi_1.8.3               deldir_2.0-2                viridisLite_0.4.2           lmerTest_3.1-3             
[149] munsell_0.5.0               Biostrings_2.70.1           lazyeval_0.2.2              spatstat.geom_3.2-7        
[153] Matrix_1.6-4                RcppHNSW_0.5.0              hms_1.1.3                   patchwork_1.1.3            
[157] future_1.33.1               shiny_1.8.0                 SummarizedExperiment_1.32.0 ROCR_1.0-11                
[161] igraph_1.6.0                broom_1.0.5                 readxl_1.4.3               
patrickjdanaher commented 10 months ago

Per this similar issue in seurat, the below solved the problem: https://github.com/satijalab/seurat/issues/8100

install.packages("Matrix", type = "source")
install.packages("irlba", type = "source")

... now how to implement this for everyone?

patrickjdanaher commented 9 months ago

2.0 resolves this by replacing irlba with new function fastApproxPCA. Plan is to put irlba back in once it's been stabilized.