omerwe / S-PCGC

Heritability, genetic correlation and functional enrichment estimation for case-control studies
GNU General Public License v3.0
17 stars 3 forks source link

Failed tests with anaconda3 #5

Closed llpesce closed 11 months ago

llpesce commented 12 months ago

I am not sure how to handle this error:

conda 4.3.30

conda env create PCGC conda create --name PCGC source activate PCGC conda install numpy conda install scipy conda install scikit-learn conda install pandas conda install pandas-plink conda install -c conda-forge pandas-plink conda install tqdm

git clone https://github.com/omerwe/S-PCGC

python test_sumstats.py temporary directory: /tmp/2qujmo39 Creating summary statistics for study s3... Command python pcgc_sumstats_creator.py --bfile example/s3 --covar example/s3.cov --prev 0.01 --pheno example/s3.phe --frqfile /projects/b1137/Diabetic_retinopathy/GeneticCorrelation/S-PCGC/S-PCGC/example/model.1. --annot /projects/b1137/Diabetic_retinopathy/GeneticCorrelation/S-PCGC/S-PCGC/example/model.1. --out /tmp/2qujmo39/s3.1 --sync /projects/b1137/Diabetic_retinopathy/GeneticCorrelation/S-PCGC/S-PCGC/example/model. returned 1 with the following stdout: b'pcgc_sumstats_creator.py:388: DeprecationWarning: np.int is a deprecated alias for the builtin int. To silence this warning, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.\nDeprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n df_pheno.iloc[:,-1] = df_pheno.iloc[:,-1].astype(np.int)\npcgc_sumstats_creator.py:50: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.\nDeprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n df_covar[c] = df_covar[c].astype(np.float)\n[INFO] reading frq file...\n[INFO] Reading plink file from disk (this may take a while...)\n*****\n S-PCGC sumstats creator\n Version 2.0.0\n* (C) 2018 Omer Weissbrod\n*****\n\n\rMapping files: 0%| | 0/3 [00:00<?, ?it/s]\rMapping files: 100%|\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88| 3/3 [00:00<00:00, 81.52it/s]\n[INFO] 1500 SNPs remained after removing SNPs without MAFs\npcgc_sumstatscreator.py:373: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.boolhere.\nDeprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n is_relevant_col = np.zeros(df.shape[1], dtype=np.bool)\npcgc_sumstats_creator.py:373: DeprecationWarning:np.boolis a deprecated alias for the builtinbool. To silence this warning, useboolby itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.bool_here.\nDeprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n is_relevant_col = np.zeros(df.shape[1], dtype=np.bool)\npcgc_sumstats_creator.py:373: DeprecationWarning:np.boolis a deprecated alias for the builtinbool. To silence this warning, useboolby itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.bool_` here.\nDeprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n is_relevant_col = np.zeros(df.shape[1], dtype=np.bool)\nTraceback (most recent call last):\n File "pcgc_sumstats_creator.py", line 592, in \n sumstats_creator = PCGC_Sumstats(args)\n File "pcgc_sumstats_creator.py", line 75, in init\n self.bfile, df_pheno, df_maf, self.num_snps, self.sample_size = self.read_plink(args, df_pheno, df_maf)\n File "pcgc_sumstats_creator.py", line 486, in read_plink\n is_consistent_snp = (df_maf[allele1_col] == df_bim[\'a1\']) & (df_maf[allele0_col] == df_bim[\'a0\'])\n File "/home/lpe159/.conda/envs/PCGC/lib/python3.8/site-packages/pandas/core/ops/common.py", line 70, in new_method\n return method(self, other)\n File "/home/lpe159/.conda/envs/PCGC/lib/python3.8/site-packages/pandas/core/arraylike.py", line 40, in eq\n return self._cmp_method(other, operator.eq)\n File "/home/lpe159/.conda/envs/PCGC/lib/python3.8/site-packages/pandas/core/series.py", line 5617, in _cmp_method\n raise ValueError("Can only compare identically-labeled Series objects")\nValueError: Can only compare identically-labeled Series objects\n' Traceback (most recent call last): File "test_sumstats.py", line 106, in test_sumstats(temp_dir) File "test_sumstats.py", line 58, in test_sumstats run_command(ss_command) File "test_sumstats.py", line 20, in run_command raise IOError()
OSError

omerwe commented 11 months ago

Hi, turns out various backward-compatability changes have been introduced since 2019. I just updated the code and made sure it runs fine, can you please git pull and see if this solves the problem?

llpesce commented 11 months ago

Thank you for the quick response! The problem is resolved. Now I have to figure out how to compute a genetic correlation with it!

From: Omer Weissbrod @.> Date: Sunday, November 26, 2023 at 2:27 PM To: omerwe/S-PCGC @.> Cc: Lorenzo Luigi Pesce @.>, Author @.> Subject: Re: [omerwe/S-PCGC] Failed tests with anaconda3 (Issue #5)

Hi, turns out various backward-compatability changes have been introduced since 2019. I just updated the code and made sure it runs fine, can you please git pull and see if this solves the problem?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/omerwe/S-PCGC/issues/5*issuecomment-1826888126__;Iw!!Dq0X2DkFhyF93HkjWTBQKhk!Uz1Xy4kr2St7OOkDRsxNN6l6fjpTXPKRCRRIOaY2ERfhpNjRZu-BEChship5IaMVc95_Ds7tnZPeF4jKEC1LRTaCdQt3sqaXZ08$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AE2GZ5A3NE7QE5BILFEHPZ3YGOQ3ZAVCNFSM6AAAAAA7QR5UAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWHA4DQMJSGY__;!!Dq0X2DkFhyF93HkjWTBQKhk!Uz1Xy4kr2St7OOkDRsxNN6l6fjpTXPKRCRRIOaY2ERfhpNjRZu-BEChship5IaMVc95_Ds7tnZPeF4jKEC1LRTaCdQt3miCFoiQ$. You are receiving this because you authored the thread.Message ID: @.***>

omerwe commented 11 months ago

Yes, thanks was the easy part :) Good luck!