welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
380 stars 78 forks source link

mergeH5 function - error #000: ../../src/hdf5-1.12.1/src/H5L.c in H5Lexists(): line 943: unable to get link info #272

Closed lucygarner closed 1 year ago

lucygarner commented 1 year ago

Hi,

I am trying to use the mergeH5 function to merge multiple sample_molecule_info.h5 files from Cell Ranger multi, but I am getting an error. It looks like it is related to file paths or file permissions, but I can't find an obvious issue with these.

file_list <- as.list(list.files(paste0("data/sample_molecule_info_h5/", exp_name), 
                                full.names = TRUE))    # this is a list of file paths
library_names <- gsub(".h5", "", 
                      list.files(paste0("data/sample_molecule_info_h5/", exp_name)))    # this is a character vector of file names

mergeH5(file_list, library_names, 
        new.filename = paste0("data/sample_molecule_info_h5/merged/", 
                              exp_name, "/", exp_name))

Error:

Error in x$exists(name) : HDF5-API Errors:
    error #000: ../../src/hdf5-1.12.1/src/H5L.c in H5Lexists(): line 943: unable to get link info
        class: HDF5
        major: Links
        minor: Can't get value

    error #001: ../../src/hdf5-1.12.1/src/H5VLcallback.c in H5VL_link_specific(): line 5173: unable to execute link specific callback
        class: HDF5
        major: Virtual Object Layer
        minor: Can't operate on object

    error #002: ../../src/hdf5-1.12.1/src/H5VLcallback.c in H5VL__link_specific(): line 5136: unable to execute link specific callback
        class: HDF5
        major: Virtual Object Layer
        minor: Can't operate on object

    error #003: ../../src/hdf5-1.12.1/src/H5VLnative_link.c in H5VL__native_link_specific(): line 329: unable to specific link info
        class: HDF5
        major: Links
        minor: Object not found

    error #004: ../../src/hdf5-1.12.1/src/H5L.c in H5L__exists(): line 3082: path doesn't exist
        class: HDF5
        major: Links

The function does generate a file but it is only a few bytes.

Best wishes, Lucy

sessionInfo()

R version 4.2.1 (2022-06-23) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.6

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

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

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

other attached packages: [1] optparse_1.7.3 rliger_1.0.0 patchwork_1.1.2 Matrix_1.5-1 cowplot_1.1.1

loaded via a namespace (and not attached): [1] Rcpp_1.0.9 ica_1.0-3 RColorBrewer_1.1-3 plyr_1.8.7
[5] hdf5r_1.3.7 pillar_1.8.1 compiler_4.2.1 iterators_1.0.14
[9] tools_4.2.1 mclust_5.4.10 bit_4.0.4 scattermore_0.8
[13] Rtsne_0.16 jsonlite_1.8.2 lifecycle_1.0.2 tibble_3.1.8
[17] gtable_0.3.1 lattice_0.20-45 pkgconfig_2.0.3 png_0.1-7
[21] rlang_1.0.6 foreach_1.5.2 cli_3.4.1 DBI_1.1.3
[25] rstudioapi_0.14 ggrepel_0.9.1 parallel_4.2.1 dplyr_1.0.10
[29] generics_0.1.3 vctrs_0.4.2 getopt_1.20.3 bit64_4.0.5
[33] grid_4.2.1 tidyselect_1.1.2 reticulate_1.26 glue_1.6.2
[37] R6_2.5.1 fansi_1.0.3 irlba_2.3.5.1 ggplot2_3.3.6
[41] purrr_0.3.5 magrittr_2.0.3 codetools_0.2-18 scales_1.2.1
[45] riverplot_0.10 assertthat_0.2.1 colorspace_2.0-3 renv_0.16.0
[49] utf8_1.2.2 munsell_0.5.0 doParallel_1.0.17 FNN_1.1.3.1

cgao90 commented 1 year ago

Hi Lucy,

mergeH5 was designed for merging those HDF5 files containing sparse data matrices, for example, the Feature-Barcode Matrix from 10x (https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/advanced/h5_matrices?src=website&lss=organic/direct/direct&cnm=wbr-2020-08-21-event-ra_g-p_scmage-apac-2020-08-21-event-ra_g-p_scmage-apac&cid=7011P000000oWJZ). So I'm afraid it is not able to merge those sample_molecule_info.h5 files that have different content and HDF5 file hierarchy.

Best, Chao

lucygarner commented 1 year ago

Ok thank you, I have got this working with the sample_filtered_feature_bc_matrix.h5 files now.