Skip to content

Commit

Permalink
Using plugins example
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Oct 5, 2023
1 parent 17510a7 commit 24a0bd2
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
25 changes: 25 additions & 0 deletions example_apps/using_plugins/app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
library(shiny)
library(JBrowseR)
library(bslib)

ui <- fluidPage(
# Overriding the default bootstrap theme is needed to get proper font size
theme = bs_theme(version = 5),
titlePanel("Using Plugins Example"),
JBrowseROutput("browserOutput")
)


server <- function(input, output, session) {
# using JBrowseR helper function to parse the config
config <- json_config("./config.json")

output$browserOutput <- renderJBrowseR(
JBrowseR("JsonView",
config = config,
location = "1:20,000,000-20,500,000"
)
)
}

shinyApp(ui, server)
83 changes: 83 additions & 0 deletions example_apps/using_plugins/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"assembly": {
"name": "hg19",
"aliases": ["GRCh37"],
"sequence": {
"type": "ReferenceSequenceTrack",
"trackId": "Pd8Wh30ei9R",
"adapter": {
"type": "BgzipFastaAdapter",
"fastaLocation": {
"uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz",
"locationType": "UriLocation"
},
"faiLocation": {
"uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.fai",
"locationType": "UriLocation"
},
"gziLocation": {
"uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.gzi",
"locationType": "UriLocation"
}
}
},
"refNameAliases": {
"adapter": {
"type": "RefNameAliasAdapter",
"location": {
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/hg19_aliases.txt",
"locationType": "UriLocation"
}
}
},
"cytobands": {
"adapter": {
"type": "CytobandAdapter",
"cytobandLocation": {
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/cytoBand.txt"
}
}
}
},
"tracks": [
{
"type": "FeatureTrack",
"trackId": "ncbi_gff_hg19",
"name": "NCBI RefSeq w/ subfeature details",
"formatDetails": {
"subfeatures": "jexl:{name:'<a href=https://google.com/?q='+feature.name+'>'+feature.name+'</a>'}"
},
"assemblyNames": ["hg19"],
"category": ["Annotation"],
"metadata": {
"source": "https://www.ncbi.nlm.nih.gov/genome/guide/human/",
"dateaccessed": "12/03/2020"
},
"adapter": {
"type": "Gff3TabixAdapter",
"gffGzLocation": {
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/ncbi_refseq/GRCh37_latest_genomic.sort.gff.gz",
"internetAccountId": "httpHeaders"
},
"index": {
"location": {
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/ncbi_refseq/GRCh37_latest_genomic.sort.gff.gz.tbi",
"internetAccountId": "httpHeaders"
}
}
}
}
],
"internetAccounts": [
{
"type": "ModifyHTTPHeadersInternetAccount",
"internetAccountId": "httpHeaders"
}
],
"plugins": [
{
"name": "ModifyHTTPHeaders",
"url": "https://s3.amazonaws.com/jbrowse.org/demos/jbrowse-plugin-modifyhttpheaders.umd.development.js"
}
]
}
18 changes: 18 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "es2022",
"lib": ["es2022", "DOM", "DOM.Iterable"],
"module": "esnext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noImplicitAny": true,
"jsx": "react",
"strict": true,
"noFallthroughCasesInSwitch": true
},
"include": ["srcjs"],
}

0 comments on commit 24a0bd2

Please sign in to comment.