Search
Question: Suppressing rhdf5 error messages
0
gravatar for Mike Smith
2.4 years ago by
Mike Smith2.1k
EMBL Heidelberg / de.NBI
Mike Smith2.1k wrote:

I'm using rhdf5 to read a large number of hdf5 files.  Occasionally I encounter a file that may be corrupt or otherwise damaged, and rhdf5 (or anything else) is unable to open it.  This results in a large spew of error messages to the screen.

HDF5-DIAG: Error detected in HDF5 (1.8.7) thread 0:
  #000: H5F.c line 1522 in H5Fopen(): unable to open file
    major: File accessability
    minor: Unable to open file
  #001: H5F.c line 1313 in H5F_open(): unable to read superblock
    major: File accessability
    minor: Read failed
  #002: H5Fsuper.c line 351 in H5F_super_read(): unable to load superblock
    major: Object cache
    minor: Unable to protect metadata
  #003: H5AC.c line 1322 in H5AC_protect(): H5C_protect() failed.
    major: Object cache
    minor: Unable to protect metadata
  #004: H5C.c line 3567 in H5C_protect(): can't load entry
    major: Object cache
    minor: Unable to load metadata into cache
  #005: H5C.c line 7957 in H5C_load_entry(): unable to load entry
    major: Object cache
    minor: Unable to load metadata into cache
  #006: H5Fsuper_cache.c line 471 in H5F_sblock_load(): truncated file
    major: File accessability
    minor: File has been truncated
HDF5: unable to open file

I've written a function to catch these files before I try to do anything else with them by looking at the result of H5Fopen(), but the error messages are still printed to screen.  Is there some way to suppress them?  

If it's of any help you can get examples of good and bad hdf5 files from here:

https://dl.dropboxusercontent.com/u/16340004/good.h5

https://dl.dropboxusercontent.com/u/16340004/bad.h5

Thanks,

Mike

 

ADD COMMENTlink modified 2.4 years ago by Bernd Fischer540 • written 2.4 years ago by Mike Smith2.1k
2
gravatar for Bernd Fischer
2.4 years ago by
Bernd Fischer540
Germany / Heidelberg / DKFZ
Bernd Fischer540 wrote:

Dear Mike,

 

 

I improved the error handling. HDF5 error messages are now forwarded to R and displayed with the R error messaging system. Furthermore, I added a function h5errorHandling(type="normal") that changes the verbosity of HDF5 error messages. With h5errorHandling(type="suppress") you will completely avoid error messages from HDF5 with h5errorHandling(type="verbose") you will get the complete error stack. Alternatively, you can use the R-style way of suppressing error messages:

options(show.error.messages = FALSE)

The mentioned changes will be available as rhdf5 version 2.13.2 in the devel version of bioconductor from tomorrow evening on.

Bernd

 

ADD COMMENTlink written 2.4 years ago by Bernd Fischer540

Thanks very much Bernd.  I was hoping to be able to use suppressErrors() or the like, so this sounds exactly what I was hoping for.

ADD REPLYlink written 2.4 years ago by Mike Smith2.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 144 users visited in the last hour