Skip to content

Instantly share code, notes, and snippets.

@slowkow
Last active August 9, 2022 00:44
Show Gist options
  • Save slowkow/3d13aa44cf4f65ca9ad2a0570346ba05 to your computer and use it in GitHub Desktop.
Save slowkow/3d13aa44cf4f65ca9ad2a0570346ba05 to your computer and use it in GitHub Desktop.
Find SNP proxies in R
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RandaAli1
Copy link

Hi,
I am trying to find SNP proxies across the whole genome (chr1-chrY; hg19) and for the CEU population from the 1k genome project. Is there a way to customise the "region" variable for this?
I am quite new to coding and R so I do apologise if this is an obvious question!
Thank you.
Randa

@slowkow
Copy link
Author

slowkow commented May 30, 2018

You might consider tomahawk.

@RandaAli1
Copy link

Hi Slowkow,

I don't want to compute LD, I have a list of SNP rs numbers, and I would like to find proxy SNPs (SNPs in LD r2>0.8) for each rs number using information from the CEU population. I tried to use rsnap package, however, it stoped working as it links to SNAP proxy website but the website isn't working at the moment.

Do you know of another R package I could use?

@slowkow
Copy link
Author

slowkow commented May 30, 2018

Let's consider a SNP x. What would it take to find all genome-wide proxies with r2 > 0.8?

We would need to compute the r2 between our chosen SNP x and every other SNP in the genome. If there are 20 million SNPs in the genome, then we need to compute 20 million r2 values and filter for the subset of SNPs that have r2 > 0.8.

The fastest way to compute these values is with the tomahawk software.

Since you do not want to compute these values, you might consider searching for a table that someone else already created and shared publicly. I am not aware of a publicly available LD table with genome-wide values for each SNP, but I'd like to make one when I have some time.

If you're interested to find additional R packages for genetics, this is a good reference:

https://CRAN.R-project.org/view=Genetics

Also check out Bioconductor.

@RandaAli1
Copy link

Hi Slowkow,

Thank you for explaning this to me, I didn't think of it that way! I really appreciate your help.

Regards,

Randa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment