Description Usage Arguments Details Author(s) Examples
Provide a general browsing facility for trans-gQTL.
1 2 |
mae |
Instance of |
felname |
character naming the element of |
gelname |
character naming the element of |
tiling |
a tiling of the genome used to partition large genotype resource |
tsbra |
an instance of the output of |
annovec |
a named character vector mapping between identifiers used to identify features in
|
band.init |
an initial tile selection |
ermaset |
instance of |
gwascat |
instance of |
... |
not currently used |
starts a shiny app
VJ Carey <stvjc@channing.harvard.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | if (interactive()) {
oa = options()$example.ask
options(example.ask=FALSE)
#
# this example assumes you have a working internet connection
# it will collect genotype information from a S3 bucket
# where 1000 genomes VCF resides
#
# obtain infrastructure
#
# message("note: as of Dec 17 2016 this function will trigger transient errors... ignore them") # solved with req()
message("loading packages...")
packs = c("VariantAnnotation", "GenomicFiles", "ggvis", "plotly",
"Rsamtools", "GenomeInfoDb", "geuvPack", "shiny", "ggplot2",
"MultiAssayExperiment", "AnnotationHub", "ldblock", "erma")
suppressPackageStartupMessages({
r = sapply(packs, require, character.only=TRUE)
})
stopifnot(all(r))
# use S3 bucket to get genotypes, create VcfStack wrapper
#
message("create VcfStack...")
tf17 = ldblock::s3_1kg("17")
vcst = VcfStack(c("17"=path(tf17)), index=FALSE)
seqlevelsStyle(vcst) = "NCBI"
# obtain expression data for GEUVADIS samples
#
message("obtain expression data...")
if (!exists("geuFPKM")) data(geuFPKM)
data(gen2sym)
seqlevelsStyle(geuFPKM) = "NCBI"
#
# bind to MAE
#
el = ExperimentList(list(geu=geuFPKM, vcf=vcst))
message("create MultiAssayExperiment...")
suppressWarnings({ # samples don't line up between expression and genotype, we know this
mae = MultiAssayExperiment(el, colData=colData(el[[1]]))
})
#
# obtain and clean up cytoband representation
# cyto37n created as follows:
#ah = AnnotationHub()
#cyto37 = ah[["AH5012"]]
#seqlevelsStyle(cyto37) = "NCBI"
#cyto37 = as(cyto37, "GRanges")
#sn = as.character(seqnames(cyto37))
#mcols(cyto37)$name = paste0(sn, mcols(cyto37)$name)
#names(cyto37) = mcols(cyto37)$name
#seqlengths(cyto37)["MT"] = 16569
message("obtain cytoband index...")
data(cyto37n)
data(tbgaOrmdl3) # saved output of tsByRankAccum, giving association scores
#
message("obtain gwas catalog...")
library(gwascat)
data(ebicat37)
# obtain chromatin state calls from erma
message("obtain chromatin state calls...")
erset = makeErmaSet()
#
# target and invoke browser
#
okba = c("17q12", "17q21.1", "17q21.2")
on.exit(options(example.ask=oa))
print(tqbrowser( mae, "geu", "vcf", cyto37n[okba],
tbgaOrmdl3, gen2sym, band.init="17q12", ermaset=erset, gwascat=ebicat37 ))
} # end interactivity check
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.