Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unconstrained integration error - "more elements supplied than there are to replace" #2136

Open
LacquerHed opened this issue Mar 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@LacquerHed
Copy link

Hi I am running unconstrained integration and getting the following error, which seems to stem from the slots/layers ArchR is pulling from the seRNA (Seurat object) input.

2024-03-14 12:11:53.67366 : Block (1 of 1) : Imputing GeneScoreMatrix, 0.323 mins elapsed. Getting ImputeWeights Warning: Data is of class dgeMatrix. Coercing to dgCMatrix. Error in slot(object = object, name = "features")[[layer]] <- features : more elements supplied than there are to replace

This is happening with Seurat V5 objects but also V4 when I downgraded to that, so not sure if its the new layer structure of Seurat V5. Not sure how to limit elements supplied from the seRNA. Thanks.

ArchR-addGeneIntegrationMatrix-129a04b8342d3-Date-2024-03-14_Time-12-11-30.735514.log

sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.3.1
Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
Random number generation:
 RNG:     L'Ecuyer-CMRG 
 Normal:  Inversion 
 Sample:  Rejection 
 locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/New_York
tzcode source: internal
attached base packages:
 [1] parallel  stats4    grid      stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
 [1] harmony_1.2.0                      uwot_0.1.16                        nabor_0.5.0                       
 [4] Rsamtools_2.18.0                   BSgenome.Mmusculus.UCSC.mm10_1.4.3 BSgenome_1.70.2                   
 [7] rtracklayer_1.62.0                 BiocIO_1.12.0                      Biostrings_2.70.2                 
[10] XVector_0.42.0                     rhdf5_2.46.1                       SummarizedExperiment_1.32.0       
[13] Biobase_2.62.0                     MatrixGenerics_1.14.0              Rcpp_1.0.12                       
[16] Matrix_1.6-5                       GenomicRanges_1.54.1               GenomeInfoDb_1.38.7               
[19] IRanges_2.36.0                     S4Vectors_0.40.2                   BiocGenerics_0.48.1               
[22] matrixStats_1.2.0                  data.table_1.15.2                  stringr_1.5.1                     
[25] plyr_1.8.9                         magrittr_2.0.3                     gtable_0.3.4                      
[28] gtools_3.9.5                       gridExtra_2.3                      ArchR_1.0.2                       
[31] sctransform_0.4.1                  ggplot2_3.5.0                      dplyr_1.1.4                       
[34] Seurat_5.0.2                       SeuratObject_5.0.1                 sp_2.1-3                          
loaded via a namespace (and not attached):
  [1] RcppAnnoy_0.0.22          splines_4.3.2             later_1.3.2               bitops_1.0-7             
  [5] tibble_3.2.1              R.oo_1.26.0               polyclip_1.10-6           XML_3.99-0.16.1          
  [9] fastDummies_1.7.3         lifecycle_1.0.4           doParallel_1.0.17         globals_0.16.3           
 [13] lattice_0.22-5            MASS_7.3-60.0.1           limma_3.58.1              plotly_4.10.4            
 [17] yaml_2.3.8                httpuv_1.6.14             glmGamPoi_1.14.3          spam_2.10-0              
 [21] spatstat.sparse_3.0-3     reticulate_1.35.0         cowplot_1.1.3             pbapply_1.7-2            
 [25] RColorBrewer_1.1-3        abind_1.4-5               zlibbioc_1.48.0           Rtsne_0.17               
 [29] purrr_1.0.2               presto_1.0.0              R.utils_2.12.3            RCurl_1.98-1.14          
 [33] circlize_0.4.16           GenomeInfoDbData_1.2.11   ggrepel_0.9.5             irlba_2.3.5.1            
 [37] listenv_0.9.1             spatstat.utils_3.0-4      pheatmap_1.0.12           goftest_1.2-3            
 [41] RSpectra_0.16-1           spatstat.random_3.2-3     fitdistrplus_1.1-11       parallelly_1.37.1        
 [45] DelayedMatrixStats_1.24.0 leiden_0.4.3.1            codetools_0.2-19          DelayedArray_0.28.0      
 [49] tidyselect_1.2.1          shape_1.4.6.1             farver_2.1.1              spatstat.explore_3.2-6   
 [53] GenomicAlignments_1.38.2  jsonlite_1.8.8            GetoptLong_1.0.5          ellipsis_0.3.2           
 [57] progressr_0.14.0          ggridges_0.5.6            survival_3.5-8            iterators_1.0.14         
 [61] foreach_1.5.2             tools_4.3.2               ica_1.0-3                 glue_1.7.0               
 [65] SparseArray_1.2.4         withr_3.0.0               fastmap_1.1.1             rhdf5filters_1.14.1      
 [69] fansi_1.0.6               digest_0.6.35             R6_2.5.1                  mime_0.12                
 [73] colorspace_2.1-0          Cairo_1.6-2               scattermore_1.2           tensor_1.5               
 [77] spatstat.data_3.0-4       R.methodsS3_1.8.2         RhpcBLASctl_0.23-42       utf8_1.2.4               
 [81] tidyr_1.3.1               generics_0.1.3            httr_1.4.7                htmlwidgets_1.6.4        
 [85] S4Arrays_1.2.1            pkgconfig_2.0.3           ComplexHeatmap_2.18.0     lmtest_0.9-40            
 [89] htmltools_0.5.7           dotCall64_1.1-1           clue_0.3-65               scales_1.3.0             
 [93] png_0.1-8                 rstudioapi_0.15.0         reshape2_1.4.4            rjson_0.2.21             
 [97] nlme_3.1-164              zoo_1.8-12                GlobalOptions_0.1.2       KernSmooth_2.23-22       
[101] miniUI_0.1.1.1            vipor_0.4.7               restfulr_0.0.15           ggrastr_1.0.2            
[105] pillar_1.9.0              vctrs_0.6.5               RANN_2.6.1                promises_1.2.1           
[109] xtable_1.8-4              cluster_2.1.6             beeswarm_0.4.0            cli_3.6.2                
[113] compiler_4.3.2            rlang_1.1.3               crayon_1.5.2              future.apply_1.11.1      
[117] labeling_0.4.3            ggbeeswarm_0.7.2          stringi_1.8.3             BiocParallel_1.36.0      
[121] viridisLite_0.4.2         deldir_2.0-4              munsell_0.5.0             lazyeval_0.2.2           
[125] spatstat.geom_3.2-9       RcppHNSW_0.6.0            patchwork_1.2.0           sparseMatrixStats_1.14.0 
[129] future_1.33.1             Rhdf5lib_1.24.2           statmod_1.5.0             shiny_1.8.0              
[133] ROCR_1.0-11               igraph_2.0.3`
@LacquerHed LacquerHed added the bug Something isn't working label Mar 14, 2024
@rcorces
Copy link
Collaborator

rcorces commented Mar 14, 2024

Hi @LacquerHed! 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.

@zvittorio
Copy link

Hi @LacquerHed

I had the same error, in the same step. This is my code (the part that generates the error)

seRNA = readRDS("scRNA-Hematopoiesis-Granja-2019.rds")
seurObj = CreateSeuratObject(counts = CreateAssayObject(assay(seRNA)), meta.data = as.data.frame(colData(seRNA)))

Project = addGeneIntegrationMatrix(
    ArchRProj = Project, 
    useMatrix = "GeneScoreMatrix",
    matrixName = "GeneIntegrationMatrix",
    reducedDims = "IterativeLSI",
    seRNA = seurObj,
    addToArrow = FALSE,
    groupRNA = "BioClassification", 
    nameCell = "predictedCell_Un", 
    nameGroup = "predictedGroup_Un",
    nameScore = "predictedScore_Un"
)

I was running on R-4.3.2 with ArchR-1.0.2.
Reverting to an older R version (4.2.2) as suggested by @rcorces does not generate the error and the function runs smoothly. I hope this helps, also on the dev side for further fixes ;)

@jiangpuxuan
Copy link

Try update your seurat to 5 , archR to 1.0.3
and bioconductor to 3.19

And try to run Rscript in your shell rather than using rstudio !

@jiangpuxuan
Copy link

Hi @LacquerHed

I had the same error, in the same step. This is my code (the part that generates the error)

seRNA = readRDS("scRNA-Hematopoiesis-Granja-2019.rds")
seurObj = CreateSeuratObject(counts = CreateAssayObject(assay(seRNA)), meta.data = as.data.frame(colData(seRNA)))

Project = addGeneIntegrationMatrix(
    ArchRProj = Project, 
    useMatrix = "GeneScoreMatrix",
    matrixName = "GeneIntegrationMatrix",
    reducedDims = "IterativeLSI",
    seRNA = seurObj,
    addToArrow = FALSE,
    groupRNA = "BioClassification", 
    nameCell = "predictedCell_Un", 
    nameGroup = "predictedGroup_Un",
    nameScore = "predictedScore_Un"
)

I was running on R-4.3.2 with ArchR-1.0.2. Reverting to an older R version (4.2.2) as suggested by @rcorces does not generate the error and the function runs smoothly. I hope this helps, also on the dev side for further fixes ;)

I have once been doubted by the same error but it works with latest seurat archr bioconductor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants