bio-ontology-research-group/deepgoplus

predict.py - gzip fails to open ASCII file

hdetering opened this issue · 3 comments

Hi,

in predict.py you open the DIAMOND output table using gzip, which leads to an error in current Python versions:

with gzip.open(diamond_file, 'rt') as f:

The output I got with the example file data/test_diamond.res contained in your data bundle was this:

2022-06-28 14:53:36.462111: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
Traceback (most recent call last):
  File "../tools/deepgoplus//predict.py", line 174, in <module>
    main()
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "../tools/deepgoplus//predict.py", line 45, in main
    for line in f:
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/gzip.py", line 300, in read1
    return self._buffer.read1(size)
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/_compression.py", line 68, in readinto
    data = self.read(len(byte_view))
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/gzip.py", line 474, in read
    if not self._read_gzip_header():
  File "/home/hdetering/miniconda3/envs/crowdgo/lib/python3.7/gzip.py", line 422, in _read_gzip_header
    raise OSError('Not a gzipped file (%r)' % magic)
OSError: Not a gzipped file (b'AC')
``

Oh, and the same happens when opening the FASTA file:

with gzip.open(filename, 'rt') as f:

Hi,I met this question too,Did you solve it?

Well, I just edited the code to remove the gzip..
Just a workaround, that's why I posted the Issue so that the devs can hopefully fix it in a future release.