satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 912 forks source link

Error: matrix multiplication: incompatible matrix dimensions: 100x96490 and 96489x22 #8329

Closed claireanjou closed 9 months ago

claireanjou commented 9 months ago

When I am running RunHarmony, it produces this error message. What could this mean? I have ran the same code before and never encountered this error. Would appreciate any help, thanks!

ERROR MESSAGE: Error: matrix multiplication: incompatible matrix dimensions: 100x96490 and 96489x22 In addition: Warning messages: 1: In theta (1 - exp(-(N_b/(nclust tau))^2)) : longer object length is not a multiple of shorter object length 2: In rbind(rep(1, N), phi) : number of columns of result is not a multiple of vector length (arg 1)

R version 4.3.0 (2023-04-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux

Matrix products: default BLAS: /usr/lib64/libblas.so.3.4.2 LAPACK: /usr/lib64/liblapack.so.3.4.2

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

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

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

other attached packages: [1] ComplexHeatmap_2.16.0 patchwork_1.1.2 monocle3_1.3.1
[4] SingleCellExperiment_1.22.0 SummarizedExperiment_1.30.0 GenomicRanges_1.52.0
[7] GenomeInfoDb_1.36.0 IRanges_2.34.0 S4Vectors_0.38.0
[10] MatrixGenerics_1.12.0 matrixStats_0.63.0 Biobase_2.60.0
[13] BiocGenerics_0.46.0 SeuratData_0.2.2 SeuratDisk_0.0.0.9020
[16] SeuratWrappers_0.3.1 BiocManager_1.30.20 EnhancedVolcano_1.18.0
[19] ggrepel_0.9.3 Libra_1.7 nnls_1.4
[22] readxl_1.4.2 tibble_3.2.1 harmony_0.1.1
[25] Rcpp_1.0.10 cowplot_1.1.1 sctransform_0.4.1
[28] ggplot2_3.4.2 dplyr_1.1.2 cellranger_1.1.0
[31] devtools_2.4.5 usethis_2.1.6 SeuratObject_4.1.3
[34] Seurat_4.3.0

loaded via a namespace (and not attached): [1] RcppAnnoy_0.0.20 splines_4.3.0 later_1.3.0 bitops_1.0-7
[5] R.oo_1.25.0 polyclip_1.10-4 lifecycle_1.0.3 doParallel_1.0.17
[9] globals_0.16.2 processx_3.8.1 lattice_0.21-8 hdf5r_1.3.8
[13] MASS_7.3-59 magrittr_2.0.3 plotly_4.10.1 remotes_2.4.2
[17] httpuv_1.6.9 sp_1.6-0 sessioninfo_1.2.2 pkgbuild_1.4.0
[21] spatstat.sparse_3.0-1 reticulate_1.28 minqa_1.2.5 pbapply_1.7-0
[25] RColorBrewer_1.1-3 abind_1.4-5 pkgload_1.3.2 zlibbioc_1.46.0
[29] Rtsne_0.16 purrr_1.0.1 R.utils_2.12.2 RCurl_1.98-1.12
[33] rappdirs_0.3.3 circlize_0.4.15 GenomeInfoDbData_1.2.10 irlba_2.3.5.1
[37] listenv_0.9.0 spatstat.utils_3.0-2.001 terra_1.7-65 goftest_1.2-3
[41] spatstat.random_3.1-4 fitdistrplus_1.1-11 parallelly_1.35.0 DelayedArray_0.25.0
[45] leiden_0.4.3 codetools_0.2-19 shape_1.4.6 tidyselect_1.2.0
[49] farver_2.1.1 lme4_1.1-33 spatstat.explore_3.1-0 jsonlite_1.8.4
[53] GetoptLong_1.0.5 ellipsis_0.3.2 progressr_0.13.0 iterators_1.0.14
[57] ggridges_0.5.4 survival_3.5-5 foreach_1.5.2 tools_4.3.0
[61] ica_1.0-3 glue_1.6.2 gridExtra_2.3 withr_2.5.0
[65] fastmap_1.1.1 boot_1.3-28.1 fansi_1.0.4 callr_3.7.3
[69] digest_0.6.31 rsvd_1.0.5 R6_2.5.1 mime_0.12
[73] colorspace_2.1-0 scattermore_1.2 tensor_1.5 spatstat.data_3.0-1
[77] R.methodsS3_1.8.2 utf8_1.2.3 tidyr_1.3.0 generics_0.1.3
[81] data.table_1.14.8 prettyunits_1.1.1 httr_1.4.5 htmlwidgets_1.6.2
[85] uwot_0.1.14 pkgconfig_2.0.3 gtable_0.3.3 lmtest_0.9-40
[89] XVector_0.40.0 htmltools_0.5.5 profvis_0.3.7 clue_0.3-64
[93] scales_1.2.1 png_0.1-8 rstudioapi_0.14 rjson_0.2.21
[97] reshape2_1.4.4 nloptr_2.0.3 nlme_3.1-162 GlobalOptions_0.1.2
[101] cachem_1.0.7 zoo_1.8-12 stringr_1.5.0 KernSmooth_2.23-20
[105] miniUI_0.1.1.1 pillar_1.9.0 vctrs_0.6.2 RANN_2.6.1
[109] urlchecker_1.0.1 promises_1.2.0.1 xtable_1.8-4 cluster_2.1.4
[113] cli_3.6.1 compiler_4.3.0 rlang_1.1.1 crayon_1.5.2
[117] future.apply_1.10.0 labeling_0.4.2 ps_1.7.5 plyr_1.8.8
[121] fs_1.6.2 stringi_1.7.12 viridisLite_0.4.1 deldir_1.0-6
[125] munsell_0.5.0 lazyeval_0.2.2 spatstat.geom_3.1-0.002 Matrix_1.6-5
[129] bit64_4.0.5 future_1.32.0 shiny_1.7.4 ROCR_1.0-11
[133] igraph_1.4.2 memoise_2.0.1 bit_4.0.5

pbmc_small <- FilterGenes(object = pbmc_small, min.value = 0.5, min.cells = 100)
pbmc_small <- NormalizeData(pbmc_small)
pbmc_small <- FindVariableFeatures(pbmc_small, selection.method = "vst", nfeatures = 2000)
pbmc_small <- ScaleData(pbmc_small, features = rownames(pbmc_small))

pbmc_small <- RunPCA(pbmc_small, features = VariableFeatures(object = pbmc_small))

pbmc_small@meta.data$library_id <- as.factor(pbmc_small@meta.data$library_id)

pbmc_small <- RunHarmony(pbmc_small, group.by.vars="library_id", verbose = TRUE)
samuel-marsh commented 9 months ago

Hi,

Not member of dev team but hopefully can be helpful. RunHarmony is function from harmony package and not Seurat. I would suggest posting to harmony repo as the error seems to be related to that function.

Best, Sam