Hi,
I was trying to find clusters that will subsequently be used in 'clustree'. However, I cannot seem to set the random seed that would give the same results everytime I run the code. For example:
RESOLUTION_PARAMS <- seq(1.2,3,0.4)
SEED <- 12597
set.seed(SEED)
test1 <- FindNeighbors(seudat2, dims = 1:10,reduction="pca")
test1clust <- FindClusters(test1, resolution = RESOLUTION_PARAMS,reduction.type="pca",random.seed = SEED)
set.seed(SEED)
test2 <- FindNeighbors(seudat2, dims = 1:10,reduction="pca")
test2clust <- FindClusters(test2, resolution = RESOLUTION_PARAMS,reduction.type="pca",random.seed = SEED)
When I run this code, I seed to get different results:
> identical(test1,test2)
[1] FALSE
> identical(test1clust,test2clust)
[1] FALSE
I checked the 'FindNeighbors' documentation, and there doesn't appear to be a parameter to set the seed. What do I need to set/do?
thanks!
=============== My sessioninfo:
sessionInfo() R version 4.0.4 (2021-02-15) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 10.16
Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] clustree_0.4.3 ggraph_2.0.5 ggplot2_3.3.3 MAST_1.16.0
[5] SingleCellExperiment_1.12.0 SummarizedExperiment_1.20.0 Biobase_2.50.0 GenomicRanges_1.42.0
[9] GenomeInfoDb_1.26.7 IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.1
[13] MatrixGenerics_1.2.1 matrixStats_0.58.0 patchwork_1.1.1 SeuratObject_4.0.0
[17] Seurat_4.0.1 dplyr_1.0.5
loaded via a namespace (and not attached):
[1] Rtsne_0.15 colorspace_2.0-0 deldir_0.2-10 ellipsis_0.3.1 ggridges_0.5.3
[6] XVector_0.30.0 rstudioapi_0.13 spatstat.data_2.1-0 farver_2.1.0 leiden_0.3.7
[11] listenv_0.8.0 graphlayouts_0.7.1 ggrepel_0.9.1 fansi_0.4.2 codetools_0.2-18
[16] splines_4.0.4 polyclip_1.10-0 jsonlite_1.7.2 ica_1.0-2 cluster_2.1.2
[21] png_0.1-7 uwot_0.1.10 ggforce_0.3.3 shiny_1.6.0 sctransform_0.3.2
[26] spatstat.sparse_2.0-0 compiler_4.0.4 httr_1.4.2 backports_1.2.1 assertthat_0.2.1
[31] Matrix_1.3-2 fastmap_1.1.0 lazyeval_0.2.2 tweenr_1.0.2 later_1.2.0
[36] htmltools_0.5.1.1 tools_4.0.4 igraph_1.2.6 gtable_0.3.0 glue_1.4.2
[41] GenomeInfoDbData_1.2.4 RANN_2.6.1 reshape2_1.4.4 Rcpp_1.0.6 scattermore_0.7
[46] vctrs_0.3.7 nlme_3.1-152 lmtest_0.9-38 stringr_1.4.0 globals_0.14.0
[51] mime_0.10 miniUI_0.1.1.1 lifecycle_1.0.0 irlba_2.3.3 goftest_1.2-2
[56] future_1.21.0 MASS_7.3-53.1 zlibbioc_1.36.0 zoo_1.8-9 scales_1.1.1
[61] tidygraph_1.2.0 spatstat.core_2.1-2 promises_1.2.0.1 spatstat.utils_2.1-0 RColorBrewer_1.1-2
[66] reticulate_1.19 pbapply_1.4-3 gridExtra_2.3 rpart_4.1-15 stringi_1.5.3
[71] checkmate_2.0.0 rlang_0.4.10 pkgconfig_2.0.3 bitops_1.0-7 lattice_0.20-41
[76] ROCR_1.0-11 purrr_0.3.4 tensor_1.5 labeling_0.4.2 htmlwidgets_1.5.3
[81] cowplot_1.1.1 tidyselect_1.1.0 parallelly_1.24.0 RcppAnnoy_0.0.18 plyr_1.8.6
[86] magrittr_2.0.1 R6_2.5.0 generics_0.1.0 DelayedArray_0.16.3 DBI_1.1.1
[91] withr_2.4.2 pillar_1.6.0 mgcv_1.8-35 fitdistrplus_1.1-3 survival_3.2-10
[96] abind_1.4-5 RCurl_1.98-1.3 tibble_3.1.1 future.apply_1.7.0 crayon_1.4.1
[101] KernSmooth_2.23-18 utf8_1.2.1 spatstat.geom_2.1-0 plotly_4.9.3 viridis_0.6.0
[106] grid_4.0.4 data.table_1.14.0 digest_0.6.27 xtable_1.8-4 tidyr_1.1.3
[111] httpuv_1.6.0 munsell_0.5.0 viridisLite_0.4.0