seurat icon indicating copy to clipboard operation
seurat copied to clipboard

A bunch of bugs in Spatial-Plots!

Open QqQss opened this issue 2 years ago • 2 comments

Hi, I found many BUGs in Spatial-related plotting functions in Seurat v4.0+ which are not in v3.6.

1. 'crop=True' produces irregular size of image figure! This issue was already reported many times: https://github.com/satijalab/seurat/issues/5141 https://github.com/satijalab/seurat/issues/5543

2. In SpatialDimPlot, 'group.by' parameter doesn't work, and must set 'Idents' before!

seu <- LoadData("stxBrain", type = "anterior1")
[email protected]$g1 <- sample(c("A","B"), ncol(seu), replace=T)
SpatialDimPlot(seu, group.by="g1", pt.size.factor=1, label=T, label.size=8)
Idents(seu) <- "g1"
SpatialDimPlot(seu,  pt.size.factor=1, label=T, label.size=8)

image image

3. In SpatialDimPlot, setting 'cols' would raise an error!

SpatialDimPlot(seu,  pt.size.factor=1, label=T, label.size=8, cols=c("#E64B35FF","#4DBBD5FF"))

image

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /share/modules/R/R-4.1.2/lib/R/lib/libRblas.so
LAPACK: /share/modules/R/R-4.1.2/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] stxBrain.SeuratData_0.1.1   pbmc3k.SeuratData_3.1.4     SeuratData_0.2.1            SingleCellExperiment_1.16.0 SummarizedExperiment_1.24.0 Biobase_2.54.0              GenomicRanges_1.46.1       
 [8] GenomeInfoDb_1.30.1         IRanges_2.28.0              S4Vectors_0.32.3            BiocGenerics_0.40.0         MatrixGenerics_1.6.0        matrixStats_0.62.0          sp_1.4-7                   
[15] SeuratObject_4.1.0          Seurat_4.1.1                ggfittext_0.9.1             ggrastr_1.0.1               ggsci_2.9                   ggpubr_0.4.0                tictoc_1.0.1               
[22] doParallel_1.0.17           iterators_1.0.14            foreach_1.5.2               R.utils_2.11.0              R.oo_1.24.0                 R.methodsS3_1.8.1           forcats_0.5.1              
[29] readr_2.1.2                 tidyr_1.2.0                 tibble_3.1.7                ggplot2_3.3.6               tidyverse_1.3.1             furrr_0.3.0                 future_1.25.0              
[36] purrr_0.3.4                 stringr_1.4.0               dplyr_1.0.9                 plyr_1.8.7                  reshape2_1.4.4              colorout_1.2-2             

loaded via a namespace (and not attached):
  [1] utf8_1.2.2             reticulate_1.25        tidyselect_1.1.2       htmlwidgets_1.5.4      grid_4.1.2             Rtsne_0.16             munsell_0.5.0          codetools_0.2-18       ica_1.0-2             
 [10] miniUI_0.1.1.1         withr_2.5.0            spatstat.random_2.2-0  colorspace_2.0-3       progressr_0.10.0       knitr_1.39             rstudioapi_0.13        ROCR_1.0-11            ggsignif_0.6.3        
 [19] tensor_1.5             listenv_0.8.0          labeling_0.4.2         GenomeInfoDbData_1.2.7 polyclip_1.10-0        farver_2.1.0           parallelly_1.31.1      vctrs_0.4.1            generics_0.1.2        
 [28] xfun_0.31              R6_2.5.1               ggbeeswarm_0.6.0       bitops_1.0-7           spatstat.utils_2.3-1   DelayedArray_0.20.0    assertthat_0.2.1       promises_1.2.0.1       scales_1.2.0          
 [37] rgeos_0.5-9            beeswarm_0.4.0         gtable_0.3.0           globals_0.15.0         goftest_1.2-3          rlang_1.0.2            splines_4.1.2          rstatix_0.7.0          lazyeval_0.2.2        
 [46] spatstat.geom_2.4-0    broom_0.8.0            yaml_2.3.5             abind_1.4-5            modelr_0.1.8           backports_1.4.1        httpuv_1.6.5           tools_4.1.2            ellipsis_0.3.2        
 [55] spatstat.core_2.4-2    RColorBrewer_1.1-3     ggridges_0.5.3         Rcpp_1.0.8.3           zlibbioc_1.40.0        RCurl_1.98-1.6         rpart_4.1.16           deldir_1.0-6           pbapply_1.5-0         
 [64] cowplot_1.1.1          zoo_1.8-10             haven_2.5.0            ggrepel_0.9.1          cluster_2.1.3          fs_1.5.2               magrittr_2.0.3         RSpectra_0.16-1        data.table_1.14.2     
 [73] scattermore_0.8        lmtest_0.9-40          reprex_2.0.1           RANN_2.6.1             fitdistrplus_1.1-8     hms_1.1.1              patchwork_1.1.1        mime_0.12              evaluate_0.15         
 [82] xtable_1.8-4           RhpcBLASctl_0.21-247.1 readxl_1.4.0           gridExtra_2.3          compiler_4.1.2         KernSmooth_2.23-20     crayon_1.5.1           htmltools_0.5.2        mgcv_1.8-40           
 [91] later_1.3.0            tzdb_0.3.0             lubridate_1.8.0        DBI_1.1.2              dbplyr_2.1.1           rappdirs_0.3.3         MASS_7.3-57            Matrix_1.4-1           car_3.0-13            
[100] cli_3.3.0              igraph_1.3.1           pkgconfig_2.0.3        plotly_4.10.0          spatstat.sparse_2.1-1  xml2_1.3.3             vipor_0.4.5            XVector_0.34.0         rvest_1.0.2           
[109] digest_0.6.29          sctransform_0.3.3      RcppAnnoy_0.0.19       spatstat.data_2.2-0    rmarkdown_2.14         cellranger_1.1.0       leiden_0.4.2           uwot_0.1.11            shiny_1.7.1           
[118] lifecycle_1.0.1        nlme_3.1-157           jsonlite_1.8.0         carData_3.0-5          viridisLite_0.4.0      fansi_1.0.3            pillar_1.7.0           lattice_0.20-45        fastmap_1.1.0         
[127] httr_1.4.3             survival_3.3-1         glue_1.6.2             png_0.1-7              stringi_1.7.6          irlba_2.3.5            future.apply_1.9.0  

QqQss avatar May 19 '22 12:05 QqQss

Hi Seurat team. I just want to echo point 3 by QqQss, the issue with colors and SpatialDimPlot. I also saw this in Seurat v4.1.0 (but not with plain DimPlot). When I downgraded to Seurat v4.0.6, the problem resolved. Thanks for working on this! Best- Orr

orrzor avatar Jul 22 '22 21:07 orrzor

Hi Seurat team, thank you so much for your amazing work!!! I'm also seeing the above bugs in Seurat 4.1.1. Thank you for looking into this!

MarcElosua avatar Sep 01 '22 13:09 MarcElosua

Hi Seurat, pinging this issue again cause I'm having the exact same issue in Seurat 4.1.1! I would be great to have a fix!

MohamedAbdalfatah avatar May 09 '23 17:05 MohamedAbdalfatah