GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
388 stars 141 forks source link

simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order #2209

Open danli349 opened 2 months ago

danli349 commented 2 months ago

When run the tutorial "https://greenleaflab.github.io/ArchR_2020/Ex-Analyze-Multiome.html"

#Add Clusters
proj <- addClusters(proj, reducedDims = "LSI_Combined", name = "Clusters", resolution = 0.4, force = TRUE)

There is error: simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order How can I solve this? Thanks a lot

The LogFile is:


           ___      .______        ______  __    __  .______      
          /   \     |   _  \      /      ||  |  |  | |   _  \     
         /  ^  \    |  |_)  |    |  ,----'|  |__|  | |  |_)  |    
        /  /_\  \   |      /     |  |     |   __   | |      /     
       /  _____  \  |  |\  \\___ |  `----.|  |  |  | |  |\  \\___.
      /__/     \__\ | _| `._____| \______||__|  |__| | _| `._____|

Logging With ArchR!

Start Time : 2024-09-27 16:40:00.132495

------- ArchR Info

ArchRThreads = 10
ArchRGenome = Hg38

------- System Info

Computer OS = unix
Total Cores = 12

------- Session Info

R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.1 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/liblapack.so.3;  LAPACK version 3.9.0

Random number generation:
 RNG:     L'Ecuyer-CMRG 
 Normal:  Inversion 
 Sample:  Rejection 

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: America/New_York
tzcode source: system (glibc)

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

other attached packages:
 [1] nabor_0.5.0                       Seurat_5.1.0                     
 [3] SeuratObject_5.0.2                sp_2.1-4                         
 [5] Rsamtools_2.20.0                  BSgenome.Hsapiens.UCSC.hg38_1.4.5
 [7] BSgenome_1.72.0                   rtracklayer_1.64.0               
 [9] BiocIO_1.14.0                     Biostrings_2.72.1                
[11] XVector_0.44.0                    rhdf5_2.48.0                     
[13] SummarizedExperiment_1.34.0       Biobase_2.64.0                   
[15] MatrixGenerics_1.16.0             Rcpp_1.0.13                      
[17] Matrix_1.7-0                      GenomicRanges_1.56.1             
[19] GenomeInfoDb_1.40.1               IRanges_2.38.1                   
[21] S4Vectors_0.42.1                  BiocGenerics_0.50.0              
[23] matrixStats_1.4.1                 data.table_1.16.0                
[25] stringr_1.5.1                     plyr_1.8.9                       
[27] magrittr_2.0.3                    ggplot2_3.5.1                    
[29] gtable_0.3.5                      gtools_3.9.5                     
[31] gridExtra_2.3                     ArchR_1.0.2                      

loaded via a namespace (and not attached):
  [1] RcppAnnoy_0.0.22         splines_4.4.1            later_1.3.2             
  [4] pbdZMQ_0.3-11            bitops_1.0-8             tibble_3.2.1            
  [7] polyclip_1.10-7          XML_3.99-0.17            fastDummies_1.7.3       
 [10] lifecycle_1.0.4          globals_0.16.3           lattice_0.22-6          
 [13] MASS_7.3-61              plotly_4.10.4            yaml_2.3.10             
 [16] httpuv_1.6.15            sctransform_0.4.1        spam_2.10-0             
 [19] spatstat.sparse_3.1-0    reticulate_1.38.0        cowplot_1.1.3           
 [22] pbapply_1.7-2            RColorBrewer_1.1-3       abind_1.4-8             
 [25] zlibbioc_1.50.0          Rtsne_0.17               purrr_1.0.2             
 [28] RCurl_1.98-1.16          GenomeInfoDbData_1.2.12  ggrepel_0.9.6           
 [31] irlba_2.3.5.1            listenv_0.9.1            spatstat.utils_3.0-5    
 [34] goftest_1.2-3            RSpectra_0.16-2          spatstat.random_3.3-1   
 [37] fitdistrplus_1.2-1       parallelly_1.38.0        leiden_0.4.3.1          
 [40] codetools_0.2-20         DelayedArray_0.30.1      tidyselect_1.2.1        
 [43] UCSC.utils_1.0.0         farver_2.1.2             base64enc_0.1-3         
 [46] spatstat.explore_3.3-1   GenomicAlignments_1.40.0 jsonlite_1.8.9          
 [49] progressr_0.14.0         ggridges_0.5.6           survival_3.7-0          
 [52] tools_4.4.1              ica_1.0-3                glue_1.7.0              
 [55] SparseArray_1.4.8        IRdisplay_1.1            dplyr_1.1.4             
 [58] withr_3.0.1              fastmap_1.2.0            rhdf5filters_1.16.0     
 [61] fansi_1.0.6              digest_0.6.37            R6_2.5.1                
 [64] mime_0.12                colorspace_2.1-1         scattermore_1.2         
 [67] Cairo_1.6-2              tensor_1.5               spatstat.data_3.1-2     
 [70] utf8_1.2.4               tidyr_1.3.1              generics_0.1.3          
 [73] httr_1.4.7               htmlwidgets_1.6.4        S4Arrays_1.4.1          
 [76] uwot_0.2.2               pkgconfig_2.0.3          lmtest_0.9-40           
 [79] htmltools_0.5.8.1        dotCall64_1.1-1          scales_1.3.0            
 [82] png_0.1-8                spatstat.univar_3.0-0    reshape2_1.4.4          
 [85] rjson_0.2.23             uuid_1.2-1               nlme_3.1-166            
 [88] curl_5.2.3               repr_1.1.7               zoo_1.8-12              
 [91] KernSmooth_2.23-24       miniUI_0.1.1.1           restfulr_0.0.15         
 [94] pillar_1.9.0             vctrs_0.6.5              RANN_2.6.1              
 [97] promises_1.3.0           xtable_1.8-4             cluster_2.1.6           
[100] evaluate_1.0.0           cli_3.6.3                compiler_4.4.1          
[103] rlang_1.1.4              crayon_1.5.3             future.apply_1.11.2     
[106] labeling_0.4.3           stringi_1.8.4            deldir_2.0-4            
[109] viridisLite_0.4.2        BiocParallel_1.38.0      munsell_0.5.1           
[112] lazyeval_0.2.2           spatstat.geom_3.3-2      IRkernel_1.3.2          
[115] RcppHNSW_0.6.0           patchwork_1.2.0          future_1.34.0           
[118] Rhdf5lib_1.26.0          shiny_1.9.1              ROCR_1.0-11             
[121] igraph_2.0.3            

------- Log Info

2024-09-27 16:40:00.246428 : addClusters Input-Parameters, Class = list

addClusters Input-Parameters$: length = 1

1 function (name)      
2 .Internal(args(name))

addClusters Input-Parameters$input: length = 1

addClusters Input-Parameters$reducedDims: length = 1
[1] "LSI_Combined"

addClusters Input-Parameters$name: length = 1
[1] "Clusters"

addClusters Input-Parameters$sampleCells: length = 0
NULL

addClusters Input-Parameters$seed: length = 1
[1] 1

addClusters Input-Parameters$method: length = 1
[1] "Seurat"

addClusters Input-Parameters$dimsToUse: length = 0
NULL

addClusters Input-Parameters$scaleDims: length = 0
NULL

addClusters Input-Parameters$corCutOff: length = 1
[1] 0.75

addClusters Input-Parameters$knnAssign: length = 1
[1] 10

addClusters Input-Parameters$nOutlier: length = 1
[1] 5

addClusters Input-Parameters$maxClusters: length = 1
[1] 25

addClusters Input-Parameters$testBias: length = 1
[1] TRUE

addClusters Input-Parameters$filterBias: length = 1
[1] FALSE

addClusters Input-Parameters$biasClusters: length = 1
[1] 0.01

addClusters Input-Parameters$biasCol: length = 1
[1] "nFrags"

addClusters Input-Parameters$biasVals: length = 0
NULL

addClusters Input-Parameters$biasQuantiles: length = 2
[1] 0.05 0.95

addClusters Input-Parameters$biasEnrich: length = 1
[1] 10

addClusters Input-Parameters$biasProportion: length = 1
[1] 0.5

addClusters Input-Parameters$biasPval: length = 1
[1] 0.05

addClusters Input-Parameters$nPerm: length = 1
[1] 500

addClusters Input-Parameters$prefix: length = 1
[1] "C"

addClusters Input-Parameters$ArchRProj: length = 0
NULL

addClusters Input-Parameters$verbose: length = 1
[1] TRUE

addClusters Input-Parameters$tstart: length = 0
NULL

addClusters Input-Parameters$force: length = 1
[1] TRUE

addClusters Input-Parameters$logFile: length = 1
[1] "ArchRLogs/ArchR-addClusters-3a00529df302-Date-2024-09-27_Time-16-40-00.128721.log"

addClusters Input-Parameters$...: length = 1

2024-09-27 16:40:00.357858 : Running Seurats FindClusters (Stuart et al. Cell 2019), 0.001 mins elapsed.

************************************************************
2024-09-27 16:40:00.52974 : ERROR Found in FindNeighbors for  
LogFile = ArchRLogs/ArchR-addClusters-3a00529df302-Date-2024-09-27_Time-16-40-00.128721.log

<simpleError in validObject(.Object): invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order>

2024-09-27 16:40:00.530944 : errorList, Class = list

errorList$: length = 1

1 function (name)      
2 .Internal(args(name))

errorList$e: length = 2
$message
[1] "invalid class “DimReduc” object: dimensions for ‘cell.embeddings’ must be in order"

$call
validObject(.Object)

************************************************************

************************************************************
2024-09-27 16:40:00.536953 : ERROR Found in runClusters for  
LogFile = ArchRLogs/ArchR-addClusters-3a00529df302-Date-2024-09-27_Time-16-40-00.128721.log

<simpleError in .logError(e, fn = "FindNeighbors", info = "", errorList = errorList,     logFile = logFile): Exiting See Error Above>

2024-09-27 16:40:00.538637 : errorList, Class = list

errorList$resolution: length = 1
[1] 0.4

errorList$verbose: length = 1
[1] TRUE

errorList$tstart: length = 1
[1] "2024-09-27 16:40:00 EDT"

************************************************************
rcorces commented 2 months ago

Hi @danli349! Thanks for using ArchR! Lately, it has been very challenging for me to keep up with maintenance of this package and all of my other responsibilities as a PI. I have not been responding to issue posts and I have not been pushing updates to the software. We are actively searching to hire a computational biologist to continue to develop and maintain ArchR and related tools. If you know someone who might be a good fit, please let us know! In the meantime, your issue will likely go without a reply. Most issues with ArchR right not relate to compatibility. Try reverting to R 4.1 and Bioconductor 3.15. Newer versions of Seurat and Matrix also are causing issues. Sorry for not being able to provide active support for this package at this time.

ewowiredu commented 2 months ago

@danli349

The issue is with the names of the reducedDims after combining RNA and ATAC. Running the following prior to addClusters(proj, reducedDims = "LSI_Combined" ... should fix the problem.

colnames(proj@reducedDims$LSI_Combined$matRD) <- paste0('LSI',1:length(colnames(getReducedDims(proj,'LSI_Combined'))))

danli349 commented 1 month ago

@ewowiredu That solves the problem. Thanks a lot!