omerwe / polyfun

PolyFun (POLYgenic FUNctionally-informed fine-mapping)
MIT License
94 stars 22 forks source link

All LD Scores have zero variance #202

Closed gdgdandsz closed 1 month ago

gdgdandsz commented 4 months ago

Hi, I'm currently trying to use compute_ldscores_from_ld.py with ukb to generate ldscores as annotation inputs to polyfun. However, the annotation column of outputs of compute_ldscores_from_ld.py are all zero and polyfun gives a ValueError: All LD Scores have zero variance. The dataset I'm working on is based on European individuals so I thought it may also works with the ukb matrix. I'm wondering if this matters. Also, there is a warning [INFO] Loading LD from file /var/folders/wt/n52jr2p97d19jppn9k17lx3h0000gn/T/tmp7b14xgth/chr3_48000001_51000001.npz [INFO] Done in 3.48 seconds [WARNING] Only 858/13641 SNPs in chromosome 3 BP 48000001-51000001 have annotations info. This may severely down-bias the LD-scores but since I encountered this warning even with your example data, I ignored it in my previous attempts.

omerwe commented 4 months ago

Hi, I can't help without seeing the data, but I suspect the annotations might not be very informative (e.g. all SNPs have some annotation or all SNPs don't have it). Also, if you don't provide annotation values for all SNPs in your data you may get false results, it's strongly recommended to provide annotation values for all SNPs.

gdgdandsz commented 4 months ago

Thank you for your help! I tried to control the variable to figure out the problem. For chr1, my summary stats has about 650000+ overlaps with UK Biobank so I used ukb annotations provided from your link with these overlaps to see the outputs. It turned out that all the ld scores produced by ukb matrix were zero. So, I think it might be the problem of summary stats and maybe I should not use UKB ld matrix to generate ldscores. I'll try to compute my own ld matrix to see if it works.