## 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_dev"
#
# # a) provide the genomic regions
# ## load ImmunoBase
# ImmunoBase <- xRDataLoader(RData.customised='ImmunoBase',
# RData.location=RData.location)
# ## get lead SNPs reported in AS GWAS and their significance info (p-values)
# gr <- ImmunoBase$AS$variant
# df <- as.data.frame(gr, row.names=NULL)
# chr <- df$seqnames
# start <- df$start
# end <- df$end
# data <- paste(chr,':',start,'-',end, sep='')
#
# # b) define nearby genes taking into acount distance weight
# # without gene scoring
# df_nGenes <- xGR2nGenes(data=data, format="chr:start-end",
# distance.max=10000, decay.kernel="slow", decay.exponent=2,
# RData.location=RData.location)
# # with their scores
# df_nGenes <- xGR2nGenes(data=data, format="chr:start-end",
# distance.max=10000, decay.kernel="slow", decay.exponent=2, scoring=T,
# scoring.scheme="max", RData.location=RData.location)
#
# # c) define nearby genes without taking into acount distance weight
# # without gene scoring
# df_nGenes <- xGR2nGenes(data=data, format="chr:start-end",
# distance.max=10000, decay.kernel="constant",
# RData.location=RData.location)
# # with their scores
# df_nGenes <- xGR2nGenes(data=data, format="chr:start-end",
# distance.max=10000, decay.kernel="constant", scoring=T,
# scoring.scheme="max", RData.location=RData.location)
# ## End(Not run)
Run the code above in your browser using DataLab