This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plink: compute LD between all SNP pairs

I would like to compute LD (r2) between ALL my SNP pairs.

I think running the default plink --file mydata --r2 applies some pre-defined filtering as below:

 --ld-window 10
 --ld-window-kb 1000
 --ld-window-r2 0.2

The explanation for these arguments makes no sense whatsoever. So I ended up using Mapthin to thin my SNPs.

Now that I have my short SNP set, all I want to do is compute r2 values between ALL my SNPs pairs without any filtering. How do I accomplish that?

plink snp linkage disequilibrium ld

The explanation for these arguments makes no sense whatsoever

I think that the PLINK documentation is actually the best there is for any program. Difficult to completely explain each parameter, though.

1 answer

"--r2 inter-chr --ld-window-r2 0" reports all results in table format, while "--r2 square" generates a text matrix.

I don't need interchromosomal pairs. So I removed inter-chr. And i don't want matrix, I want a table. Then if I run the rest:

plink --file mydata --r2 --ld-snp-list "snp-thin.txt" --out "snp-thin"

I don't get all pairwise comparisons. If I check the number of snps on one chromosome in input (mydata), lets say there are 20 snps. All pairwise comparisons should produce 380 rows in output. In the output for that one chromosome, I get around 100 or so. So, it's not doing all pairwise comparisons. I suspect the hidden filtering I mentioned is playing a role.

If you remove inter-chr, you need to manually specify large values for ld-window and ld-window-kb.

Log in to answer this question.