smorabit / hdWGCNA

High dimensional weighted gene co-expression network analysis
https://smorabit.github.io/hdWGCNA/
Other
315 stars 31 forks source link

get error "MetacellsByGroups" #216

Closed wangmhan closed 3 months ago

wangmhan commented 3 months ago

Thank you developing this package!

Describe the bug I tried to follow the tutorial and got error when run the code for MetacellsByGroups. The error message: Error in .subscript.2ary(x, i, j, drop = drop) : subscript out of bounds

Steps to reproduce

seurat_obj <- MetacellsByGroups(
  seurat_obj = seurat_obj,
  group.by = c("final_annotation"), # specify the columns in seurat_obj@meta.data to group by
  reduction = 'pca', # select the dimensionality reduction to perform KNN on
  k = 20, # nearest-neighbors parameter
  max_shared = 10, # maximum number of shared cells between two metacells
  ident.group = 'final_annotation' # set the Idents of the metacell seurat object
)

Any suggestions is appreciated! In the beginning it showed another error message, seems related to SCTransform. But now I can run this code: seurat_obj <- SCTransform(seurat_obj, vars.to.regress = "percent.mt", verbose = FALSE). Not sure if it related to the version of sctransform, now is v0.4.1. But I cannot downgrade it to v0.4.0...

R session info R version 4.3.2 (2023-10-31) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Sonoma 14.2.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-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

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: Europe/Zurich tzcode source: internal

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

other attached packages: [1] reshape2_1.4.4
[2] dplyr_1.1.4
[3] gridExtra_2.3
[4] viridis_0.6.4
[5] viridisLite_0.4.2
[6] RColorBrewer_1.1-3
[7] SingleCellExperiment_1.24.0 [8] SummarizedExperiment_1.32.0 [9] Biobase_2.62.0
[10] GenomicRanges_1.54.1
[11] GenomeInfoDb_1.38.5
[12] IRanges_2.36.0
[13] S4Vectors_0.40.2
[14] BiocGenerics_0.48.1
[15] MatrixGenerics_1.14.0
[16] matrixStats_1.2.0
[17] hdWGCNA_0.2.26
[18] ggrepel_0.9.5
[19] ggplot2_3.4.4
[20] harmony_1.2.0
[21] Rcpp_1.0.12
[22] SeuratObject_4.1.4
[23] Seurat_4.4.0

loaded via a namespace (and not attached): [1] fs_1.6.3
[2] spatstat.sparse_3.0-3
[3] bitops_1.0-7
[4] devtools_2.4.5
[5] httr_1.4.7
[6] doParallel_1.0.17
[7] dynamicTreeCut_1.63-1
[8] backports_1.4.1
[9] profvis_0.3.8
[10] tools_4.3.2
[11] sctransform_0.4.1
[12] utf8_1.2.4
[13] R6_2.5.1
[14] lazyeval_0.2.2
[15] uwot_0.1.16
[16] urlchecker_1.0.1
[17] withr_3.0.0
[18] sp_2.1-2
[19] preprocessCore_1.64.0
[20] progressr_0.14.0
[21] WGCNA_1.72-5
[22] cli_3.6.2
[23] spatstat.explore_3.2-5
[24] spatstat.data_3.0-4
[25] ggridges_0.5.6
[26] pbapply_1.7-2
[27] foreign_0.8-86
[28] parallelly_1.36.0
[29] sessioninfo_1.2.2
[30] limma_3.58.1
[31] impute_1.76.0
[32] rstudioapi_0.15.0
[33] RSQLite_2.3.5
[34] generics_0.1.3
[35] ica_1.0-3
[36] spatstat.random_3.2-2
[37] GO.db_3.18.0
[38] Matrix_1.6-5
[39] fansi_1.0.6
[40] abind_1.4-5
[41] lifecycle_1.0.4
[42] yaml_2.3.8
[43] edgeR_4.0.12
[44] SparseArray_1.2.3
[45] BiocFileCache_2.10.1
[46] Rtsne_0.17
[47] grid_4.3.2
[48] blob_1.2.4
[49] promises_1.2.1
[50] dqrng_0.3.2
[51] ExperimentHub_2.10.0
[52] crayon_1.5.2
[53] miniUI_0.1.1.1
[54] lattice_0.22-5
[55] beachmat_2.18.0
[56] cowplot_1.1.3
[57] KEGGREST_1.42.0
[58] scGate_1.4.1
[59] pillar_1.9.0
[60] knitr_1.45
[61] metapod_1.10.1
[62] future.apply_1.11.1
[63] codetools_0.2-19
[64] leiden_0.4.3.1
[65] glue_1.7.0
[66] data.table_1.14.10
[67] remotes_2.4.2.1
[68] vctrs_0.6.5
[69] png_0.1-8
[70] gtable_0.3.4
[71] cachem_1.0.8
[72] xfun_0.41
[73] S4Arrays_1.2.0
[74] mime_0.12
[75] survival_3.5-7
[76] pheatmap_1.0.12
[77] iterators_1.0.14
[78] statmod_1.5.0
[79] bluster_1.12.0
[80] interactiveDisplayBase_1.40.0 [81] ellipsis_0.3.2
[82] fitdistrplus_1.1-11
[83] ROCR_1.0-11
[84] nlme_3.1-164
[85] usethis_2.2.2
[86] bit64_4.0.5
[87] filelock_1.0.3
[88] RcppAnnoy_0.0.21
[89] irlba_2.3.5.1
[90] rpart_4.1.23
[91] KernSmooth_2.23-22
[92] colorspace_2.1-0
[93] DBI_1.2.1
[94] Hmisc_5.1-1
[95] nnet_7.3-19
[96] celldex_1.12.0
[97] UCell_2.6.2
[98] tidyselect_1.2.0
[99] bit_4.0.5
[100] compiler_4.3.2
[101] curl_5.2.0
[102] htmlTable_2.4.2
[103] BiocNeighbors_1.20.2
[104] DelayedArray_0.28.0
[105] plotly_4.10.4
[106] checkmate_2.3.1
[107] scales_1.3.0
[108] lmtest_0.9-40
[109] rappdirs_0.3.3
[110] stringr_1.5.1
[111] digest_0.6.34
[112] goftest_1.2-3
[113] spatstat.utils_3.0-4
[114] rmarkdown_2.25
[115] XVector_0.42.0
[116] htmltools_0.5.7
[117] pkgconfig_2.0.3
[118] base64enc_0.1-3
[119] sparseMatrixStats_1.14.0
[120] dbplyr_2.4.0
[121] fastmap_1.1.1
[122] rlang_1.1.3
[123] htmlwidgets_1.6.4
[124] shiny_1.8.0
[125] DelayedMatrixStats_1.24.0
[126] zoo_1.8-12
[127] jsonlite_1.8.8
[128] BiocParallel_1.36.0
[129] BiocSingular_1.18.0
[130] RCurl_1.98-1.14
[131] magrittr_2.0.3
[132] Formula_1.2-5
[133] scuttle_1.12.0
[134] GenomeInfoDbData_1.2.11
[135] patchwork_1.2.0
[136] munsell_0.5.0
[137] reticulate_1.34.0
[138] stringi_1.8.3
[139] zlibbioc_1.48.0
[140] MASS_7.3-60.0.1
[141] AnnotationHub_3.10.0
[142] plyr_1.8.9
[143] pkgbuild_1.4.3
[144] parallel_4.3.2
[145] listenv_0.9.0
[146] deldir_2.0-2
[147] Biostrings_2.70.1
[148] splines_4.3.2
[149] tensor_1.5
[150] locfit_1.5-9.8
[151] igraph_1.6.0
[152] fastcluster_1.2.6
[153] spatstat.geom_3.2-7
[154] ScaledMatrix_1.10.0
[155] pkgload_1.3.4
[156] BiocVersion_3.18.1
[157] evaluate_0.23
[158] tester_0.1.7
[159] scran_1.30.1
[160] BiocManager_1.30.22
[161] foreach_1.5.2
[162] httpuv_1.6.13
[163] RANN_2.6.1
[164] tidyr_1.3.0
[165] purrr_1.0.2
[166] polyclip_1.10-6
[167] future_1.33.1
[168] scattermore_1.2
[169] rsvd_1.0.5
[170] xtable_1.8-4
[171] later_1.3.2
[172] tibble_3.2.1
[173] memoise_2.0.1
[174] AnnotationDbi_1.64.1
[175] cluster_2.1.6
[176] globals_0.16.2

best regards