LD Matrix Containing D' and not R2

60 views
Skip to first unread message

brady.g...@gmail.com

unread,
Jul 23, 2021, 12:06:14 PM7/23/21
to plink2-users
Is it possible to create an LD matrix containing D' values instead of r2 values?

Thanks

Christopher Chang

unread,
Jul 23, 2021, 12:51:16 PM7/23/21
to plink2-users
Not with e.g. "--r2 square dprime", but you can postprocess the "--r2 inter-chr dprime --ld-window-r2 0" output into a matrix shape.

brady.g...@gmail.com

unread,
Jul 26, 2021, 7:57:39 AM7/26/21
to plink2-users
What is the best way to create an ld matrix with either version of plink? I have a bfile dataset and want to create a ld matrix with R2. When using bin option, it is not readable on command line so not sure what the format is. I need the ld matrix to use for another R package.

Christopher Chang

unread,
Jul 26, 2021, 12:21:27 PM7/26/21
to plink2-users
Re: reading a binary matrix into R, see the example readBin R command under https://www.cog-genomics.org/plink/1.9/distance#distance .

brady.g...@gmail.com

unread,
Jul 26, 2021, 3:21:17 PM7/26/21
to plink2-users
Thanks. And when using --r2 square, what is the cause of many nan values?

Christopher Chang

unread,
Jul 26, 2021, 3:52:03 PM7/26/21
to plink2-users
Lack of genotype variation.  Missing genotypes can exacerbate this: if all but one sample has a homozygous-REF genotype for variant A, and that sample has a missing genotype for variant B, then the A-B r^2 coefficient will be nan.
Reply all
Reply to author
Forward
0 new messages