STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
179 stars 59 forks source link

Stereopy/docs/source/Tutorials /Format_Conversion.ipynb fails #255

Closed eisascience closed 2 months ago

eisascience commented 3 months ago

I have a saved h5ad that I want to convert to use in Seurat. However, its not easy nor does it actually work.

The code fails at this line, opening what it created above it: object <- LoadH5Seurat(h5_file, misc=F)

I can see the h5seurat file it made... but cant open it obviously.

This entire conversion should be part of the stereopy implementation! the output should by default include a working Seurat object that also include the spatial object and image. When will this be implemented? Need it ASAP!

eisascience commented 3 months ago

Specifically:

object <- LoadH5Seurat(h5file, misc=F) Validating h5Seurat file Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Initializing Spatial with data Error in CreateAssayObject(): ! Feature names of data matrix cannot be empty Run rlang::last_trace() to see where the error occurred.

\\\\ Session Info \\\ R version 4.3.1 (2023-06-16) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Ventura 13.6.2

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.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

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: America/Los_Angeles tzcode source: internal

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

other attached packages: [1] stringr_1.5.1 hdf5r_1.3.10 SeuratDisk_0.0.0.9021 [4] ggplot2_3.5.0 Seurat_5.0.2 SeuratObject_5.0.1
[7] sp_2.1-3 rjson_0.2.21 dplyr_1.1.4

loaded via a namespace (and not attached): [1] DDRTree_0.1.5 matrixStats_1.2.0
[3] spatstat.sparse_3.0-3 bitops_1.0-7
[5] doParallel_1.0.17 httr_1.4.7
[7] RColorBrewer_1.1-3 prabclus_2.3-3
[9] docopt_0.7.1 mlr3learners_0.5.8
[11] sctransform_0.4.1 backports_1.4.1
[13] vegan_2.6-4 utf8_1.2.4
[15] R6_2.5.1 HDF5Array_1.30.1
[17] mgcv_1.9-1 lazyeval_0.2.2
[19] uwot_0.1.16 permute_0.9-7
[21] GetoptLong_1.0.5 mlr3data_0.7.0
[23] rhdf5filters_1.14.1 withr_3.0.0
[25] mlr3viz_0.8.0 gridExtra_2.3
[27] progressr_0.14.0 cli_3.6.2
[29] Biobase_2.62.0 mlr3hyperband_0.5.0
[31] spatstat.explore_3.2-6 fastDummies_1.7.3
[33] slam_0.1-50 diptest_0.77-0
[35] robustbase_0.99-2 spatstat.data_3.0-4
[37] mlr3tuningspaces_0.5.0 ggridges_0.5.6
[39] pbapply_1.7-2 mlr3tuning_0.20.0
[41] R.utils_2.12.3 paradox_0.11.1
[43] parallelly_1.37.1 limma_3.58.1
[45] VGAM_1.1-10 rstudioapi_0.15.0
[47] FNN_1.1.4 shape_1.4.6.1
[49] generics_0.1.3 combinat_0.0-8
[51] ica_1.0-3 spatstat.random_3.2-3
[53] Matrix_1.6-5 fansi_1.0.6
[55] S4Vectors_0.40.2 abind_1.4-5
[57] R.methodsS3_1.8.2 lifecycle_1.0.4
[59] edgeR_4.0.14 SummarizedExperiment_1.32.0 [61] rhdf5_2.46.1 SparseArray_1.2.4
[63] Rtsne_0.17 grid_4.3.1
[65] promises_1.2.1 dqrng_0.3.2
[67] crayon_1.5.2 miniUI_0.1.1.1
[69] lattice_0.22-5 beachmat_2.18.1
[71] cowplot_1.1.3 ComplexHeatmap_2.16.0
[73] pillar_1.9.0 GenomicRanges_1.54.1
[75] fpc_2.2-11 future.apply_1.11.1
[77] codetools_0.2-19 leiden_0.4.3.1
[79] glue_1.7.0 spacefillr_0.3.2
[81] leidenbase_0.1.27 data.table_1.15.2
[83] vctrs_0.6.5 png_0.1-8
[85] spam_2.10-0 gtable_0.3.4
[87] assertthat_0.2.1 kernlab_0.9-32
[89] binman_0.1.3 princurve_2.1.6
[91] S4Arrays_1.2.1 mime_0.12
[93] DropletUtils_1.20.0 monocle_2.28.0
[95] qlcMatrix_0.9.7 HSMMSingleCell_1.20.0
[97] survival_3.5-8 pheatmap_1.0.12
[99] SingleCellExperiment_1.24.0 RSelenium_1.7.9
[101] iterators_1.0.14 fastICA_1.2-4
[103] statmod_1.5.0 ellipsis_0.3.2
[105] fitdistrplus_1.1-11 ROCR_1.0-11
[107] nlme_3.1-164 bit64_4.0.5
[109] bbotk_0.8.0 RcppAnnoy_0.0.22
[111] GenomeInfoDb_1.38.6 mlr3pipelines_0.5.0-2
[113] mlr3_0.18.0 irlba_2.3.5.1
[115] KernSmooth_2.23-22 mlr3mbo_0.2.2
[117] colorspace_2.1-0 BiocGenerics_0.48.1
[119] nnet_7.3-19 mlr3misc_0.14.0
[121] DESeq2_1.40.2 tidyselect_1.2.0
[123] bit_4.0.5 compiler_4.3.1
[125] rvest_1.0.4 lgr_0.4.4
[127] xml2_1.3.6 DelayedArray_0.28.0
[129] plotly_4.10.4 caTools_1.18.2
[131] checkmate_2.3.1 scales_1.3.0
[133] DEoptimR_1.1-3 lmtest_0.9-40
[135] palmerpenguins_0.1.1 digest_0.6.34
[137] goftest_1.2-3 spatstat.utils_3.0-4
[139] wdman_0.2.6 sparsesvd_0.2-2
[141] XVector_0.42.0 RhpcBLASctl_0.23-42
[143] htmltools_0.5.7 pkgconfig_2.0.3
[145] SingleR_2.2.0 sparseMatrixStats_1.14.0
[147] MatrixGenerics_1.14.0 fastmap_1.1.1
[149] GlobalOptions_0.1.2 rlang_1.1.3
[151] htmlwidgets_1.6.4 shiny_1.8.0
[153] DelayedMatrixStats_1.24.0 zoo_1.8-12
[155] jsonlite_1.8.8 BiocParallel_1.36.0
[157] mclust_6.1 R.oo_1.26.0
[159] BiocSingular_1.18.0 RCurl_1.98-1.14
[161] magrittr_2.0.3 scuttle_1.10.3
[163] modeltools_0.2-23 GenomeInfoDbData_1.2.11
[165] wordcloud_2.6 dotCall64_1.1-1
[167] patchwork_1.2.0 Rhdf5lib_1.24.2
[169] munsell_0.5.0 mlr3fselect_0.11.0
[171] Rcpp_1.0.12 viridis_0.6.5
[173] reticulate_1.35.0 stringi_1.8.3
[175] zlibbioc_1.48.0 MASS_7.3-60.0.1
[177] plyr_1.8.9 flexmix_2.3-19
[179] MAST_1.26.0 parallel_4.3.1
[181] listenv_0.9.1 ggrepel_0.9.5
[183] semver_0.2.0 deldir_2.0-4
[185] mlr3verse_0.2.8 splines_4.3.1
[187] tensor_1.5 circlize_0.4.16
[189] locfit_1.5-9.9 mlr3cluster_0.1.8
[191] mlr3filters_0.7.1 igraph_2.0.2
[193] uuid_1.2-0 spatstat.geom_3.2-9
[195] scCustFx_0.1.0 RcppHNSW_0.6.0
[197] reshape2_1.4.4 stats4_4.3.1
[199] ScaledMatrix_1.10.0 CellMembrane_1.0.0
[201] foreach_1.5.2 httpuv_1.6.14
[203] RANN_2.6.1 tidyr_1.3.1
[205] purrr_1.0.2 polyclip_1.10-6
[207] future_1.33.1 clue_0.3-65
[209] scattermore_1.2 rsvd_1.0.5
[211] xtable_1.8-4 RSpectra_0.16-1
[213] later_1.3.2 viridisLite_0.4.2
[215] class_7.3-22 tibble_3.2.1
[217] IRanges_2.36.0 cluster_2.1.6
[219] globals_0.16.3

tanliwei-coder commented 3 months ago

Did you use h5ad2rds.R to convert and what method did you use to save the h5ad?