satijalab / seurat

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

Error in UseMethod(generic = "GetTissueCoordinates", object = object) : no applicable method for 'GetTissueCoordinates' applied to an object of class "VisiumV2" #9061

Closed jadewu77 closed 2 months ago

jadewu77 commented 3 months ago

Hi Seurat team,

While studying 10x Visium, I loaded the stxBrain data according to the tutorial. However, I encountered an error when executing plot2 <- SpatialFeaturePlot(brain, features = "nCount_Spatial") + theme(legend.position = "right").

The versions of the packages I am using are as follows: [1] ggplot2_3.5.0.9000 dplyr_1.1.3 patchwork_1.2.0.9000 stxBrain.SeuratData_0.1.2 [5] SeuratData_0.2.1 Seurat_5.0.3 SeuratObject_5.0.1 sp_2.1-1
[9] Matrix_1.6-5

And the DefaultAssay of brain is Spatial. I have tried some solutions, but they don't work. Is there a way to solve this problem?Thank you.

InstallData("stxBrain")
brain <- LoadData("stxBrain", type = "anterior1")
plot1 <- VlnPlot(brain, features = "nCount_Spatial", pt.size = 0.1) + NoLegend()
plot2 <- SpatialFeaturePlot(brain, features = "nCount_Spatial") + theme(legend.position = "right")
Error in UseMethod(generic = "DefaultAssay", object = object) : 
  no applicable method for 'DefaultAssay' applied to an object of class "VisiumV2"
dcollins15 commented 3 months ago

This is a known issue - we should be releasing a patch soon 👍

Apologies @jadewu77, you should also be able to resolve this issue by upgrading to Seurat v5.1.0

jadewu77 commented 2 months ago

Thank you for your reply. @dcollins15

jiw181 commented 1 month ago

I had this problem with Seurat v5.1.0. Any suggestions? Thanks!

The code is: pacman::p_load("Redeconve", "Seurat", "SeuratData", "writexl", "ggfortify", "patchwork") brain <- LoadData("stxBrain", type = "anterior1") SpatialFeaturePlot(brain, features = "nCount_Spatial") + theme(legend.position = "right")

The error is: Error in UseMethod(generic = "DefaultAssay", object = object) : no applicable method for 'DefaultAssay' applied to an object of class "VisiumV2"

The sessionInfo is: R version 4.3.0 (2023-04-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux

Matrix products: default BLAS: /usr/lib64/libblas.so.3.4.2 LAPACK: /usr/lib64/liblapack.so.3.4.2

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

time zone: America/New_York tzcode source: system (glibc)

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

other attached packages: [1] stxBrain.SeuratData_0.1.2 patchwork_1.2.0.9000
[3] ggfortify_0.4.16 writexl_1.5.0
[5] SeuratData_0.2.2 Seurat_5.1.0
[7] SeuratObject_5.0.2 sp_1.6-0
[9] Redeconve_1.1.2 scatterpie_0.1.9
[11] igraph_1.4.2 ggrepel_0.9.3
[13] ggplot2_3.5.0.9000 foreach_1.5.2

loaded via a namespace (and not attached): [1] RColorBrewer_1.1-3 rstudioapi_0.14
[3] jsonlite_1.8.4 magrittr_2.0.3
[5] ggbeeswarm_0.7.2 spatstat.utils_3.0-2.001 [7] farver_2.1.1 vctrs_0.6.5
[9] ROCR_1.0-11 spatstat.explore_3.1-0
[11] htmltools_0.5.5 sctransform_0.4.1
[13] parallelly_1.35.0 KernSmooth_2.23-20
[15] htmlwidgets_1.6.2 ica_1.0-3
[17] plyr_1.8.8 plotly_4.10.1
[19] zoo_1.8-12 mime_0.12
[21] lifecycle_1.0.3 iterators_1.0.14
[23] pkgconfig_2.0.3 Matrix_1.6-5
[25] R6_2.5.1 fastmap_1.1.1
[27] fitdistrplus_1.1-11 future_1.32.0
[29] shiny_1.7.4 digest_0.6.31
[31] colorspace_2.1-0 tensor_1.5
[33] RSpectra_0.16-1 irlba_2.3.5.1
[35] labeling_0.4.2 progressr_0.13.0
[37] fansi_1.0.4 spatstat.sparse_3.0-1
[39] httr_1.4.5 polyclip_1.10-4
[41] abind_1.4-5 compiler_4.3.0
[43] withr_2.5.0 fastDummies_1.7.3
[45] ggforce_0.4.1 MASS_7.3-59
[47] rappdirs_0.3.3 tools_4.3.0
[49] vipor_0.4.5 lmtest_0.9-40
[51] beeswarm_0.4.0 httpuv_1.6.9
[53] future.apply_1.10.0 goftest_1.2-3
[55] glue_1.6.2 nlme_3.1-162
[57] promises_1.2.0.1 grid_4.3.0
[59] Rtsne_0.16 cluster_2.1.4
[61] reshape2_1.4.4 generics_0.1.3
[63] gtable_0.3.3 spatstat.data_3.0-1
[65] tidyr_1.3.0 data.table_1.14.8
[67] utf8_1.2.3 spatstat.geom_3.1-0.002 [69] RcppAnnoy_0.0.20 RANN_2.6.1
[71] pillar_1.9.0 stringr_1.5.0
[73] spam_2.9-1 RcppHNSW_0.4.1
[75] later_1.3.0 splines_4.3.0
[77] dplyr_1.1.2 tweenr_2.0.2
[79] lattice_0.21-8 survival_3.5-5
[81] deldir_1.0-6 tidyselect_1.2.0
[83] miniUI_0.1.1.1 pbapply_1.7-0
[85] gridExtra_2.3 scattermore_1.2
[87] matrixStats_0.63.0 stringi_1.7.12
[89] lazyeval_0.2.2 ggfun_0.0.9
[91] pacman_0.5.1 codetools_0.2-19
[93] tibble_3.2.1 cli_3.6.1
[95] uwot_0.1.14 xtable_1.8-4
[97] reticulate_1.28 munsell_0.5.0
[99] Rcpp_1.0.10 globals_0.16.2
[101] spatstat.random_3.1-4 png_0.1-8
[103] ggrastr_1.0.1 parallel_4.3.0
[105] ellipsis_0.3.2 dotCall64_1.0-2
[107] listenv_0.9.0 viridisLite_0.4.1
[109] scales_1.3.0 ggridges_0.5.4
[111] leiden_0.4.3 purrr_1.0.1
[113] crayon_1.5.2 rlang_1.1.4
[115] cowplot_1.1.1