getian107 / PRScsx

Cross-population polygenic prediction
MIT License
65 stars 20 forks source link

Loading python libraries #22

Closed BasilioCieza closed 1 year ago

BasilioCieza commented 1 year ago

Hello getian107,

Thank you for your nice work, I am Basilio, I hope you are doing well. I am having an issue that I think, and I wanted to report (If I am wrong, please, feel free to correct me).

I follow the steps corresponding to 'getting started'... however, when I run the main code (python PRScsx.py), I got the next error message:

Traceback (most recent call last): File "/mnt/mfs/hgrcgrid/shared/GT_ADMIX/Basilio_08_19_2022/pg_score/PRScsx2/PRScsx-master/PRScsx.py", line 90, in import mcmc_gtb File "/mnt/mfs/hgrcgrid/shared/GT_ADMIX/Basilio_08_19_2022/pg_score/PRScsx2/PRScsx-master/mcmc_gtb.py", line 11, in from scipy import random ImportError: cannot import name 'random' from 'scipy' (/home/bc3045/conda/my-envs/PRScsx/lib/python3.11/site-packages/scipy/init.py)

What I did is simply replace "from scipy import random" by "from scipy.sparse import random"

and it worked, however, I wanted to double check with you cause it seems a very obvious issue and it is weird nobody reported it.

Thank you for your time and patience,

Basilio

getian107 commented 1 year ago

Hi Basilio,

This has been reported recently in PRS-CS: https://github.com/getian107/PRScs/issues/49

I think replacing scipy with numpy will fix the issue. I will update the code when I get a chance.

BasilioCieza commented 1 year ago

Ah ok, I just wanted to double check. Thank you for your soon answer!!