Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predict.py - gzip fails to open ASCII file #46

Open
hdetering opened this issue Jun 28, 2022 · 3 comments
Open

predict.py - gzip fails to open ASCII file #46

hdetering opened this issue Jun 28, 2022 · 3 comments

Comments

@hdetering
Copy link

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')
``
@hdetering
Copy link
Author

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

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

@zjxhahaha
Copy link

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

@hdetering
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants