JBrowseR

July 11, 2026 · View on GitHub

R-CMD-check CRAN
status Open In
Colab

JBrowseR provides an R interface to the JBrowse 2 genome browser. It renders the interactive, GPU-accelerated JBrowse 2 linear genome view as an htmlwidget, so you can embed a full genome browser in an R Markdown document, a Shiny app, or straight from the R console.

The API is declarative: you describe the browser with plain values, and helper constructors build the config. There are no JSON strings to assemble and nothing imperative to wire up.

library(JBrowseR)

# an entire human genome browser in one line — assembly, reference name
# aliases, cytobands, and gene-name search all included
JBrowseR("hg38", location = "BRCA1")

Installation

Released version from CRAN:

install.packages("JBrowseR")

Development version from GitHub:

# install.packages("remotes")
remotes::install_github("GMOD/JBrowseR")

Quick tour

Point at a hub genome by name and add tracks by URL — the track type and its index files are inferred automatically.

JBrowseR(
  "hg38",
  tracks = tracks(
    track(
      "https://jbrowse.org/genomes/GRCh38/alignments/NA12878/NA12878.alt_bwamem_GRCh38DH.20150826.CEU.exome.cram",
      name = "NA12878 Exome"
    )
  ),
  location = "17:43,044,295..43,048,000"
)

View results you computed in R directly on the genome — no files, no web server:

peaks <- data.frame(
  chrom = "17",
  start = seq(43000000, 43120000, by = 12000),
  end   = seq(43000000, 43120000, by = 12000) + 4000,
  name  = paste0("peak", 1:11),
  score = round(runif(11, 5, 100))
)

JBrowseR(
  "hg38",
  tracks = list(track_data_frame(peaks, "R_peaks")),
  location = "17:43,000,000..43,125,000"
)

Getting started

See the vignettes:

Citation

If you use JBrowseR in your research, please cite:

Hershberg et al., 2021. JBrowseR: An R Interface to the JBrowse 2 Genome Browser

@article{hershberg2021jbrowser,
  title={JBrowseR: An R Interface to the JBrowse 2 Genome Browser},
  author={Hershberg, Elliot A and Stevens, Garrett and Diesh, Colin and Xie, Peter and De Jesus Martinez, Teresa and Buels, Robert and Stein, Lincoln and Holmes, Ian},
  journal={Bioinformatics}
}

For developers

The R package ships a prebuilt JavaScript bundle in inst/htmlwidgets/. To rebuild it against a local checkout of jbrowse-components (expected as a sibling directory), install pnpm and run:

git clone https://github.com/GMOD/JBrowseR
cd JBrowseR
pnpm install
pnpm build       # writes inst/htmlwidgets/JBrowseR.js and .css
R -e 'devtools::install()'