getian107 / PRScsx

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

local variable 'ref_dict' referenced before assignment #24

Closed ghousen closed 1 year ago

ghousen commented 1 year ago

Dear Tian,

Thanks for this software! I am running into the same issue over and over again. I have been trouble shooting this all day without any progress. I have downloaded the LD files, used both UKB and 1kg LD files, renamed folder, directed it to the different folders etc, used different versions of python/anaconda but I still get the same error...

The code that I am running is: python ./PRScsx/PRScsx.py --ref_dir=/home/projects/cu_10039/people/anonym/gwas/gwas_091222/prs/ld/ldblk_1kg_afr --bim_prefix=/home/projects/cu_10039/people/anonym/gwas/prs/plinkFiles/plink_chr22 --sst_file=./sumstats/gwas_black_prs.txt --n_gwas=20000 --pop=AFR --chrom=22 --phi=1e-2 --out_dir=. --out_name=test

The error I am getting is:

process chromosome 22

... parse bim file: /home/projects/cu_10039/people/anonym/gwas/prs/plinkFiles/plink_chr22.bim ... ... 166801 SNPs on chromosome 22 read from /home/projects/cu_10039/people/anonym/gwas/prs/plinkFiles/plink_chr22.bim ... Traceback (most recent call last): File "./PRScsx/PRScsx.py", line 215, in main() File "./PRScsx/PRScsx.py", line 198, in main sst_dict[pp] = parse_genet.parse_sumstats(ref_dict, vld_dict, param_dict['sst_file'][pp], param_dict['pop'][pp], param_dict['n_gwas'][pp]) UnboundLocalError: local variable 'ref_dict' referenced before assignment

Any ideas on what might be going on?

Bw, Jonas