cooler icon indicating copy to clipboard operation
cooler copied to clipboard

check_integrity utility

Open gfudenberg opened this issue 6 years ago • 0 comments

add check_integrity utility that can be called at key places, including Cooler instantiation

(if indexes are missing, cooler cli currently fails with uninformative errors, as below)

cooler coarsen --out test.cool Traceback (most recent call last): File "/home/gfudenberg/anaconda3/bin/cooler", line 11, in load_entry_point('cooler', 'console_scripts', 'cooler')() File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in call return self.main(*args, **kwargs) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/cooler/cli/aggregate.py", line 286, in coarsen lock=lock if same_file else None) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/cooler/cli/aggregate.py", line 45, in aggregate map=pool.map if nproc > 1 else map) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/cooler/_binning.py", line 504, in init self.old_chrom_offset = clr._load_dset('indexes/chrom_offset') File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/cooler/api.py", line 87, in _load_dset return grp[path][:] File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/h5py_1482475225177/work/h5py/_objects.c:2856) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/h5py_1482475225177/work/h5py/_objects.c:2814) File "/home/gfudenberg/anaconda3/lib/python3.6/site-packages/h5py/_hl/group.py", line 166, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/h5py_1482475225177/work/h5py/_objects.c:2856) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/h5py_1482475225177/work/h5py/_objects.c:2814) File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/home/ilan/minonda/conda-bld/h5py_1482475225177/work/h5py/h5o.c:3742) KeyError: 'Unable to open object (Component not found)'

gfudenberg avatar Feb 11 '19 22:02 gfudenberg