drieslab / Giotto

Spatial omics analysis toolbox
https://drieslab.github.io/Giotto_website/
Other
255 stars 98 forks source link

Error when using giottoToSeuratV5 (CosMX data) #989

Closed guillermoturiel closed 4 weeks ago

guillermoturiel commented 1 month ago

I have been trying to convert my Giotto object to Seurat using the function giottoToSeuratV5(). However I get the following error:

fov_s <- giottoToSeuratV5(fov_join)

Error in (function (cl, name, valueClass) : ‘meta.data’ is not a slot in class “Assay”

The function works perfectly for me while using the example for this function in the documentation

g <- GiottoData::loadGiottoMini("visium")

  1. read Giotto object
  2. read Giotto feature information
  3. read Giotto spatial information 3.1 read Giotto spatial shape information cell_spatInfo_spatVector.shp cell

3.2 read Giotto spatial centroid information cell

3.3 read Giotto spatial overlap information No overlaps were found, overlap loading will be skipped

  1. read Giotto image information

no external python path was provided, but a giotto python environment was found and will be used Warning message: This giotto object was created in a newer version of GiottoClass (v0.3.2)

giottoToSeuratV5(g)

An object of class Seurat 634 features across 624 samples within 1 assay Active assay: rna (634 features, 0 variable features) 3 layers present: counts, data, scale.data 6 dimensional reductions calculated: pca, custom_pca, umap, custom_umap, tsne, spatial 2 images present: alignment, image Warning messages: 1: Keys should be one or more alphanumeric characters followed by an underscore, setting key from custompca to custompca_ 2: Keys should be one or more alphanumeric characters followed by an underscore, setting key from customumap to customumap_

However while trying the same with the example cosmx dataset I get the same error:

g <- GiottoData::loadGiottoMini("cosmx")

  1. read Giotto object
  2. read Giotto feature information /home/guruiz/R/x86_64-pc-linux-gnu-library/4.4/GiottoData/Mini_datasets/CosMx/CosMxObject/Features/neg_probe_feature_spatVector.shp neg_probe /home/guruiz/R/x86_64-pc-linux-gnu-library/4.4/GiottoData/Mini_datasets/CosMx/CosMxObject/Features/rna_feature_spatVector.shp rna
  3. read Giotto spatial information 3.1 read Giotto spatial shape information cell_spatInfo_spatVector.shp cell

3.2 read Giotto spatial centroid information cell

3.3 read Giotto spatial overlap information neg_probe_cell_spatInfo_spatVectorOverlaps.shp rna_cell_spatInfo_spatVectorOverlaps.shp poly_ID feat_ID feat_ID_uniq cell and neg_probe poly_ID feat_ID feat_ID_uniq cell and rna

  1. read Giotto image information

no external python path was provided, but a giotto python environment was found and will be used

giottoToSeuratV5(g)

Error in (function (cl, name, valueClass) : ‘meta.data’ is not a slot in class “Assay”

I guess then it is a problem of the function itself with CosMX data rather than a problem with my data.

Could you please provide any solution to this?

Thank you very much.

sessionInfo()

> sessionInfo() R version 4.4.1 (2024-06-14) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.1 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 locale: [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C time zone: Europe/Zurich tzcode source: system (glibc) attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] sp_2.1-4 ggplot2_3.5.1 GiottoUtils_0.1.8 Giotto_4.0.8 [5] GiottoClass_0.3.1 loaded via a namespace (and not attached): [1] RColorBrewer_1.1-3 jsonlite_1.8.8 magrittr_2.0.3 [4] spatstat.utils_3.0-5 magick_2.8.3 farver_2.1.2 [7] zlibbioc_1.50.0 vctrs_0.6.5 ROCR_1.0-11 [10] spatstat.explore_3.2-7 terra_1.7-78 htmltools_0.5.8.1 [13] S4Arrays_1.4.1 SparseArray_1.4.8 sctransform_0.4.1 [16] parallelly_1.37.1 KernSmooth_2.23-20 htmlwidgets_1.6.4 [19] ica_1.0-3 plyr_1.8.9 plotly_4.10.4 [22] zoo_1.8-12 igraph_2.0.3 mime_0.12 [25] lifecycle_1.0.4 pkgconfig_2.0.3 rsvd_1.0.5 [28] Matrix_1.7-0 R6_2.5.1 fastmap_1.2.0 [31] magic_1.6-1 MatrixGenerics_1.16.0 fitdistrplus_1.2-1 [34] future_1.33.2 shiny_1.8.1.1 digest_0.6.35 [37] colorspace_2.1-0 patchwork_1.2.0 S4Vectors_0.42.0 [40] Seurat_5.1.0 tensor_1.5 RSpectra_0.16-1 [43] irlba_2.3.5.1 beachmat_2.20.0 labeling_0.4.3 [46] progressr_0.14.0 spatstat.sparse_3.1-0 fansi_1.0.6 [49] polyclip_1.10-6 httr_1.4.7 abind_1.4-5 [52] compiler_4.4.1 withr_3.0.0 backports_1.5.0 [55] BiocParallel_1.38.0 fastDummies_1.7.3 MASS_7.3-55 [58] rappdirs_0.3.3 DelayedArray_0.30.1 gtools_3.9.5 [61] GiottoVisuals_0.2.3 tools_4.4.1 lmtest_0.9-40 [64] httpuv_1.6.15 future.apply_1.11.2 goftest_1.2-3 [67] glue_1.7.0 dbscan_1.1-12 nlme_3.1-155 [70] promises_1.3.0 grid_4.4.1 checkmate_2.3.1 [73] Rtsne_0.17 cluster_2.1.2 reshape2_1.4.4 [76] generics_0.1.3 spatstat.data_3.1-2 gtable_0.3.5 [79] tidyr_1.3.1 data.table_1.15.4 BiocSingular_1.20.0 [82] ScaledMatrix_1.12.0 utf8_1.2.4 XVector_0.44.0 [85] spatstat.geom_3.2-9 BiocGenerics_0.50.0 RcppAnnoy_0.0.22 [88] ggrepel_0.9.5 RANN_2.6.1 pillar_1.9.0 [91] stringr_1.5.1 spam_2.10-0 RcppHNSW_0.5.0 [94] later_1.3.2 splines_4.4.1 dplyr_1.1.4 [97] lattice_0.20-45 survival_3.2-13 deldir_2.0-4 [100] tidyselect_1.2.1 pbapply_1.7-2 miniUI_0.1.1.1 [103] gridExtra_2.3 IRanges_2.38.0 scattermore_1.2 [106] stats4_4.4.1 Biobase_2.62.0 matrixStats_1.3.0 [109] stringi_1.8.4 lazyeval_0.2.2 codetools_0.2-18 [112] GiottoData_0.2.13 tibble_3.2.1 colorRamp2_0.1.0 [115] cli_3.6.2 uwot_0.2.2 geometry_0.4.7 [118] xtable_1.8-4 reticulate_1.38.0 munsell_0.5.1 [121] Rcpp_1.0.12 spatstat.random_3.2-3 globals_0.16.3 [124] png_0.1-8 parallel_4.4.1 dotCall64_1.1-1 [127] listenv_0.9.1 viridisLite_0.4.2 scales_1.3.0 [130] ggridges_0.5.6 SeuratObject_5.0.2 leiden_0.4.3.1 [133] purrr_1.0.2 crayon_1.5.2 rlang_1.1.4 [136] cowplot_1.1.3

iqraAmin commented 1 month ago

@guillermoturiel The changes have been implemented in PR #210. It should be fixed now.

jiajic commented 4 weeks ago

This fix is now in the currently released version. Closing as completed, please reopen if I am mistaken.