Every JBrowseR function that accepts data takes a URL. Genomics files are far too large to inline as Shiny static resources, and the browser fetches only the slices it needs directly from the host — so the data lives at a URL and JBrowse reads from it in place.
For human and model organisms you often need no hosting at all: pass
a hub name straight to JBrowseR() and the assembly,
reference-name aliases, cytobands, and gene-name search all load from
the CORS-enabled hub at jbrowse.org.
For your own data you host the files yourself. On the JBrowse 2 team we use Amazon S3 — each object has its own URL — but any web server works, e.g. Apache or a cloud bucket.
Whichever host you pick, it must satisfy two requirements:
Range requests, so the browser
can use byte
serving to fetch only the chunks needed to render the current view
instead of the whole file.Here is an example CORS configuration for an S3 bucket:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [
"Accept-Ranges",
"Content-Range",
"Content-Encoding",
"Content-Length"
],
"MaxAgeSeconds": 3000
}
]If you use S3 and plan to deploy with shinyapps.io, put the bucket in Amazon’s US-East region — shinyapps.io is hosted entirely there, so co-locating the data gives faster performance.
To view files from your own machine, serve the directory with any
static server that supports range requests and CORS, then point
assembly() / track() at the resulting
http://localhost:... URLs. For example, with http-server: