getian107 / PRScsx

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

KeyError #41

Closed AnjeGrobler closed 7 months ago

AnjeGrobler commented 8 months ago

Hi Doctor Tian,

I appreciate your help earlier. I ran into another problem.

The code that I am running is: python3 PRScsx.py --ref_dir=/scratch/grbanj001/Data_DCHS/Imputed_Mothers/Imputed_by_Megan/ --bim_prefix=/scratch/grbanj001/Data_DCHS/Imputed_Mothers/Imputed_by_Megan/MothersQCed --sst_file=/scratch/grbanj001/Data_DCHS/Imputed_Mothers/Imputed_by_Megan/aam_ptsd3.fuma,/scratch/grbanj001/Data_DCHS/Imputed_Mothers/Imputed_by_Megan/eur_ptsd3.fuma --n_gwas=51034,1222882 --pop=AAM,EUR --out_dir=/scratch/grbanj001/Data_DCHS/Imputed_Mothers/Imputed_by_Megan/ --out_name=PRS_PTSD_generated --a=1 --b=0.5 --phi=1e-2 --thin=5 --meta=TRUE

The problem I am getting is: Traceback (most recent call last): File "PRScsx.py", line 154, in main() File "PRScsx.py", line 137, 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]) File "/scratch/grbanj001/Data_DCHS/Imputed_Mothers/Imputed_by_Megan/parse_genet.py", line 81, in parse_sumstats idx = [ii for (ii,frq) in enumerate(refdict['FRQ'+pop.upper()]) if frq>0] KeyError: 'FRQ_AAM'

Could you assist?

Many thanks, Anje

getian107 commented 8 months ago

We don't have an AAM population. --pop can only specify populations from the following: AFR, AMR, EAS, EUR, SAS.

AnjeGrobler commented 8 months ago

Thank you for the clarification! :)

AnjeGrobler commented 8 months ago

Hello Doctor,

After running my code, amended as you indicated above, it generates empty files. When I was doing the tut, I made a note to myself: "*Edit these details in PRScsx.py under parse_param()." This was before you informed me to not edit PRScsx.py. Do you have any guidance on fixing my empty output files?

Many thanks!

getian107 commented 8 months ago

Could you send screenshots on (i) the first few lines of your input files; (ii) the command line you used to call PRS-CSx?

AnjeGrobler commented 8 months ago
Screenshot 2024-01-12 at 18 42 02

Hi Doctor, Please see the full screenshot attached.

getian107 commented 8 months ago

Could you convert lower case atgc in the input to upper case and try again?

AnjeGrobler commented 8 months ago

That solved my problem.

I know these were small and silly questions, but for someone as inexperienced as me, they were really challenging. I would like to thank you in abundance for your help and kindness towards me.