Issue with Seurat SpatialPlot: spots not filling the whole tissue image
1
0
Entering edit mode
2.7 years ago
akh22 ▴ 110

In Seurat, SpatialPlot generates a plot with an enlarged/expanded image of tissue section as compared to the original spot image. This seems to happen on the relatively small image with a number of spots around 500.

I 'd really appreciate any pointers to fix this.

SpatialPlot(DT006.rep1)

enter image description here

Original spot image:

enter image description here

Here is the 10xvisium Seurat object in question:

str(DT006.rep1@images)
List of 1
 $ slice1:Formal class 'VisiumV1' [package "Seurat"] with 6 slots
  .. ..@ image        : num [1:600, 1:600, 1:3] 0.698 0.847 0.851 0.851 0.851 ...
  .. ..@ scale.factors:List of 4
  .. .. ..$ spot    : num 0.15
  .. .. ..$ fiducial: num 145
  .. .. ..$ hires   : num 0.15
  .. .. ..$ lowres  : num 0.045
  .. .. ..- attr(*, "class")= chr "scalefactors"
  .. ..@ coordinates  :'data.frame':    481 obs. of  5 variables:
  .. .. ..$ tissue  : int [1:481] 1 1 1 1 1 1 1 1 1 1 ...
  .. .. ..$ row     : int [1:481] 42 37 35 45 42 47 44 40 47 48 ...
  .. .. ..$ col     : int [1:481] 28 19 79 67 96 69 56 96 39 42 ...
  .. .. ..$ imagerow: int [1:481] 6539 5941 5692 6893 6529 7133 6775 6289 7137 7257 ...
  .. .. ..$ imagecol: int [1:481] 4126 3504 7641 6816 8815 6954 6057 8814 4886 5093 ...
  .. ..@ spot.radius  : num 0.0109
  .. ..@ assay        : chr "Spatial"
  .. ..@ key          : chr "slice1_"

Sessioninfo:

sessionInfo() R version 4.1.0 (2021-05-18) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Big Sur 11.5.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/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] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.3.5      Seurat_4.0.3.9015  SeuratObject_4.0.2

loaded via a namespace (and not attached):
  [1] nlme_3.1-152          matrixStats_0.60.0    spatstat.sparse_2.0-0
  [4] RcppAnnoy_0.0.19      RColorBrewer_1.1-2    httr_1.4.2           
  [7] sctransform_0.3.2     tools_4.1.0           utf8_1.2.2           
 [10] R6_2.5.0              irlba_2.3.3           rpart_4.1-15         
 [13] KernSmooth_2.23-20    uwot_0.1.10           mgcv_1.8-36          
 [16] lazyeval_0.2.2        colorspace_2.0-2      withr_2.4.2          
 [19] tidyselect_1.1.1      gridExtra_2.3         compiler_4.1.0       
 [22] plotly_4.9.4.1        labeling_0.4.2        scales_1.1.1         
 [25] lmtest_0.9-38         spatstat.data_2.1-0   ggridges_0.5.3       
 [28] pbapply_1.4-3         goftest_1.2-2         stringr_1.4.0        
 [31] digest_0.6.27         spatstat.utils_2.2-0  pkgconfig_2.0.3      
 [34] htmltools_0.5.1.1     parallelly_1.27.0     fastmap_1.1.0        
 [37] htmlwidgets_1.5.3     rlang_0.4.11          shiny_1.6.0          
 [40] farver_2.1.0          generics_0.1.0        zoo_1.8-9            
 [43] jsonlite_1.7.2        ica_1.0-2             dplyr_1.0.7          
 [46] magrittr_2.0.1        patchwork_1.1.1       Matrix_1.3-4         
 [49] Rcpp_1.0.7            munsell_0.5.0         fansi_0.5.0          
 [52] abind_1.4-5           reticulate_1.20-9002  lifecycle_1.0.0      
 [55] stringi_1.7.3         MASS_7.3-54           Rtsne_0.15           
 [58] plyr_1.8.6            grid_4.1.0            parallel_4.1.0       
 [61] listenv_0.8.0         promises_1.2.0.1      ggrepel_0.9.1        
 [64] crayon_1.4.1          miniUI_0.1.1.1        deldir_0.2-10        
 [67] lattice_0.20-44       cowplot_1.1.1         splines_4.1.0        
 [70] tensor_1.5            pillar_1.6.2          igraph_1.2.6         
 [73] spatstat.geom_2.2-2   future.apply_1.8.1    reshape2_1.4.4       
 [76] codetools_0.2-18      leiden_0.3.9          glue_1.4.2           
 [79] data.table_1.14.0     png_0.1-7             vctrs_0.3.8          
 [82] httpuv_1.6.1          gtable_0.3.0          RANN_2.6.1           
 [85] purrr_0.3.4           spatstat.core_2.3-0   polyclip_1.10-0      
 [88] tidyr_1.1.3           scattermore_0.7       future_1.21.0        
 [91] mime_0.11             xtable_1.8-4          later_1.2.0          
 [94] survival_3.2-11       viridisLite_0.4.0     tibble_3.1.3         
 [97] cluster_2.1.2         globals_0.14.0        fitdistrplus_1.1-5   
[100] ellipsis_0.3.2        ROCR_1.0-11  
Seurat Tissue Transcriptomics 10xVisium • 1.4k views
ADD COMMENT
0
Entering edit mode

The image works fine in 10X's Loupe browser.

enter image description here

Bug with Seurat ?

ADD REPLY
0
Entering edit mode
2.5 years ago
akh22 ▴ 110

OK, I figured this out based on help from Joseph Ipe and particularly, Ricardo Melo Ferreira. As Ricardo mentioned, this appeared to be a bug that expand relatively small image. To fix this, all you have to do is to set crop=F and then adjust the size of spots.

enter image description here

ADD COMMENT

Login before adding your answer.

Traffic: 2475 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6