welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
389 stars 78 forks source link

suggestK function could not work with seurat object #228

Closed LeoCao-X closed 3 years ago

LeoCao-X commented 3 years ago

Dear author: I tried to integrate two seurat object with rliger package and I followed tutriol from seurat. https://htmlpreview.github.io/?https://github.com/satijalab/seurat.wrappers/blob/master/docs/liger.html I tried suggestK function to find a best K for my data. But suggestK kept returning back error message

Error in suggestK(combined.data, k.test = seq(5, 100, 5), lambda = 5, : no slot of name "scale.data" for this object of class "Seurat"

But I definitely had scaled my data with seurat ScaleData() function and there was just one assay with my data. Do you know how to figure it out? Thanks a lot!

sessionInfo() R version 4.0.3 (2020-10-10) Platform: x86_64-conda-linux-gnu (64-bit) Running under: Gentoo/Linux locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] future_1.21.0 ggplot2_3.3.3 dplyr_1.0.3
[4] SeuratWrappers_0.3.0 Seurat_3.2.3 rliger_1.0.0
[7] patchwork_1.1.1 Matrix_1.3-2 cowplot_1.1.1
loaded via a namespace (and not attached): [1] nlme_3.1-151 matrixStats_0.57.0 bit64_4.0.5
[4] RcppAnnoy_0.0.18 doParallel_1.0.16 RColorBrewer_1.1-2
[7] httr_1.4.2 sctransform_0.3.2 tools_4.0.3
[10] R6_2.5.0 irlba_2.3.3 rpart_4.1-15
[13] KernSmooth_2.23-18 uwot_0.1.10 mgcv_1.8-36
[16] lazyeval_0.2.2 colorspace_2.0-0 withr_2.4.0
[19] tidyselect_1.1.0 gridExtra_2.3 bit_4.0.4
[22] compiler_4.0.3 hdf5r_1.3.3 plotly_4.9.3
[25] labeling_0.4.2 scales_1.1.1 lmtest_0.9-38
[28] spatstat.data_2.1-0 ggridges_0.5.3 pbapply_1.4-3
[31] spatstat_1.64-1 goftest_1.2-2 stringr_1.4.0
[34] digest_0.6.27 spatstat.utils_2.1-0 pkgconfig_2.0.3
[37] htmltools_0.5.1.1 parallelly_1.23.0 fastmap_1.0.1
[40] htmlwidgets_1.5.3 rlang_0.4.10 FNN_1.1.3
[43] shiny_1.5.0 farver_2.0.3 generics_0.1.0
[46] zoo_1.8-8 riverplot_0.10 jsonlite_1.7.2
[49] ica_1.0-2 mclust_5.4.7 magrittr_2.0.1
[52] Rcpp_1.0.6 munsell_0.5.0 abind_1.4-5
[55] reticulate_1.18 lifecycle_0.2.0 stringi_1.5.3
[58] MASS_7.3-53 Rtsne_0.15 plyr_1.8.6
[61] grid_4.0.3 parallel_4.0.3 listenv_0.8.0
[64] promises_1.1.1 ggrepel_0.9.1 crayon_1.3.4
[67] deldir_0.2-9 miniUI_0.1.1.1 lattice_0.20-41
[70] splines_4.0.3 tensor_1.5 pillar_1.4.7
[73] igraph_1.2.6 future.apply_1.7.0 reshape2_1.4.4
[76] codetools_0.2-18 leiden_0.3.6 glue_1.4.2
[79] remotes_2.4.0 BiocManager_1.30.10 data.table_1.13.6
[82] vctrs_0.3.6 png_0.1-7 httpuv_1.5.5
[85] foreach_1.5.1 gtable_0.3.0 RANN_2.6.1
[88] purrr_0.3.4 polyclip_1.10-0 tidyr_1.1.2
[91] scattermore_0.7 rsvd_1.0.3 mime_0.9
[94] xtable_1.8-4 RSpectra_0.16-0 later_1.1.0.1
[97] survival_3.2-7 viridisLite_0.4.0 tibble_3.0.5
[100] iterators_1.0.13 cluster_2.1.0 globals_0.14.0
[103] fitdistrplus_1.1-3 ellipsis_0.3.1 ROCR_1.0-11

cgao90 commented 3 years ago

Hi, suggestK only works with liger object. So it fails if combined.data here is a Seurat object. You can also check this discussion #229 about using suggestK to find the best K. Hope this helps.

LeoCao-X commented 3 years ago

Thanks for your reply! I will try to test some k values manually.