mojaveazure / seurat-disk

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

HDF5-API Errors: error #000: H5Ocopy.c in H5Ocopy(): line 240: unable to copy object #149

Open catsargent opened 1 year ago

catsargent commented 1 year ago

Hi, I am unable to convert my h5ad object to h5seurat. I'd be grateful for any pointers about how to get this working. Here is the code I used:

library(Seurat)
library(SeuratDisk)

Convert("/Users/sargent/projects/Bioinf_CRO/ADA/data/byrd-h5ad_for_cellphonedb/38682c3f/38682c3f_healthy_normalized.h5ad", dest = "h5seurat", overwrite = FALSE)

Here is the output:

Warning: Unknown file type: h5ad
Warning: 'assay' not set, setting to 'RNA'
Creating h5Seurat file for version 3.1.5.9900
Adding X as data
Adding X as data
Adding X as counts
Adding X as counts
Adding meta.features from var
Adding meta.features from var
Error in dfile$obj_copy_from(src_loc = source, src_name = "obs", dst_name = "meta.data") : 
  HDF5-API Errors:
    error #000: H5Ocopy.c in H5Ocopy(): line 240: unable to copy object
        class: HDF5
        major: Object header
        minor: Unable to copy object

    error #001: H5VLcallback.c in H5VL_object_copy(): line 5495: object copy failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to copy object

    error #002: H5VLcallback.c in H5VL__object_copy(): line 5456: object copy failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to copy object

    error #003: H5VLnative_object.c in H5VL__native_object_copy(): line 125: unable to copy object
        class: HDF5
        major: Object header
        minor: Unable to copy object

    error #004: H5Ocopy.c in H5O__copy(): line 301: unable to copy object
        class: HDF5
        major: Object header
        minor: Unable to copy object

    error #005: H5Ocopy.c in H5O__copy_obj(): line 1196: unable to copy object
        class: HDF5
        maj
Error in dfile$obj_copy_from(src_loc = source, src_name = "obs", dst_name = "meta.data") : 
  HDF5-API Errors:
    error #000: H5Ocopy.c in H5Ocopy(): line 240: unable to copy object
        class: HDF5
        major: Object header
        minor: Unable to copy object

    error #001: H5VLcallback.c in H5VL_object_copy(): line 5495: object copy failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to copy object

    error #002: H5VLcallback.c in H5VL__object_copy(): line 5456: object copy failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to copy object

    error #003: H5VLnative_object.c in H5VL__native_object_copy(): line 125: unable to copy object
        class: HDF5
        major: Object header
        minor: Unable to copy object

    error #004: H5Ocopy.c in H5O__copy(): line 301: unable to copy object
        class: HDF5
        major: Object header
        minor: Unable to copy object

    error #005: H5Ocopy.c in H5O__copy_obj(): line 1196: unable to copy object
        class: HDF5
        maj
Error in private$closeFun(id) : HDF5-API Errors:
    error #000: H5F.c in H5Fclose(): line 711: decrementing file ID failed
        class: HDF5
        major: File accessibility
        minor: Unable to close file

    error #001: H5Iint.c in H5I_dec_app_ref(): line 1018: can't decrement ID ref count
        class: HDF5
        major: Object atom
        minor: Unable to decrement reference count

    error #002: H5Fint.c in H5F__close_cb(): line 251: unable to close file
        class: HDF5
        major: File accessibility
        minor: Unable to close file

    error #003: H5VLcallback.c in H5VL_file_close(): line 3983: file close failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to close file

    error #004: H5VLcallback.c in H5VL__file_close(): line 3952: file close failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to close file

    error #005: H5VLnative_file.c in H5VL__native_file_close(): line 838: can't close file
        clas
Error in private$closeFun(id) : HDF5-API Errors:
    error #000: H5F.c in H5Fclose(): line 711: decrementing file ID failed
        class: HDF5
        major: File accessibility
        minor: Unable to close file

    error #001: H5Iint.c in H5I_dec_app_ref(): line 1018: can't decrement ID ref count
        class: HDF5
        major: Object atom
        minor: Unable to decrement reference count

    error #002: H5Fint.c in H5F__close_cb(): line 251: unable to close file
        class: HDF5
        major: File accessibility
        minor: Unable to close file

    error #003: H5VLcallback.c in H5VL_file_close(): line 3983: file close failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to close file

    error #004: H5VLcallback.c in H5VL__file_close(): line 3952: file close failed
        class: HDF5
        major: Virtual Object Layer
        minor: Unable to close file

    error #005: H5VLnative_file.c in H5VL__native_file_close(): line 838: can't close file
        clas

A h5seurat file is created but when I try to read it in using the following command:

healthy_seu <- LoadH5Seurat("/Users/sargent/projects/Bioinf_CRO/ADA/data/byrd-h5ad_for_cellphonedb/38682c3f/38682c3f_healthy_normalized.h5seurat")

I get the following error:

Validating h5Seurat file
Error: Cannot find dataset with cell names
Error: Cannot find dataset with cell names

Here is my sessionInfo()

R version 4.0.5 (2021-03-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
LAPACK: /Users/sargent/miniconda3/envs/seurat/lib/libopenblasp-r0.3.21.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] SeuratDisk_0.0.0.9019 sp_1.5-0              SeuratObject_4.1.1    Seurat_4.1.1         

loaded via a namespace (and not attached):
  [1] Rtsne_0.16            colorspace_2.0-3      deldir_1.0-6          ellipsis_0.3.2        ggridges_0.5.4       
  [6] rstudioapi_0.14       spatstat.data_2.2-0   leiden_0.4.3          listenv_0.8.0         ggrepel_0.9.1        
 [11] bit64_4.0.5           fansi_1.0.3           codetools_0.2-18      splines_4.0.5         polyclip_1.10-0      
 [16] jsonlite_1.8.0        ica_1.0-3             cluster_2.1.3         png_0.1-7             rgeos_0.5-9          
 [21] uwot_0.1.14           shiny_1.7.2           sctransform_0.3.4     spatstat.sparse_2.1-1 compiler_4.0.5       
 [26] httr_1.4.4            assertthat_0.2.1      Matrix_1.4-1          fastmap_1.1.0         lazyeval_0.2.2       
 [31] cli_3.4.1             later_1.2.0           htmltools_0.5.3       tools_4.0.5           igraph_1.3.4         
 [36] gtable_0.3.1          glue_1.6.2            RANN_2.6.1            reshape2_1.4.4        dplyr_1.0.10         
 [41] Rcpp_1.0.9            scattermore_0.8       vctrs_0.4.1           nlme_3.1-159          progressr_0.11.0     
 [46] lmtest_0.9-40         spatstat.random_2.2-0 stringr_1.4.1         globals_0.16.1        mime_0.12            
 [51] miniUI_0.1.1.1        lifecycle_1.0.2       irlba_2.3.5           goftest_1.2-3         future_1.28.0        
 [56] MASS_7.3-58.1         zoo_1.8-11            scales_1.2.1          spatstat.core_2.4-4   promises_1.2.0.1     
 [61] spatstat.utils_2.3-1  parallel_4.0.5        RColorBrewer_1.1-3    yaml_2.3.5            reticulate_1.28      
 [66] pbapply_1.5-0         gridExtra_2.3         ggplot2_3.3.6         rpart_4.1.16          stringi_1.7.8        
 [71] rlang_1.0.6           pkgconfig_2.0.3       matrixStats_0.62.0    lattice_0.20-45       ROCR_1.0-11          
 [76] purrr_0.3.4           tensor_1.5            patchwork_1.1.2       htmlwidgets_1.5.4     cowplot_1.1.1        
 [81] bit_4.0.4             tidyselect_1.1.2      parallelly_1.32.1     RcppAnnoy_0.0.19      plyr_1.8.7           
 [86] magrittr_2.0.3        R6_2.5.1              generics_0.1.3        DBI_1.1.3             pillar_1.8.1         
 [91] withr_2.5.0           mgcv_1.8-40           fitdistrplus_1.1-8    survival_3.4-0        abind_1.4-5          
 [96] tibble_3.1.8          future.apply_1.9.1    crayon_1.5.1          hdf5r_1.3.6           KernSmooth_2.23-20   
[101] utf8_1.2.2            spatstat.geom_2.4-0   plotly_4.10.0         grid_4.0.5            data.table_1.14.2    
[106] digest_0.6.29         xtable_1.8-4          tidyr_1.2.1           httpuv_1.6.6          munsell_0.5.0        
[111] viridisLite_0.4.1    
R version 4.0.5 (2021-03-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
LAPACK: /Users/sargent/miniconda3/envs/seurat/lib/libopenblasp-r0.3.21.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] SeuratDisk_0.0.0.9019 sp_1.5-0              SeuratObject_4.1.1    Seurat_4.1.1         

loaded via a namespace (and not attached):
  [1] Rtsne_0.16            colorspace_2.0-3      deldir_1.0-6          ellipsis_0.3.2        ggridges_0.5.4       
  [6] rstudioapi_0.14       spatstat.data_2.2-0   leiden_0.4.3          listenv_0.8.0         ggrepel_0.9.1        
 [11] bit64_4.0.5           fansi_1.0.3           codetools_0.2-18      splines_4.0.5         polyclip_1.10-0      
 [16] jsonlite_1.8.0        ica_1.0-3             cluster_2.1.3         png_0.1-7             rgeos_0.5-9          
 [21] uwot_0.1.14           shiny_1.7.2           sctransform_0.3.4     spatstat.sparse_2.1-1 compiler_4.0.5       
 [26] httr_1.4.4            assertthat_0.2.1      Matrix_1.4-1          fastmap_1.1.0         lazyeval_0.2.2       
 [31] cli_3.4.1             later_1.2.0           htmltools_0.5.3       tools_4.0.5           igraph_1.3.4         
 [36] gtable_0.3.1          glue_1.6.2            RANN_2.6.1            reshape2_1.4.4        dplyr_1.0.10         
 [41] Rcpp_1.0.9            scattermore_0.8       vctrs_0.4.1           nlme_3.1-159          progressr_0.11.0     
 [46] lmtest_0.9-40         spatstat.random_2.2-0 stringr_1.4.1         globals_0.16.1        mime_0.12            
 [51] miniUI_0.1.1.1        lifecycle_1.0.2       irlba_2.3.5           goftest_1.2-3         future_1.28.0        
 [56] MASS_7.3-58.1         zoo_1.8-11            scales_1.2.1          spatstat.core_2.4-4   promises_1.2.0.1     
 [61] spatstat.utils_2.3-1  parallel_4.0.5        RColorBrewer_1.1-3    yaml_2.3.5            reticulate_1.28      
 [66] pbapply_1.5-0         gridExtra_2.3         ggplot2_3.3.6         rpart_4.1.16          stringi_1.7.8        
 [71] rlang_1.0.6           pkgconfig_2.0.3       matrixStats_0.62.0    lattice_0.20-45       ROCR_1.0-11          
 [76] purrr_0.3.4           tensor_1.5            patchwork_1.1.2       htmlwidgets_1.5.4     cowplot_1.1.1        
 [81] bit_4.0.4             tidyselect_1.1.2      parallelly_1.32.1     RcppAnnoy_0.0.19      plyr_1.8.7           
 [86] magrittr_2.0.3        R6_2.5.1              generics_0.1.3        DBI_1.1.3             pillar_1.8.1         
 [91] withr_2.5.0           mgcv_1.8-40           fitdistrplus_1.1-8    survival_3.4-0        abind_1.4-5          
 [96] tibble_3.1.8          future.apply_1.9.1    crayon_1.5.1          hdf5r_1.3.6           KernSmooth_2.23-20   
[101] utf8_1.2.2            spatstat.geom_2.4-0   plotly_4.10.0         grid_4.0.5            data.table_1.14.2    
[106] digest_0.6.29         xtable_1.8-4          tidyr_1.2.1           httpuv_1.6.6          munsell_0.5.0        
[111] viridisLite_0.4.1    
Harrison-Q-Ma commented 11 months ago

I am running into the same issue. Were you able to resolve this?