Pairwise LD computation

247 views
Skip to first unread message

Joana Monteiro

unread,
Mar 27, 2019, 12:36:12 PM3/27/19
to plink2-users
How do we calculate pairwise LD given that we have a list with the SNPs of interest for the ld computation? In this case, we don't want to compute the LD for SNPs that aren't within this list.

Christopher Chang

unread,
Mar 27, 2019, 2:42:37 PM3/27/19
to plink2-users
Is there a reason you can't just use --extract on your SNP list?

Joana Monteiro

unread,
Mar 29, 2019, 5:16:31 PM3/29/19
to plink2-users
Hi! Yes, that is what I will be doing most likely: --extract the SNPs of interest from the list and then for the LD computation window I will measure the lenght from the first SNP position to the last position and multiply it by 2 so there is room for the computation to be thorough. I asked this question in case there was a more direct approach to this problem that was already available.

Joana Monteiro

unread,
Apr 3, 2019, 6:56:07 AM4/3/19
to plink2-users
After doing all the steps I mentioned I found a problem in the output (.ld file). I had 27 SNPs of interest originally and I should have the 27 SNP pairs to which ld values are computed in the output for each SNP, but that doesn't happen, for each SNP I seem to be getting different numbers of SNP pairs and I don't understand why. I must add that what I did for testing purposes was to put a r2 threshold equal to zero so I would get all the pairs.

For example, I input the command:
> plink --bfile DATA --ld-window-kb 880000 --ld-window-r2 0 --r2 --ld-snp-list snp_list.txt --out testLD --allow-no-sex

And in the output file I found that it doesn't compare the rs71373525 with the rs11736137. Then I tried this command to see the r2 value for this specific pair:

> plink --bfile DATA --ld rs117326137 rs71373525 --allow-no-sex

This way the ld is computed just fine and it should pass the threshold of zero in the other command. Any suggestions on why this happens?

Christopher Chang

unread,
Apr 3, 2019, 11:40:17 AM4/3/19
to plink2-users
plink 1.x takes the *intersection* of the --ld-window and --ld-window-kb settings... and the default --ld-window setting is 10.  (Which was reasonable, in 2007.)  I'll be changing that default to "infinity" in plink 2.0, but until then, you need to add something like "--ld-window 880000" to your command line.

Joana Monteiro

unread,
Apr 3, 2019, 12:09:09 PM4/3/19
to plink2-users
Thank you Christopher! It works just fine now, thank you for the reply!
Reply all
Reply to author
Forward
0 new messages