mojaveazure / seurat-disk

Interfaces for HDF5-based Single Cell File Formats
https://mojaveazure.github.io/seurat-disk
GNU General Public License v3.0
146 stars 48 forks source link

Problem with Convert() from h5ad to h5seurat #96

Open Pazuzzilla opened 2 years ago

Pazuzzilla commented 2 years ago

Hi, I'm trying to convert the resulting corrected_adata coming from this tutorial https://scgen.readthedocs.io/en/latest/tutorials/scgen_batch_removal.html saved as scgenres.h5ad to the .h5seurat format, in order to upload it in rstudio with Seurat. I runned the command:

Convert("./tests/results/scgenres.h5ad", dest = "h5seurat", overwrite = TRUE)

and i get the following error

`Warning: Unknown file type: h5ad Warning: 'assay' not set, setting to 'RNA' Creating h5Seurat file for version 3.1.5.9900 Adding X as scale.data Adding raw/X as data Adding raw/X as counts Adding meta.features from raw/var Error in assay.group[["meta.features"]]$link_delete(name = GetRownames(dset = "var")) : HDF5-API Errors: error #000: ../../../src/H5L.c in H5Ldelete(): line 621: unable to delete link class: HDF5 major: Links minor: Can't delete message

error #001: ../../../src/H5L.c in H5L__delete(): line 2470: unable to delete link: _index
    class: HDF5
    major: Links
    minor: Can't delete message

error #002: ../../../src/H5L.c in H5L_delete(): line 2430: can't unlink object
    class: HDF5
    major: Links
    minor: Unable to remove object

error #003: ../../../src/H5Gtraverse.c in H5G_traverse(): line 851: internal path traversal failed
    class: HDF5
    major: Symbol table
    minor: Object not found

error #004: ../../../src/H5Gtraverse.c in H5G__traverse_real(): line 627: traversal operator failed
    class: HDF5
    major: Symbol table
    minor: Callback failed

error #005: ../../../src/H5L.c in H5L__delete_cb(): line 2385: callback link pointer is NULL (specified `

I've tried to convert the adata object train (from the tutorial) train = sc.read( "./tests/data/pancreas.h5ad", backup_url="https://www.dropbox.com/s/qj1jlm9w10wmt0u/pancreas.h5ad?dl=1" )

and it gives me no error so i don't understand if it's a problem with the scGen package which modify the adata object in a way not manageable by SeuratDisk in the passage

corrected_adata = model.batch_removal()

or if it's a problem with the SeuratDisk package. Since i saw lot of people have similar but not identical problem with HDF5-API in Convert function i've thought the second hypothesis could be the right one; i've tried to trace the error but i didn't found a solution, if someone can help facing the problem, or if more information are needed please let me know.

my session info `> sessionInfo() R version 4.0.5 (2021-03-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Linux Mint 20.1

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

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

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets [8] methods base

other attached packages: [1] WriteXLS_6.3.0 data.table_1.13.4
[3] plyr_1.8.6 SingleR_1.4.1
[5] FNN_1.1.3 class_7.3-19
[7] dplyr_1.0.7 harmony_0.1.0
[9] Rcpp_1.0.7 ggplot2_3.3.5
[11] readxl_1.3.1 R.utils_2.10.1
[13] R.oo_1.24.0 R.methodsS3_1.8.1
[15] DropletUtils_1.10.3 SingleCellExperiment_1.12.0 [17] SummarizedExperiment_1.20.0 Biobase_2.50.0
[19] GenomicRanges_1.42.0 GenomeInfoDb_1.26.7
[21] IRanges_2.24.1 S4Vectors_0.28.1
[23] BiocGenerics_0.36.1 MatrixGenerics_1.2.1
[25] matrixStats_0.58.0 SeuratDisk_0.0.0.9019
[27] Seurat_4.0.5 reticulate_1.18
[29] SeuratObject_4.0.2

loaded via a namespace (and not attached): [1] igraph_1.2.6 lazyeval_0.2.2
[3] splines_4.0.5 BiocParallel_1.24.1
[5] listenv_0.8.0 scattermore_0.7
[7] digest_0.6.27 htmltools_0.5.0
[9] fansi_0.4.1 magrittr_2.0.1
[11] tensor_1.5 cluster_2.1.2
[13] ROCR_1.0-11 remotes_2.3.0
[15] limma_3.46.0 globals_0.14.0
[17] spatstat.sparse_2.0-0 colorspace_2.0-0
[19] ggrepel_0.8.2 crayon_1.4.2
[21] RCurl_1.98-1.3 jsonlite_1.7.2
[23] spatstat.data_2.1-0 survival_3.2-11
[25] zoo_1.8-8 glue_1.4.2
[27] polyclip_1.10-0 gtable_0.3.0
[29] zlibbioc_1.36.0 XVector_0.30.0
[31] leiden_0.3.6 DelayedArray_0.16.3
[33] BiocSingular_1.6.0 Rhdf5lib_1.12.1
[35] future.apply_1.6.0 HDF5Array_1.18.1
[37] abind_1.4-5 scales_1.1.1
[39] DBI_1.1.1 edgeR_3.32.1
[41] miniUI_0.1.1.1 viridisLite_0.3.0
[43] xtable_1.8-4 spatstat.core_2.3-1
[45] dqrng_0.2.1 rsvd_1.0.3
[47] bit_4.0.4 htmlwidgets_1.5.3
[49] httr_1.4.2 anndata_0.7.5.3
[51] RColorBrewer_1.1-2 ellipsis_0.3.2
[53] ica_1.0-2 farver_2.0.3
[55] pkgconfig_2.0.3 scuttle_1.0.4
[57] uwot_0.1.9 deldir_1.0-6
[59] locfit_1.5-9.4 utf8_1.1.4
[61] labeling_0.4.2 tidyselect_1.1.0
[63] rlang_0.4.12 reshape2_1.4.4
[65] later_1.1.0.1 cellranger_1.1.0
[67] munsell_0.5.0 tools_4.0.5
[69] cli_3.1.0 generics_0.1.0
[71] ggridges_0.5.2 stringr_1.4.0
[73] fastmap_1.0.1 goftest_1.2-2
[75] bit64_4.0.5 fitdistrplus_1.1-3
[77] purrr_0.3.4 RANN_2.6.1
[79] sparseMatrixStats_1.2.1 pbapply_1.4-3
[81] future_1.21.0 nlme_3.1-152
[83] mime_0.9 hdf5r_1.3.4
[85] compiler_4.0.5 curl_4.3
[87] plotly_4.9.2.1 png_0.1-7
[89] spatstat.utils_2.2-0 tibble_3.1.5
[91] stringi_1.5.3 lattice_0.20-44
[93] Matrix_1.3-4 vctrs_0.3.8
[95] pillar_1.6.4 lifecycle_1.0.0
[97] rhdf5filters_1.2.0 spatstat.geom_2.3-0
[99] lmtest_0.9-38 BiocNeighbors_1.8.2
[101] RcppAnnoy_0.0.19 cowplot_1.1.0
[103] bitops_1.0-6 irlba_2.3.3
[105] httpuv_1.5.5 patchwork_1.1.0
[107] R6_2.5.0 promises_1.1.1
[109] KernSmooth_2.23-20 gridExtra_2.3
[111] parallelly_1.21.0 codetools_0.2-18
[113] MASS_7.3-54 assertthat_0.2.1
[115] rhdf5_2.34.0 withr_2.4.2
[117] sctransform_0.3.2 GenomeInfoDbData_1.2.4
[119] mgcv_1.8-36 grid_4.0.5
[121] rpart_4.1-15 beachmat_2.6.4
[123] tidyr_1.1.4 DelayedMatrixStats_1.12.3 [125] Rtsne_0.15 shiny_1.5.0 `

MoritzTh commented 2 years ago

Hi @Pazuzzilla , were you able to resolve this issue? I am having the same problem

hvgogogo commented 9 months ago

same question, any updates? thx