satijalab / seurat

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

Excess singletons with leidenalg #2615

Closed arkal closed 4 years ago

arkal commented 4 years ago

Hi,

Here's 10X data from 10k PBMCs from a healthy donor.

I processed the data as usual..... I removed high mito, high ribo, and nFeature_RNA outliers and then rand SCTransform (regressing out mito, ribo and cc) on the seurat object, then calculated PCs and ran FindNeighbors with default arguments.

Now if i run leidenalg with any resolution i get the same result. In this chunk I'm comparing runs of varying resolutions to resolution=0.25 and you can see that the vectors of cluster identities are identical. According to the algorithm, 6358 of my 6380 cells are singletons.

> for (i in c('SCT_snn_res.0.8', 'SCT_snn_res.1.2', 'SCT_snn_res.1.4', 'SCT_snn_res.10', 'SCT_snn_res.0.25')){
+   print(sum(pbmc@meta.data[[i]] != pbmc@meta.data[['SCT_snn_res.0.25"']]))
+ }
[1] 0
[1] 0
[1] 0
[1] 0
[1] 0

image

Louvain identifies clusters that are in line with what i'd expect. image

Am I doing something wrong here? How do i troubleshoot this?

Here's my sessionInfo()

R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so

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=C             
 [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       

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

other attached packages:
[1] scales_1.1.0     gridExtra_2.3    ggplot2_3.2.1    cowplot_1.0.0    dplyr_0.8.3     
[6] assertthat_0.2.1 Seurat_3.1.2     reticulate_1.14 

loaded via a namespace (and not attached):
  [1] TH.data_1.0-10      Rtsne_0.15          colorspace_1.4-1    ggridges_0.5.2     
  [5] rstudioapi_0.10     farver_2.0.1        leiden_0.3.1        listenv_0.8.0      
  [9] npsurv_0.4-0        ggrepel_0.8.1       RSpectra_0.16-0     mvtnorm_1.0-12     
 [13] codetools_0.2-16    splines_3.6.1       R.methodsS3_1.7.1   mnormt_1.5-5       
 [17] lsei_1.2-0          knitr_1.24          TFisher_0.2.0       zeallot_0.1.0      
 [21] jsonlite_1.6        ica_1.0-2           cluster_2.1.0       png_0.1-7          
 [25] R.oo_1.23.0         uwot_0.1.5          sctransform_0.2.1   compiler_3.6.1     
 [29] httr_1.4.1          backports_1.1.5     Matrix_1.2-17       lazyeval_0.2.2     
 [33] htmltools_0.4.0     tools_3.6.1         rsvd_1.0.2          igraph_1.2.4.2     
 [37] gtable_0.3.0        glue_1.3.1          RANN_2.6.1          reshape2_1.4.3     
 [41] rappdirs_0.3.1      Rcpp_1.0.3          Biobase_2.46.0      vctrs_0.2.1        
 [45] multtest_2.40.0     gdata_2.18.0        ape_5.3             nlme_3.1-140       
 [49] gbRd_0.4-11         lmtest_0.9-37       xfun_0.8            stringr_1.4.0      
 [53] globals_0.12.5      lifecycle_0.1.0     irlba_2.3.3         gtools_3.8.1       
 [57] future_1.15.1       MASS_7.3-51.4       zoo_1.8-7           parallel_3.6.1     
 [61] sandwich_2.5-1      RColorBrewer_1.1-2  yaml_2.2.0          pbapply_1.4-2      
 [65] stringi_1.4.5       mutoss_0.1-12       plotrix_3.7-7       caTools_1.17.1.4   
 [69] BiocGenerics_0.32.0 bibtex_0.4.2.2      Rdpack_0.11-1       SDMTools_1.1-221.2 
 [73] rlang_0.4.2         pkgconfig_2.0.3     bitops_1.0-6        evaluate_0.14      
 [77] lattice_0.20-38     ROCR_1.0-7          purrr_0.3.3         labeling_0.3       
 [81] htmlwidgets_1.5.1   tidyselect_0.2.5    RcppAnnoy_0.0.14    plyr_1.8.5         
 [85] magrittr_1.5        R6_2.4.1            gplots_3.0.1.2      multcomp_1.4-12    
 [89] withr_2.1.2         pillar_1.4.3        sn_1.5-4            fitdistrplus_1.0-14
 [93] survival_2.44-1.1   tibble_2.1.3        future.apply_1.4.0  tsne_0.1-3         
 [97] crayon_1.3.4        KernSmooth_2.23-15  plotly_4.9.1        rmarkdown_1.14     
[101] data.table_1.12.8   metap_1.2           digest_0.6.23       tidyr_1.0.0        
[105] numDeriv_2016.8-1.1 R.utils_2.9.2       RcppParallel_4.4.4  stats4_3.6.1       
[109] munsell_0.5.0       viridisLite_0.3.0  
chlee-tabin commented 4 years ago

https://github.com/satijalab/seurat/issues/2438

This is a known bug and should be resolved by upgrading to 3.1.3.

arkal commented 4 years ago

Ugh i forgot to look in closed issues and only looked at open ones. Thanks!