This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to use plink to get all the SNP LD score > 0.8 in matrix format?

I am a freshmen with plink. I downloaded the 1000 genome phase 3 data and try to get all the snp pairs with ld score > 0.8 in a matrix format. I use the following command: plink --vcf ALL.chr1.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz --keep-fam EUR.id --geno 0.05 --hwe 1e-6 --make-bed --out tmp but when I tied to filter the r2 value and get matrix output with this command: plink --bfile tmp --r2 square --ld-window-r2 0.8 --out EUR_chr1 it showed that "Error: --ld-window-r2 flag cannot be used with the --r2 matrix output modifiers." if I didn't use "square" argument, I only got all the snp pairs with ld score > 0.8 in a table format, like "EUR_chr1.ld". Is there any way to change "EUR_chr1.ld" into matrix with plink? If I could get the matrix directly, that would be better. thanks for any helps.

snp

1 answer

If you want a matrix with all values > 0.8 set to zero, just write a one-line postprocessing script that replaces values <= 0.8 with zero.

Log in to answer this question.