-
Notifications
You must be signed in to change notification settings - Fork 13
Description
My environment : Seurat_5.4.0 SeuratObject_5.3.0 sp_2.2-0 schard_0.0.1
h5ad2seurat_spatial work
butSpatialDimPlot do cannot work
> ################ 空间转录组:h5ad2seurat
> # download.file('https://datasets.cellxgene.cziscience.com/c5ac5c36-f60c-4680-8018-2d6cb65c0a37.h5ad','vis.heart.h5ad')
> ## 1.load all visium samples as single Seurat object
> visx = schard::h5ad2seurat_spatial('vis.heart.h5ad')
> Command(visx)
NULL
> visx
An object of class Seurat
17912 features across 11312 samples within 1 assay
Active assay: Spatial (17912 features, 0 variable features)
3 layers present: counts.1, counts.2, counts.3
3 images present: HCAHeartST11702008, HCAHeartST11702009, HCAHeartST11702010
> head([email protected])
orig.ident nCount_Spatial nFeature_Spatial
HCAHeartST11702008_AAACAAGTATCTCCCA-1 HCAHeartST11702008 3833.410 4556
HCAHeartST11702008_AAACACCAATAACTGC-1 HCAHeartST11702008 3323.598 2133
HCAHeartST11702008_AAACAGAGCGACTCCT-1 HCAHeartST11702008 3231.206 2003
HCAHeartST11702008_AAACAGCTTTCAGAAG-1 HCAHeartST11702008 3881.004 4027
HCAHeartST11702008_AAACAGGGTCTATATT-1 HCAHeartST11702008 4045.244 4048
HCAHeartST11702008_AAACATGGTGAGAGGA-1 HCAHeartST11702008 3777.607 3304
spot_id n_genes_by_counts
HCAHeartST11702008_AAACAAGTATCTCCCA-1 HCAHeartST11702008_AAACAAGTATCTCCCA-1 4557
HCAHeartST11702008_AAACACCAATAACTGC-1 HCAHeartST11702008_AAACACCAATAACTGC-1 2134
HCAHeartST11702008_AAACAGAGCGACTCCT-1 HCAHeartST11702008_AAACAGAGCGACTCCT-1 2004
HCAHeartST11702008_AAACAGCTTTCAGAAG-1 HCAHeartST11702008_AAACAGCTTTCAGAAG-1 4028
HCAHeartST11702008_AAACAGGGTCTATATT-1 HCAHeartST11702008_AAACAGGGTCTATATT-1 4049
HCAHeartST11702008_AAACATGGTGAGAGGA-1 HCAHeartST11702008_AAACATGGTGAGAGGA-1 3305
log1p_n_genes_by_counts total_counts log1p_total_counts
HCAHeartST11702008_AAACAAGTATCTCCCA-1 8.424639 14605 9.589188
HCAHeartST11702008_AAACACCAATAACTGC-1 7.666222 3628 8.196712
HCAHeartST11702008_AAACAGAGCGACTCCT-1 7.603399 3318 8.107419
HCAHeartST11702008_AAACAGCTTTCAGAAG-1 8.301273 10940 9.300272
HCAHeartST11702008_AAACAGGGTCTATATT-1 8.306472 10116 9.221972
HCAHeartST11702008_AAACATGGTGAGAGGA-1 8.103495 7403 8.909776
···
> table(visx$orig.ident)
HCAHeartST11702008 HCAHeartST11702009 HCAHeartST11702010
3533 3982 3797
> # 可视化:空转切片图
> visx <- UpdateSeuratObject(visx)
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Ensuring keys are in the proper structure
Ensuring feature names don't have underscores or pipes
Updating slots in Spatial
Updating slots in HCAHeartST11702008
Updating slots in HCAHeartST11702009
Updating slots in HCAHeartST11702010
Validating object structure for Assay5 ‘Spatial’
Validating object structure for VisiumV1 ‘HCAHeartST11702008’
Validating object structure for VisiumV1 ‘HCAHeartST11702009’
Validating object structure for VisiumV1 ‘HCAHeartST11702010’
Object representation is consistent with the most current Seurat version
> Seurat::SpatialDimPlot(visx,group.by = "cell_type",ncol = 1, images = "HCAHeartST11702008")
Error in SpatialPlot(object = object, group.by = group.by, images = images, :
Please run UpdateSeuratObject on your Seurat object first to ensure that data aligns to the image HCAHeartST11702008 when plotting.
> sessionInfo()
R version 4.5.0 (2025-04-11)
Platform: x86_64-apple-darwin20
Running under: macOS Sonoma 14.5
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: Asia/Shanghai
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Seurat_5.4.0 SeuratObject_5.3.0 sp_2.2-0 schard_0.0.1
loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-3 rstudioapi_0.17.1 jsonlite_2.0.0 magrittr_2.0.4
[5] spatstat.utils_3.2-0 farver_2.1.2 fs_1.6.6 vctrs_0.6.5
[9] ROCR_1.0-11 memoise_2.0.1 spatstat.explore_3.6-0 htmltools_0.5.9
[13] usethis_3.2.1 curl_7.0.0 Rhdf5lib_1.32.0 rhdf5_2.54.0
[17] sctransform_0.4.2 parallelly_1.46.0 KernSmooth_2.23-26 htmlwidgets_1.6.4
[21] desc_1.4.3 ica_1.0-3 plyr_1.8.9 plotly_4.11.0
[25] zoo_1.8-15 cachem_1.1.0 igraph_2.2.1 mime_0.13
[29] lifecycle_1.0.4 pkgconfig_2.0.3 Matrix_1.7-3 R6_2.6.1
[33] fastmap_1.2.0 fitdistrplus_1.2-4 future_1.68.0 shiny_1.12.1
[37] digest_0.6.39 ps_1.9.1 patchwork_1.3.2 tensor_1.5.1
[41] RSpectra_0.16-2 irlba_2.3.5.1 pkgload_1.4.1 labeling_0.4.3
[45] progressr_0.18.0 spatstat.sparse_3.1-0 httr_1.4.7 polyclip_1.10-7
[49] abind_1.4-8 compiler_4.5.0 remotes_2.5.0 withr_3.0.2
[53] S7_0.2.1 fastDummies_1.7.5 pkgbuild_1.4.8 MASS_7.3-65
[57] sessioninfo_1.2.3 tools_4.5.0 lmtest_0.9-40 otel_0.2.0
[61] httpuv_1.6.16 future.apply_1.20.1 goftest_1.2-3 glue_1.8.0
[65] callr_3.7.6 nlme_3.1-168 rhdf5filters_1.22.0 promises_1.5.0
[69] grid_4.5.0 Rtsne_0.17 cluster_2.1.8.1 reshape2_1.4.5
[73] generics_0.1.4 gtable_0.3.6 spatstat.data_3.1-9 tidyr_1.3.1
[77] data.table_1.17.8 spatstat.geom_3.6-1 RcppAnnoy_0.0.22 ggrepel_0.9.6
[81] RANN_2.6.2 pillar_1.11.1 stringr_1.6.0 spam_2.11-1
[85] RcppHNSW_0.6.0 later_1.4.4 splines_4.5.0 dplyr_1.1.4
[89] lattice_0.22-6 survival_3.8-3 deldir_2.0-4 tidyselect_1.2.1
[93] miniUI_0.1.2 pbapply_1.7-4 gridExtra_2.3 scattermore_1.2
[97] devtools_2.4.6 matrixStats_1.5.0 stringi_1.8.7 lazyeval_0.2.2
[101] codetools_0.2-20 tibble_3.3.0 cli_3.6.5 uwot_0.2.4
[105] xtable_1.8-4 reticulate_1.44.1 processx_3.8.6 dichromat_2.0-0.1
[109] Rcpp_1.1.0 globals_0.18.0 spatstat.random_3.4-3 png_0.1-8
[113] spatstat.univar_3.1-5 parallel_4.5.0 ellipsis_0.3.2 ggplot2_4.0.1
[117] dotCall64_1.2 listenv_0.10.0 viridisLite_0.4.2 scales_1.4.0
[121] ggridges_0.5.7 purrr_1.2.0 rlang_1.1.6 cowplot_1.2.0