kharchenkolab / cacoa

Single-cell Case Control Analysis
46 stars 7 forks source link

estimateClusterFreeExpressionShifts() produces all NaN #37

Closed rrydbirk closed 7 months ago

rrydbirk commented 1 year ago

I've tried to trace the error, but everything looks fine until estimateClusterFreeExpressionShiftsC() within estimateClusterFreeExpressionShifts(). I'm using v.0.4.0.

Data can be shared upon request. @evanbiederstedt, they are on Thor@KU, /data/neonatal/rasmus/con_d.rds and annotation vector is /data/neonatal/rasmus/annotation_final.rds.

I ran:

sample.groups <- con$samples %>% 
  names() %>% 
  setNames(strsplit(., "_") %>% sapply(`[[`, 1), .)

cao <- Cacoa$new(con, 
                 sample.groups = sample.groups, 
                 cell.groups = anno, 
                 ref.level = "Intact", 
                 target.level = "Injury",
                 n.cores = 100)

cao$estimateClusterFreeExpressionShifts()

I also tried first running cao$estimateClusterFreeDE(), and that also produced a lot of NaNs.

sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.5 (Ootpa)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.12.so

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       

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

other attached packages:
 [1] qs_0.25.4               cacoa_0.4.0             sccore_1.0.2            sparseMatrixStats_1.6.0 MatrixGenerics_1.6.0   
 [6] matrixStats_0.62.0      ggplot2_3.3.6           cowplot_1.1.1           conos_1.4.9             igraph_1.3.5           
[11] Matrix_1.5-1            magrittr_2.0.3          dplyr_1.0.10           

loaded via a namespace (and not attached):
  [1] utf8_1.2.2             R.utils_2.12.0         tidyselect_1.2.0       RSQLite_2.2.18         AnnotationDbi_1.56.2  
  [6] grid_4.1.2             BiocParallel_1.28.3    Rtsne_0.16             scatterpie_0.1.8       munsell_0.5.0         
 [11] codetools_0.2-18       miniUI_0.1.1.1         withr_2.5.0            colorspace_2.0-3       GOSemSim_2.20.0       
 [16] Biobase_2.54.0         filelock_1.0.2         knitr_1.40             rstudioapi_0.14        stats4_4.1.2          
 [21] DOSE_3.20.1            labeling_0.4.2         addinexamplesWV_0.2.0  urltools_1.7.3         GenomeInfoDbData_1.2.7
 [26] polyclip_1.10-0        bit64_4.0.5            farver_2.1.1           rprojroot_2.0.3        downloader_0.4        
 [31] vctrs_0.5.0            treeio_1.18.1          generics_0.1.3         xfun_0.34              BiocFileCache_2.2.1   
 [36] R6_2.5.1               doParallel_1.0.17      GenomeInfoDb_1.30.1    ggbeeswarm_0.6.0       clue_0.3-61           
 [41] graphlayouts_0.8.2     bitops_1.0-7           cachem_1.0.6           fgsea_1.20.0           gridGraphics_0.5-1    
 [46] assertthat_0.2.1       promises_1.2.0.1       scales_1.2.1           ggraph_2.1.0           enrichplot_1.14.2     
 [51] beeswarm_0.4.0         gtable_0.3.1           processx_3.8.0         drat_0.2.3             tidygraph_1.2.2       
 [56] rlang_1.0.6            GlobalOptions_0.1.2    splines_4.1.2          lazyeval_0.2.2         brew_1.0-8            
 [61] yaml_2.3.6             reshape2_1.4.4         httpuv_1.6.6           qvalue_2.26.0          clusterProfiler_4.2.2 
 [66] tools_4.1.2            ggplotify_0.1.0        ellipsis_0.3.2         RColorBrewer_1.1-3     BiocGenerics_0.40.0   
 [71] Rcpp_1.0.9             plyr_1.8.7             progress_1.2.2         zlibbioc_1.40.0        purrr_0.3.5           
 [76] RCurl_1.98-1.9         ps_1.7.2               prettyunits_1.1.1      dendsort_0.3.4         GetoptLong_1.0.5      
 [81] viridis_0.6.2          S4Vectors_0.32.4       ggrepel_0.9.1          cluster_2.1.4          data.table_1.14.2     
 [86] DO.db_2.9              circlize_0.4.15        triebeard_0.3.0        stringfish_0.15.7      xtable_1.8-4          
 [91] mime_0.12              hms_1.1.2              patchwork_1.1.2        evaluate_0.17          XML_3.99-0.11         
 [96] RMTstat_0.3.1          N2R_1.0.1              IRanges_2.28.0         gridExtra_2.3          shape_1.4.6           
[101] compiler_4.1.2         biomaRt_2.50.3         tibble_3.1.8           crayon_1.5.2           shadowtext_0.1.2      
[106] R.oo_1.25.0            htmltools_0.5.3        later_1.3.0            ggfun_0.0.7            mgcv_1.8-40           
[111] tidyr_1.2.1            aplot_0.1.8            RcppParallel_5.1.5     RApiSerialize_0.1.2    DBI_1.1.3             
[116] tweenr_2.0.2           formatR_1.12           dbplyr_2.2.1           pagoda2_1.0.10         ComplexHeatmap_2.10.0 
[121] MASS_7.3-58.1          rappdirs_0.3.3         cli_3.4.1              R.methodsS3_1.8.2      parallel_4.1.2        
[126] pkgconfig_2.0.3        xml2_1.3.3             foreach_1.5.2          ggtree_3.2.1           vipor_0.4.5           
[131] XVector_0.34.0         leidenAlg_1.0.5        yulab.utils_0.0.5      stringr_1.4.1          callr_3.7.2           
[136] digest_0.6.30          Biostrings_2.62.0      rmarkdown_2.17         fastmatch_1.1-3        tidytree_0.4.1        
[141] Rook_1.1-1             curl_4.3.3             shiny_1.7.2            rjson_0.2.21           lifecycle_1.0.3       
[146] nlme_3.1-160           jsonlite_1.8.3         viridisLite_0.4.1      fansi_1.0.3            pillar_1.8.1          
[151] lattice_0.20-45        KEGGREST_1.34.0        fastmap_1.1.0          httr_1.4.4             pkgbuild_1.3.1        
[156] GO.db_3.14.0           glue_1.6.2             remotes_2.4.2          png_0.1-7              iterators_1.0.14      
[161] bit_4.0.4              ggforce_0.4.1          stringi_1.7.8          blob_1.2.3             memoise_2.0.1         
[166] irlba_2.3.5.1          ape_5.6-2             
YingxinLin commented 1 year ago

Hi,

I encountered the same error when running estimateClusterFreeExpressionShifts. Is this bug fixed?

Best, Yingxin

rrydbirk commented 1 year ago

Hi @YingxinLin

No, unfortunately it only happens with some datasets, so it's been difficult to track the error. Could you show us how you prepared your Cacoa object?

/Rasmus

rrydbirk commented 7 months ago

Possibly outdated, closing