aertslab / scenicplus

SCENIC+ is a python package to build gene regulatory networks (GRNs) using combined or separate single-cell gene expression (scRNA-seq) and single-cell chromatin accessibility (scATAC-seq) data.
Other
162 stars 27 forks source link

ModuleNotFoundError: No module named 'pyranges.pyranges_main' #368

Open janursa opened 2 months ago

janursa commented 2 months ago

I have results of scenicplus using the previous version with 'scplus_obj.pkl' as output. I installed the new version recently and have problem reading this file. dill.load gives error ModuleNotFoundError: No module named 'pyranges.pyranges_main'. Based on some search, if i pip install pyranges==0.0.129, it fixes this error and read the file successfully. However, it conflicts with other packages ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pycistopic 2.0a0 requires pyranges<0.0.128, but you have pyranges 0.0.129 which is incompatible. pycistarget 1.0a2 requires pyranges<0.0.112,>=0.0.111, but you have pyranges 0.0.129 which is incompatible. scenicplus 1.0a1 requires pyranges==0.0.111, but you have pyranges 0.0.129 which is incompatible..

which results in scenic_obj not having the right content, e.g. missing eRegulon etc.

SeppeDeWinter commented 2 months ago

Hi @janursa

Indeed, like you said, this error is caused by saving the object using a different version of pyranges than the one you are using to load the object.

I would not worry too much about this warning:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pycistopic 2.0a0 requires pyranges<0.0.128, but you have pyranges 0.0.129 which is incompatible. pycistarget 1.0a2 requires pyranges<0.0.112,>=0.0.111, but you have pyranges 0.0.129 which is incompatible. scenicplus 1.0a1 requires pyranges==0.0.111, but you have pyranges 0.0.129 which is incompatible.

Did it still install pyranges v0.0.129?


import pyranges
pyranges.__version__

Also, do you still have an environment with the previous version of SCENIC+? When you load the object with that environment, are you also missing those fields in the scplus_obj?

Best,

Seppe

janursa commented 1 month ago

Thanks, @SeppeDeWinter, By installing v0.0.129, it reads the file without an error but the content is missing. Unfortunately, i dont have an environment with the previous version of SCENIC+. But, it has all the content as i had already extracted eRegulons. Also, it has 15GB of size so i cannot be empty. It seems that something goes wrong in the reading process. best Jalil

SeppeDeWinter commented 1 month ago

Hi

Very strange! This is exactly the reason why we switched away from using pickle. The only thing I can try to suggest is to try to rebuild the environment, I'm sorry I can not be of much help here.

Best,

Seppe

janursa commented 1 month ago

thank you, @SeppeDeWinter can you pls direct me to a branch or a commit of the github repo that was for the past version of scenicplus? thanks

SeppeDeWinter commented 1 month ago

Hi @janursa

Of course, this code can be found here: https://github.com/aertslab/scenicplus/tree/old.

Best,

Seppe

janursa commented 1 month ago

thank you, @SeppeDeWinter, I tried to install the old version but seems like in your requirements.txt, you are installing certain packages using git, pointing to the master/main branches. This gives an error as certain branches are no longer existing or compatible. Would you be kind to check if you can install the old version of scenicplus yourself? appreciated :-)

Collecting pycistarget@ git+https://github.com/aertslab/pycistarget@master (from scenicplus==1.0.1.dev13+gc64b26a) Cloning https://github.com/aertslab/pycistarget (to revision master) to /tmp/pip-install-zrnfgwth/pycistarget_54b1d25f5ec74f88b3f965f9a4594a30 Running command git clone --filter=blob:none --quiet https://github.com/aertslab/pycistarget /tmp/pip-install-zrnfgwth/pycistarget_54b1d25f5ec74f88b3f965f9a4594a30 WARNING: Did not find branch or tag 'master', assuming revision or ref. Running command git checkout -q master error: pathspec 'master' did not match any file(s) known to git error: subprocess-exited-with-error

SeppeDeWinter commented 1 month ago

Hi @janursa

I fixed the version in the old branch: https://github.com/aertslab/scenicplus/commit/c1924d7b03ca80b7bea3215e204e12bc1dca3124.

Creating a new environment from this


mamba create --name scenicplus_old python=3.8 -y
mamba activate scenicplus_old
git clone https://www.github.com/aertslab/scenicplus
cd scenicplus
git checkout old
pip install .

Works in my hands and I'm also able to load old scplus_obj files.

Best,

Seppe

janursa commented 1 month ago

thank you @SeppeDeWinter, That installed the package successfully. But, the original issue is still there. when i load the data, i get ModuleNotFoundError: No module named 'pyranges.pyranges_main. i tried this both on my personal computer as well as linux cluster and same results. which version of pyranges did you use that let you load the old scplus_obj?

SeppeDeWinter commented 1 month ago

Hi @janursa

I used the version listed in the requirements file (i.e. 0.0.111). But it also depends which version you used to generate your object.

All the best,

Seppe