grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
61 stars 22 forks source link

H5Fopen File accessibility. Unable to open file #117

Open ukleiner opened 1 year ago

ukleiner commented 1 year ago

Hi, When I try to open an h5ad file with H5Fopen(filename) i get "File accessibility. Unable to open file".

I'm using:

R version 4.1.0 (2021-05-18)                                                                                                                          
Platform: x86_64-pc-linux-gnu (64-bit)                                                                                                                
Running under: CentOS Linux 7 (Core)
rhdf5_2.36.0

The file exists (running file.exists on the file name returns TRUE). Reading from the same file using h5read works. I setwd() into the file's folder and tried to use H5Fopen only with the file name but it didn't solve the issue.

After setting h5errorHandling(type = "verbose") I get:

Error in H5Fopen("rpe1_raw_singlecell_01.h5ad") : libhdf5                                                                                             
    error #000: H5F.c in H5Fopen(): line 429                                                                                                          
        class: HDF5                                                                                                                                   
        major: File accessibility                                                                                                                     
        minor: Unable to open file                                                                                                                    
    error #001: H5Fint.c in H5F_open(): line 1644                                                                                                     
        class: HDF5                                                                                                                                   
        major: File accessibility                                                                                                                     
        minor: Unable to open file                                                                                                                    
    error #002: H5FD.c in H5FD_open(): line 741                                                                                                       
        class: HDF5                                                                                                                                   
        major: Virtual File Layer                                                                                                                     
        minor: Unable to initialize object                                                                                                            
    error #003: H5FDsec2.c in H5FD__sec2_open(): line 360                                                                                             
        class: HDF5                                                                                                                                   
        major: File accessibility                                                                                                                     
        minor: Unable to open file 

How can I solve this issue? Thanks

github-actions[bot] commented 1 year ago

Thank you for opening this issue.

Please note that the repository maintainer (@grimbough) is currently on parental leave until October 2022 and any response will take longer than usual.

weiyxxx commented 1 year ago

Hi, I had a similar problem when I run my code,and then I get:

reading in kallisto results dropping unused factor levels .Error in H5Fopen(file, flags = flags, fapl = fapl, native = native) : libhdf5 error #000: C:/rtools40/tmp/CMake-hdf5-1.10.7/hdf5-1.10.7/src/H5F.c in H5Fopen(): line 429 class: HDF5 major: File accessibility minor: Unable to open file error #001: C:/rtools40/tmp/CMake-hdf5-1.10.7/hdf5-1.10.7/src/H5Fint.c in H5F_open(): line 1644 class: HDF5 major: File accessibility minor: Unable to open file error #002: C:/rtools40/tmp/CMake-hdf5-1.10.7/hdf5-1.10.7/src/H5FD.c in H5FD_open(): line 741 class: HDF5 major: Virtual File Layer minor: Unable to initialize object error #003: C:/rtools40/tmp/CMake-hdf5-1.10.7/hdf5-1.10.7/src/H5FDsec2.c in H5FD__sec2_open(): line 360 class: HDF5 major: File accessibility minor: Unable to open file I hope yuo guys can help me solve this problem. Thanks a lot!
grimbough commented 1 year ago

Often this error means the file has already been opened by another process e.g. opening it in another R session or something like HDFView. Maybe that's the case here? It's difficult to tell without knowing more about what you're doing.

As a start I'd suggest making sure any other applications are closed, starting a new R session, and then running H5Fopen() as the first thing you do. That might help diagnose if it's really a problem with that function, or a side-effect of something else.

ukleiner commented 1 year ago

That is exactly what I did and I still get the error. Also the package "hdf5r" doesn't have this issue