Entering edit mode
6.6 years ago
jamespower
▴
100
Hi,
I have GWAS results with association of SNPs with a phenotype, and I am trying to find regions of 250kb around a GWAS hit that have at least 3 SNPs passing a certain threshold for p-values. What is the best strategy/package for this? Right now I was thinking of using GenomicRanges:
x = fread(f, header=T)
x = data.frame(x)
x=x[!is.na(x$p),]
sig = x[x$p < 5*10^-8,]
# Create a region of 100kb around these and count the overlaps with itself
wnd = 100000
hits_wnd = GRanges(seqnames=sig$Chr,IRanges(start=sig$bp - wnd,end = sig$bp + wnd))
sig_snps = GRanges(seqnames=sig$Chr,IRanges(start=sig$bp,end = sig$bp + 1))
hits <- findOverlaps(hits_wnd, sig_snps)