This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Finding a SNP in LD with a known SNP (rs number) on a list of SNPs

It may seem simple, but I can not seem to find a good way to do this:

Provided that I have a known SNP by rs number, and an extensive list of SNPs on the other hand (almost a million), how would I find the SNP (or SNPs) that are in LD with the known SNP within this list?

It would be ideal if i could do this in a batch: provide a list of known SNPs, and receive lists of LD SNPs for each known SNP as output.

May there also be a way to do this with other types of variations, such as methylation sites?

I have checked PLINK's options but i can not seem to find a way to get this done using only known rs numbers (no known phenotypes, sometimes no known p-values).

snp ld

Computation of LD requires knowledge of the genotype, so I don't think you can achieve you aim in this way. This said, there are data and database relative to given study populations. You can give a look to this link: https://ldlink.nci.nih.gov/

Hey, thanks for your reply. But I understand that given a similar population makeup, each known SNP should have a range where some of my SNPs would likely be, and i should thus be able to match these known SNPs to my SNPs more effectively than just hoping the two rs numbers happen to be an exact match?

1 answer

One way to do it is ot use ensembl REST API: https://rest.ensembl.org/

You can fetch the variants in LD with your variant of interest: https://rest.ensembl.org/documentation/info/ld_id_get and then intersect it with your list of knwon SNPs. It is then easy to set up a loop to process variants in batches.

The REST API gives examples of request in Python, R, perl etc.... And do not forget that you have a limit of ~15 request / seconds https://github.com/Ensembl/ensembl-rest/wiki/Rate-Limits

Hey, great idea! If making such a loop is easy, would you have an example of how to do that?

It depends on the language you want to use, but the principle is the same for every language:

You need to write a "for" loop that will read all the snp ids you want to process, and inside the loop you use the id to query the REST API.

There are plenty of tutorials about for loops available, you also have examples of requests in the last link I gave you

Log in to answer this question.