# NOT RUN {
# Load the XGR package and specify the location of built-in data
library(XGR)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata"
# }
# NOT RUN {
# a) provide the seed SNPs with the significance info
## load ImmunoBase
data(ImmunoBase)
## get lead SNPs reported in AS GWAS and their significance info (p-values)
gr <- ImmunoBase$AS$variant
data <- GenomicRanges::mcols(gr)[,c('Variant','Pvalue')]
# b) get LD block (EUR population)
bLD <- xLDblock(data, include.LD="EUR", LD.r2=0.8,
RData.location=RData.location)
# c) generate random samples as a GRL object
grl <- xLDsampling(bLD, GR.SNP="dbSNP_GWAS", num.samples=2000,
RData.location=RData.location)
##########################
## Advanced use: customised GR.SNP
##########################
GR.SNP <- xRDataLoader("dbSNP_GWAS", RData.location=RData.location)
grl <- xLDsampling(bLD, GR.SNP=GR.SNP, respect="both", restrict.chr=T,
preserve="exact", RData.location=RData.location)
# }
Run the code above in your browser using DataLab