# NOT RUN {
# Load the library
library(XGR)
# }
# NOT RUN {
RData.location <- "http://galahad.well.ox.ac.uk/bigdata"
# }
# NOT RUN {
## given a query gene
tks <- xGRtrack(gene.query='TNF', nearby=10,
gene.model="UCSC_knownGene_model",
GR.score=c("RecombinationRate","phastCons100way"),
RData.location=RData.location)
tks
## given a query genomic region
tks <- xGRtrack(cse.query='chr6:31497996-31584798',
gene.model="UCSC_knownGene_model",
GR.score=c("RecombinationRate","phastCons100way"),
RData.location=RData.location)
### GWAS catalog
GWAScatalog <- xRDataLoader('GWAScatalog',
RData.location=RData.location)
gwas <- xGR(GWAScatalog$cse_hg19, format="chr:start-end")
ind <- match(names(gwas), GWAScatalog$cse_hg19)
gwas$pvalue <- -log10(GWAScatalog$pvalue[ind])
tks <- xGRtrack(gene.query='TNF', nearby=10,
gene.model="UCSC_knownGene_model", GR.score="RecombinationRate",
GR.score.customised=gwas, RData.location=RData.location)
tks
##########################
## Advanced use: customised GR.score
##########################
gene.model <- xRDataLoader("UCSC_knownGene_model",
RData.location=RData.location)
### LDblock_GR
gr <- xRDataLoader("LDblock_GR", RData.location=RData.location)
maf <- gr[,'maf']
distance <- gr[,'distance']
cadd <- gr[,'cadd']
### GR.score.customised as a list of GR objects
GR.score.customised <- list(maf=maf, distance=distance, cadd=cadd)
tks <- xGRtrack(gene.query='TNF', window=1e0, gene.model=gene.model,
GR.score=NA, GR.score.customised=GR.score.customised,
type.customised='point', RData.location=RData.location)
tks
### the built-in provided as the customised
customised <-
c("RecombinationRate","phastCons100way","phyloP100way","GERP","dbSNP_GWAS")
GR.score.customised <- lapply(customised, function(x) xRDataLoader(x,
RData.location=RData.location))
tks <- xGRtrack(gene.query='TNF', nearby=10, gene.model=gene.model,
GR.score=NA, GR.score.customised=GR.score.customised,
type.customised='line', RData.location=RData.location)
tks
# }
Run the code above in your browser using DataLab