# How to compute LD for pairs of variants with Plink

I have a set of SNPs (single nucleotide polymorphisms) { S1, S2, ..., SN } from approximately 200 humans. I wish to determine the linkage disequilibrium (LD) for a defined subset of these SNPs. By this I mean e.g. I would like to compute e.g. LD between S1 and S2, S3, S4, but not the LD between S2 and S3.

Could this calculation be performed in PLINK?

• Hi Learner, thanks for you post and hope you can hang around here.The obvious question is why do you wish to sub-sample the genome, i.e. biological rationale?
– M__
Commented Apr 23, 2019 at 0:34
• In this case, I have a priori generated SNP pairs as the output of an eQTL analysis. Now I just want to know about the LD between pairs of SNPs, which I could compute manually, but I have thousands of pairs, and so it is ideal if there is efficient software like PLINK that I could use... Commented Apr 23, 2019 at 16:24
• I've added a comment below
– M__
Commented Apr 23, 2019 at 19:25
• It could be that your question is not clear, but reads that you are wanting some SNPs subject to LD, but others excluded. For an LD to work you'll need a large number of SNPs which would be input simultaneously. You can subsample a given (human) population, your data set might therefore be further broken down from 200 humans.
– M__
Commented Apr 24, 2019 at 7:40

Yes, you can do this with plink.

You can use the flag --ld-snp <variant_id> to calculate LD between your SNP of interest and all other SNPs.
If you have multiple SNPs of interest, and want each of those compared with every SNP in your dataset, use --ld-snps <snp1-snp100,snp102,snp104>
A final option to calculate LD between a specific pair of SNPs is --ld <variant_id1> <variant_id2>

This the relevant plink manual page

Anyway, it would be fairly easy via the filtering options here

The --exclude-snp is what you are wanting.

I have worked in LD and subsampling a genome is open to forcing a result. The alternative approach is the subsample is the population, or examine disequilibrium with respect to the physical chromosome. A local shift in disequilibrium or heterozygosity (sliding window along a chromosome) is an indication of selective pressure. This approach is frequently used in eukaryotic parasites to identify drug resistance. I don't have experience of human genetics but there are certainly enough here who do. However, I think you need to define the biological rationale for the subsample. Just having loads of data is easily resolved because any algorithm can be written to handle automation.

• The issue is that LD usually involves a 5% cut-off, even using a maximum likelihood approach I'd be cautious (I don't which PLINK uses), and is therefore sensitive variations in the data set
– M__
Commented Apr 24, 2019 at 7:46