Skip to content

gene_scoring zlib.error: Error -3 while decompressing data: unknown compression method #40

Description

@wenjiezeng-cumc

Dear Author,

Thank you for creating this wonderful package. However, when I was running the gene_scoring.ipynb script and Gscorer.score_all (), I encountered this issue

 Traceback (most recent call last):

File "/home/wenjie/miniconda3/lib/python3.12/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/home/wenjie/miniconda3/lib/python3.12/site-packages/PascalX-0.0.5-py3.12-linux-x86_64.egg/PascalX/genescorer.py", line 982, in _scoremain
C,R = self._calcGeneSNPcorr(cr,G[i],REF)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wenjie/miniconda3/lib/python3.12/site-packages/PascalX-0.0.5-py3.12-linux-x86_64.egg/PascalX/genescorer.py", line 776, in _calcGeneSNPcorr
DATA = REF[str(cr)][0].get(list(P))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wenjie/miniconda3/lib/python3.12/site-packages/PascalX-0.0.5-py3.12-linux-x86_64.egg/PascalX/snpdb.py", line 116, in get
E.append( pickle.loads(zlib.decompress(data) ) )

I followed the scripts and this tutorial to load the reference panels, and checked all .idx.gz files. They seem be properly gziped. Could you help me find out the reason and solve this problem?

Thanks!
Wenjie

Activity

  1. Dan-RAI commented on May 31, 2025

    @Dan-RAI
    Collaborator

    hm, it could be a problem with pickle in python3.12 . Have not tested PascalX on newer versions of python.

    Can you give it a try with python3.8 ?

  2. wenjiezeng-cumc commented on Jun 2, 2025

    @wenjiezeng-cumc
    Author

    hm, it could be a problem with pickle in python3.12 . Have not tested PascalX on newer versions of python.

    Can you give it a try with python3.8 ?

    Hi Dan,

    Thank you so much for your quick reply. This makes sense. python3.8 is currently not installed to my system. However, I will install it and try running PascalX under the python3.8 kernel. Just a quick question, do I need to re-run the

    cd python
    python3 setup.py install 
    

    to setup the python3.8 environment?

    Thanks,
    Wenjie

  3. Dan-RAI commented on Jun 2, 2025

    @Dan-RAI
    Collaborator

    Most likely you would need to run again, but explicitly with

    python3.8 setup.py install

    in case 3.8 is not your default python version. If you use ipython/jupyter, you would also need to make sure that 3.8 is used as kernel.

    In case problems persists afterwards, would be good to know your linux distribution and the installed zlib version.

    Alternatively, you can also try the Docker.

    If I find some time in between, will try to investigate if there is a general problem with python3.12 and PascalX or not.

  4. wenjiezeng-cumc commented on Jun 2, 2025

    @wenjiezeng-cumc
    Author

    Most likely you would need to run again, but explicitly with

    python3.8 setup.py install

    in case 3.8 is not your default python version. If you use ipython/jupyter, you would also need to make sure that 3.8 is used as kernel.

    In case problems persists afterwards, would be good to know your linux distribution and the installed zlib version.

    Alternatively, you can also try the Docker.

    If I find some time in between, will try to investigate if there is a general problem with python3.12 and PascalX or not.

    Hi Dan,

    I have python3.8 successfully installed, however, when I ran python3.8 setup.py install,

    This was what I get

    Installed /usr/local/lib/python3.8/dist-packages/PascalX-0.0.5-py3.8-linux-x86_64.egg
    Processing dependencies for PascalX==0.0.5
    Searching for matplotlib!=3.6.1,>=3.1
    Reading https://pypi.org/simple/matplotlib/
    /usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release
    warnings.warn(
    Downloading https://files.pythonhosted.org/packages/26/91/d49359a21893183ed2a5b6c76bec40e0b1dcbf8ca148f864d134897cfc75/matplotlib-3.10.3.tar.gz#sha256=2f82d2c5bb7ae93aaaa4cd42aca65d76ce6376f83304fa3a630b569aca274df0
    Best match: matplotlib 3.10.3
    Processing matplotlib-3.10.3.tar.gz
    error: Couldn't find a setup script in /tmp/easy_install-9k3zhr1d/matplotlib-3.10.3.tar.gz

    I have already installed a matplotlib version !=3.6.1 &>3.1 under python 3.8 but still got the error... I swithced to use Docker and encountered the same error message

    Thanks so much!
    Wenjie

  5. Dan-RAI commented on Jun 4, 2025

    @Dan-RAI
    Collaborator

    Which precise matplotlib version do you have installed ? You can try to change in the file requirements.txt to your installed matplotlib version.

  6. wenjiezeng-cumc commented on Jun 4, 2025

    @wenjiezeng-cumc
    Author

    Which precise matplotlib version do you have installed ? You can try to change in the file requirements.txt to your installed matplotlib version.

    Thank you so much for your patience!

    I have uninstalled and reinstalled the package using python3.8 and this time it was fully installed without any error message. I have overcome another "no zoneinfo" error, and genescorer was successfully imported. But when I try in run score_chr, I have encountered another error,

    File ~/.local/lib/python3.8/site-packages/PascalX/genescorer.py:1094, in (.0)
    1091 result = pool.apply_async(self._scoremain, (S[i],True,method,mode,reqacc,intlimit,'',i,nobar,lock,keep_idx))
    1092 result_objs.append(result)
    -> 1094 results = [result.get() for result in result_objs]
    1096 for r in results:
    1097 R[0].extend(r[0])

    File /usr/lib/python3.8/multiprocessing/pool.py:771, in ApplyResult.get(self, timeout)
    769 return self._value
    770 else:
    --> 771 raise self._value

    ModuleNotFoundError: No module named 'numpy._core'

    I tried numpy 1.21.0 to 1.24.0, the same error still occur....

  7. Dan-RAI commented on Jun 4, 2025

    @Dan-RAI
    Collaborator

    I think you may have conflicting (or mixture) of packages between system level and user level on your system ( /usr/lib/python3.8/, vs ~/.local/lib/python3.8/ ). Try to re-install PascalX with the --user flag to force full user level install, or try via sudo PascalX install to put PascalX on the system level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions