Created
December 15, 2017 10:34
-
-
Save chrissyhroberts/7384ea611ea2ba0713f27a18247771b9 to your computer and use it in GitHub Desktop.
find overlap between some SNP locations and a list of gene locations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#find overlap between some SNP locations and a list of gene locations | |
#test SNPs | |
#df = snps | |
#chr start stop | |
#1 1232 1232 | |
#2 12444 12444 | |
#gene positions | |
#df =genes | |
#chr start stop | |
#1 100 2000 | |
#2 14000 130000 | |
#define fuzzy flank size | |
flank.region <- 20000 | |
inner_join(genes, snps, by="chr") %>% filter(start.y >= start.x-flank.region & stop.y <= stop.x+flank.region) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment