getian107 / PRScsx

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

Referencing Error Occured #7

Closed joomango closed 3 years ago

joomango commented 3 years ago

Dear Dr. Tian,

I have encountered the following issue while running the PRS-csx:

**$ python3 /home/PRScsx/PRScsx.py ....

--ref_dir=/home/PRScsx/ --bim_prefix=/home/genotype --sst_file=['/home/summarystats/GWAS_EA_forPRScs.txt'] --a=1 --b=0.5 --phi=0.01 --n_gwas=[766345] --pop=['EUR'] --n_iter=1000 --n_burnin=500 --thin=5 --out_dir=/home/PRS/ --out_name=PRScs_test --chrom=['22'] --meta=FALSE --seed=777

process chromosome 22

... parse bim file: /work2/07939/tg872382/stampede2/connectome/stampede2/WLS/Herd_WLS_TOP_subject_level.bim ... ... 10256 SNPs on chromosome 22 read from /work2/07939/tg872382/stampede2/connectome/stampede2/WLS/Herd_WLS_TOP_subject_level.bim ... Traceback (most recent call last): File "/work2/07939/tg872382/stampede2/connectome/stampede2/PRScsx/PRScsx.py", line 204, in main() File "/work2/07939/tg872382/stampede2/connectome/stampede2/PRScsx/PRScsx.py", line 187, 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**

I very much appreciate that you had created the AMR ref panel. With your help, I would like to actively utilize PRS-csx for my current participants and your answer will be super helpful in using PRS-csx. Thank you so much,

Yoonie

getian107 commented 3 years ago

Hi Yoonie- did you pull the latest version of the software and download the updated SNP info file?

joomango commented 3 years ago

I pulled again and created another folder for LD reference data. It clarified the error. Thanks for your prompt and kind attention :)

getian107 commented 1 year ago

@tillandlauer Hi Till- I got an email notification that you had an issue running PRS-CSx but somehow couldn't find your comment on GitHub. Is this resolved? If not it seems to be a problem when specifying the directory to the reference panels. It would be helpful if you send the command line that you used to call PRS-CSx.

tillandlauer commented 1 year ago

Good morning - thanks for replying! I had the described issue but realised that I had, having copied the command from PRS-CS, accidentally left the path to the population-specific LD panel in the ref-dir path. So it was my fault of specifying the command wrongly and I didn't want to trouble you with it once I had found out. The error messages are a bit generic, i.e., when the SNP info file cannot be found no specific error message is produced. :) By the way, do I understand correctly that there is no advantage in using PRS-CSx over PRS-CS if I have a GWAS meta-analysis combining studies from several ancestries without ancestry-specfic summary statistics available?

Best regards and thanks for your attentiveness, Till

Am 3. April 2023 23:16:56 MESZ schrieb Tian Ge @.***>:

@tillandlauer Hi Till- I got an email notification that you had an issue running PRS-CSx but somehow couldn't find your comment on GitHub. Is this resolved? If not it seems to be a problem when specifying the directory to the reference panels. It would be helpful if you send the command line that you used to call PRS-CSx.

getian107 commented 1 year ago

Yes- For cross-ancestry meta-GWAS you can simply use PRS-CS.

JuRaGa commented 12 months ago

Hello,

I get the same error, but didn't get from the previous comments how to solve it, please could you help me with that?

UnboundLocalError: local variable 'ref_dict' referenced before assignment

Thank you, Julia

getian107 commented 12 months ago

Hi Julia-- This error usually happens when the directory to the reference panel is not correctly specified. Please double check that --ref_dir points to a folder that contains the file "snpinfo_mult_1kg_hm3" and one or more of the population-specific references such as "ldblk_1kg_eur" and "ldblk_1kg_afr". If you can't find the problem, please send the command line that you used to call PRS-CSx, the full output log and a screenshot of the directory that --ref_dir points to if possible.

JuRaGa commented 12 months ago

Thank you Tian,

I was able to correct the error.

Best, Julia


From: Tian Ge @.> Sent: 15 September 2023 22:04 To: getian107/PRScsx @.> Cc: Julia Ramirez @.>; Comment @.> Subject: Re: [getian107/PRScsx] Referencing Error Occured (#7)

Hi Julia-- This error usually happens when the directory to the reference panel is not correctly specified. Please double check that --ref_dir points to a folder that contains the file "snpinfo_mult_1kg_hm3" and one or more of the population-specific references such as "ldblk_1kg_eur" and "ldblk_1kg_afr". If you can't find the problem, please send the command line that you used to call PRS-CSx, the full output log and a screenshot of the directory that --ref_dir points to if possible.

— Reply to this email directly, view it on GitHubhttps://github.com/getian107/PRScsx/issues/7#issuecomment-1721781168, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIUP5C3GMJZBAWF3XC5MVVLX2SYGLANCNFSM47BCIZAQ. You are receiving this because you commented.Message ID: @.***>

getian107 commented 8 months ago

Hi Anje - Not sure what was the cause based on these information. Could you send (1) a snapshot of the directory where your saved the scripts, and (2) the command line that you used to call PRS-CSx?

AnjeGrobler commented 8 months ago

Hi Anje - Not sure what was the cause based on these information. Could you send (1) a snapshot of the directory where your saved the scripts, and (2) the command line that you used to call PRS-CSx?

Hi Dr. Tian

Here are my screenshots attached. I am still quite young and learning how to use PRS-CSx as the first student at my university, so I would really appreciate your help.

Screenshot 2024-01-09 at 21 25 41 Screenshot 2024-01-09 at 21 31 26

Thank you, Anje

getian107 commented 8 months ago

No worries Anje - Happy to help. I think the issue here is that you should refrain from modifying and running PRScsx.py directly. The usage section in the script merely provides an example of how to call the script. Instead, you should enter your command (python3 PRScsx.py --ref_dir...) into a terminal or include it in a different script from which you can call PRScsx.py.

getian107 commented 8 months ago

In --sst_file, removing the space after comma might resolve the issue. You need to extract relevant columns from the FUMA files but all chromosomes can remain in a single file, and there is no requirement for them to be in a specific order.

AnjeGrobler commented 8 months ago

Thank you very much. That resolved my issue!

Best, Anje

jielab commented 6 months ago

Hi, Prof. Ge:

Somehow I now encountered this same error mentioned by the above users.

Please see my screenshot below. Can you please let me know what I might have done wrong.

image

BTW, for the option --pop=AFR,EAS,EUR,SAS, I can only specify a population name that exists in the LDREF folder (case insensitive), correct? That is, if I write --pop=BLACK,Asian,EUR,SAS, PRS-CSx will complain, I guess.

Best regards, Jie

getian107 commented 6 months ago
PheziweM commented 3 months ago

Dear Dr. Tian,

I hope this message finds you well. I need your assistance regarding an issue I am encountering with my summary statistics data. I have encountered a problem with the summary statistics data, which was originally based on a different reference genome build than my target data. I used LiftOver to convert the summary statistics data from genome build 37 to build 38 to match the target dataset. Despite successfully performing the LiftOver, I am still facing an issue where the SNPs from the summary statistics are not being read by the tool (please see the attached image for reference).

I am unsure of what might be missing or going wrong with my summary statistics data.(attached) I would greatly appreciate any guidance or suggestions you might have to resolve this issue.

Screenshot 2024-06-04 at 00 07 09 Screenshot 2024-06-04 at 00 07 03
getian107 commented 3 months ago

Hi -- The format of the summary stats needs to be strictly followed, i.e., 5 columns with column names SNP, A1, A2, BETA (or OR), and SE (or P). Please see README for examples. Sorry for the limited flexibility.

PheziweM commented 3 months ago

Hi -- The format of the summary stats needs to be strictly followed, i.e., 5 columns with column names SNP, A1, A2, BETA (or OR), and SE (or P). Please see README for examples. Sorry for the limited flexibility.

This helped, Thank you very much.