deeptools / HiCMatrix

GNU General Public License v3.0
11 stars 8 forks source link

MatrixFileHandler.load() crashes interpreter quite brutally #19

Closed mvdbeek closed 4 years ago

mvdbeek commented 4 years ago

I was debugging hicexplorer execution using the current bioconda image, and there the interpreter quits with exit code 1. That seems less than ideal:

Python 3.6.7 | packaged by conda-forge | (default, Nov  6 2019, 16:19:42)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from hicmatrix.lib.matrixFileHandler import MatrixFileHandler
>>> m = MatrixFileHandler('h5', '0_matrix.h5')
INFO:numexpr.utils:NumExpr defaulting to 3 threads.
>>> m.load()
INFO:hicmatrix.lib.h5:No h5 file. Please check parameters concerning the file type!
bash-4.2#

I think this is because of https://github.com/deeptools/HiCMatrix/blob/fa861294296c26e31e877c7c2c2cdfdeda1214ed/hicmatrix/lib/h5.py#L34 ... calling sys.exit shouldn't be done in a library, as there's no way to handle this gracefully. Additionally the helpful info message should be a error message, so that there is something one can work with.

lldelisle commented 4 years ago

We are also facing issues with pygenometracks so I proposed #22

joachimwolff commented 4 years ago

Fixed with version 12.