example_apps/basic_usage_with_text_index/app.R

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("JBrowseR Example"),
  JBrowseROutput("widgetOutput")
)

server <- function(input, output, session) {
  hg38 <- assembly(
    "https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz",
    bgzip = TRUE,
    aliases = c("GRCh38"),
    refname_aliases = "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt"
  )


  output$widgetOutput <- renderJBrowseR(JBrowseR(
    "View",
    location = "10:29,838,737..29,838,819",
    assembly = hg38,
    text_index = text_index(
      "https://jbrowse.org/genomes/GRCh38/trix/hg38.ix",
      "https://jbrowse.org/genomes/GRCh38/trix/hg38.ixx",
      "https://jbrowse.org/genomes/GRCh38/trix/meta.json",
      "hg38"
    )
  ))

}

shinyApp(ui, server)
GMOD/JBrowseR documentation built on March 16, 2024, 5:37 p.m.