cole-trapnell-lab / monocle3

Other
318 stars 98 forks source link

Error in learn_graph: unused argument (rann.k = rann.k) #693

Open Fanny-bio opened 7 months ago

Fanny-bio commented 7 months ago

Hi All,

I met a problem when I ran trajectory analysis followed up on my Seurat analysis:

when I ran learn_graph, the first time error is as below:

> cds <- learn_graph(cds, use_partition = TRUE, verbose = FALSE)
 |======================================================================================| 100%
Error in dp_mst_list[[as.numeric(cur_partition)]] : 
  subscript out of bounds

And then I followed up ieiwk' comment,** https://github.com/cole-trapnell-lab/monocle3/issues/102#issuecomment-1017145515, the error became:

> cds <- learn_graph(cds, use_partition = TRUE, verbose = FALSE)
Error in monocle3:::multi_component_RGE(cds, scale = scale, reduction_method = reduction_method,  : 
  unused argument (rann.k = rann.k)

My full code is-

cds <- as.cell_data_set(RGC_FCRPB)
cds <- cluster_cells(cds)

cds@clusters$UMAP$clusters <- RGC_FCRPB@meta.data$seurat_clusters
names(cds@clusters$UMAP$clusters) <- rownames(RGC_FCRPB@meta.data)
reducedDims(cds)$UMAP <- RGC_FCRPB@reductions$umap@cell.embeddings

plot_cells(cds)

p1 <- plot_cells(cds, color_cells_by = "cluster", show_trajectory_graph = FALSE)
p2 <- plot_cells(cds, color_cells_by = "partition", show_trajectory_graph = FALSE)
wrap_plots(p1, p2)

integrated.sub <- subset(as.Seurat(cds, assay = NULL), monocle3_partitions == 1)
cds <- as.cell_data_set(integrated.sub)

cds <- learn_graph(cds, use_partition = TRUE, verbose = FALSE)

And my package version-

sessionInfo() R version 4.3.2 (2023-10-31 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 11 x64 (build 22621)

Matrix products: default

locale: [1] LC_COLLATE=Chinese (Simplified)_Hong Kong SAR.utf8 [2] LC_CTYPE=Chinese (Simplified)_Hong Kong SAR.utf8
[3] LC_MONETARY=Chinese (Simplified)_Hong Kong SAR.utf8 [4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_Hong Kong SAR.utf8

time zone: Asia/Hong_Kong tzcode source: internal

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

other attached packages: [1] patchwork_1.1.3 metap_1.9 cowplot_1.1.1
[4] ggraph_2.1.0 ggplot2_3.4.4 dplyr_1.1.4
[7] Seurat_5.0.1 SeuratObject_5.0.1 sp_2.1-2
[10] monocle3_1.3.4 SingleCellExperiment_1.24.0 SummarizedExperiment_1.32.0 [13] GenomicRanges_1.54.1 GenomeInfoDb_1.38.1 IRanges_2.36.0
[16] S4Vectors_0.40.2 MatrixGenerics_1.14.0 matrixStats_1.1.0
[19] Biobase_2.62.0 BiocGenerics_0.48.1 devtools_2.4.5
[22] usethis_2.2.2 BiocManager_1.30.22 SeuratWrappers_0.3.2
[25] remotes_2.4.2.1 R.utils_2.12.3 R.oo_1.25.0
[28] R.methodsS3_1.8.2

loaded via a namespace (and not attached): [1] RcppAnnoy_0.0.21 splines_4.3.2 later_1.3.1
[4] bitops_1.0-7 tibble_3.2.1 polyclip_1.10-6
[7] fastDummies_1.7.3 lifecycle_1.0.4 Rdpack_2.6
[10] rprojroot_2.0.4 globals_0.16.2 processx_3.8.2
[13] lattice_0.21-9 MASS_7.3-60 magrittr_2.0.3
[16] rmarkdown_2.25 plotly_4.10.3 plotrix_3.8-4
[19] yaml_2.3.7 qqconf_1.3.2 httpuv_1.6.12
[22] sn_2.1.1 sctransform_0.4.1 spam_2.10-0
[25] sessioninfo_1.2.2 pkgbuild_1.4.2 spatstat.sparse_3.0-3
[28] reticulate_1.34.0 minqa_1.2.6 pbapply_1.7-2
[31] RColorBrewer_1.1-3 multcomp_1.4-25 abind_1.4-5
[34] pkgload_1.3.3 zlibbioc_1.48.0 Rtsne_0.16
[37] purrr_1.0.2 RCurl_1.98-1.13 TH.data_1.1-2
[40] sandwich_3.0-2 tweenr_2.0.2 GenomeInfoDbData_1.2.11 [43] ggrepel_0.9.4 irlba_2.3.5.1 listenv_0.9.0
[46] spatstat.utils_3.0-4 terra_1.7-55 pheatmap_1.0.12
[49] TFisher_0.2.0 goftest_1.2-3 RSpectra_0.16-1
[52] spatstat.random_3.2-2 fitdistrplus_1.1-11 parallelly_1.36.0
[55] leiden_0.4.3.1 codetools_0.2-19 DelayedArray_0.28.0
[58] ggforce_0.4.1 tidyselect_1.2.0 farver_2.1.1
[61] viridis_0.6.4 lme4_1.1-35.1 spatstat.explore_3.2-5 [64] mathjaxr_1.6-0 jsonlite_1.8.8 multtest_2.56.0
[67] tidygraph_1.2.3 ellipsis_0.3.2 progressr_0.14.0
[70] ggridges_0.5.4 survival_3.5-7 tools_4.3.2
[73] ica_1.0-3 Rcpp_1.0.11 glue_1.6.2
[76] mnormt_2.1.1 gridExtra_2.3 SparseArray_1.2.2
[79] xfun_0.41 numDeriv_2016.8-1.1 withr_2.5.2
[82] fastmap_1.1.1 boot_1.3-28.1 fansi_1.0.5
[85] callr_3.7.3 digest_0.6.33 rsvd_1.0.5
[88] R6_2.5.1 mime_0.12 colorspace_2.1-0
[91] scattermore_1.2 tensor_1.5 spatstat.data_3.0-3
[94] utf8_1.2.4 tidyr_1.3.0 generics_0.1.3
[97] data.table_1.14.8 graphlayouts_1.0.2 prettyunits_1.2.0
[100] httr_1.4.7 htmlwidgets_1.6.4 S4Arrays_1.2.0
[103] uwot_0.1.16 pkgconfig_2.0.3 gtable_0.3.4
[106] lmtest_0.9-40 XVector_0.42.0 htmltools_0.5.7
[109] profvis_0.3.8 dotCall64_1.1-1 scales_1.3.0
[112] png_0.1-8 knitr_1.45 rstudioapi_0.15.0
[115] reshape2_1.4.4 nloptr_2.0.3 nlme_3.1-163
[118] curl_5.1.0 proxy_0.4-27 cachem_1.0.8
[121] zoo_1.8-12 stringr_1.5.1 KernSmooth_2.23-22
[124] parallel_4.3.2 miniUI_0.1.1.1 desc_1.4.2
[127] pillar_1.9.0 grid_4.3.2 vctrs_0.6.4
[130] RANN_2.6.1 urlchecker_1.0.1 promises_1.2.1
[133] xtable_1.8-4 cluster_2.1.4 evaluate_0.23
[136] mvtnorm_1.2-4 cli_3.6.1 compiler_4.3.2
[139] rlang_1.1.1 crayon_1.5.2 leidenbase_0.1.27
[142] mutoss_0.1-13 future.apply_1.11.0 labeling_0.4.3
[145] ps_1.7.5 plyr_1.8.9 fs_1.6.3
[148] stringi_1.7.12 viridisLite_0.4.2 deldir_2.0-2
[151] assertthat_0.2.1 munsell_0.5.0 lazyeval_0.2.2
[154] spatstat.geom_3.2-7 Matrix_1.6-4 RcppHNSW_0.5.0
[157] future_1.33.0 shiny_1.8.0 rbibutils_2.2.16
[160] ROCR_1.0-11 igraph_1.5.1 memoise_2.0.1

Does anyone know how to solve it? Thanks!