R/json.R

Defines functions json_config

Documented in json_config

#' Read in a JBrowse 2 JSON configuration file
#'
#' Reads in a JSON file with values for configuring
#' your browser. Looks for assembly, tracks, defaultSession,
#' and theme. Only assembly is explicitly required for a
#' working browser.
#'
#' Note: this is the most advanced API. It offers full control
#' to do anything possible in JavaScript with an embedded JBrowse 2
#' React component, but comes with a steeper learning curve. For
#' more details on JBrowse 2 configuration, visit:
#' \url{https://jbrowse.org/jb2/docs/config_guide}
#'
#' An example JSON config is provided with this package
#'
#' @param file the file path or URL to a JBrowse 2 configuration
#'
#' @return a character vector of JSON configuration from a JBrowse 2
#'   configuration file
#'
#' @export
#'
#' @examples
#' \dontrun{json_config("./config.json")}
json_config <- function(file) {
  readr::read_file(file)
}

Try the JBrowseR package in your browser

Any scripts or data that you put into this service are public.

JBrowseR documentation built on July 8, 2021, 1:06 a.m.