Dear HiCExplorer team,
When I use cooler.fileops.list_coolers to inspect mcool files created by hicConvertFormat, I always received a warning
fileops.py:211: UserWarning: Cooler path / appears to be corrupt
if _is_cooler(grp):
I noticed that mcool files created by hicConvertFormat use "HDF5::Cooler" as its format, so cooler.fileops.list_coolers reports the root group ("/") as a (corrupted) cooler dataset.
https://github.com/open2c/cooler/blob/b009aea8c6aadd7c7848bca9bdd6ea708ef0a554/src/cooler/fileops.py#L116-L126
mcool files created by cooler.zoomify_cooler have "HDF5::MCOOL" as their format.
steps to reproduce
# create mcool with HiCExplorer::hicConvertFormat
hicConvertFormat -m hic_matrix.h5 -o hic_matrix.mcool --inputFormat h5 --outputFormat mcool --resolutions 20000 40000 70000 120000 500000
# create mcool with cooler
hicConvertFormat -m hic_matrix.h5 -o hic_matrix.cool --inputFormat h5 --outputFormat cool
cooler zoomify hic_matrix.cool -o cooler_matrix.mcool -r 20000,40000,70000,120000,500000
$ hicInfo -m hic_matrix.mcool
KeyError: "No cooler found at: hic_matrix.mcool. Coolers found in ['/', '/resolutions/20000', '/resolutions/40000', '/resolutions/70000', '/resolutions/120000', '/resolutions/500000']. Use '::' to specify a group path"
# note that '/' is listed as a cooler group path
$ hicInfo -m cooler_matrix.mcool
KeyError: "No cooler found at: hic_matrix.mcool. Coolers found in ['/resolutions/20000', '/resolutions/40000', '/resolutions/70000', '/resolutions/120000', '/resolutions/500000']. Use '::' to specify a group path"
import h5py
h5py.File("hic_matrix.mcool").attrs.get("format") # return 'HDF5::Cooler'
h5py.File("cooler_matrix.mcool").attrs.get("format") # return 'HDF5::MCOOL'
Dear HiCExplorer team,
When I use
cooler.fileops.list_coolersto inspectmcoolfiles created byhicConvertFormat, I always received a warningI noticed that
mcoolfiles created byhicConvertFormatuse"HDF5::Cooler"as itsformat, socooler.fileops.list_coolersreports the root group ("/") as a (corrupted) cooler dataset.https://github.com/open2c/cooler/blob/b009aea8c6aadd7c7848bca9bdd6ea708ef0a554/src/cooler/fileops.py#L116-L126
mcool files created by
cooler.zoomify_coolerhave"HDF5::MCOOL"as theirformat.steps to reproduce