Creates the necessary configuration string for an indexed fasta or bgzip fasta so that it can be used as the assembly in a JBrowse custom linear genome view.

assembly(assembly_data, bgzip = FALSE, aliases = NULL, refname_aliases = NULL)

Arguments

assembly_data

the URL to your fasta file

bgzip

whether or not your fasta is bgzip compressed

aliases

a vector of strings of the aliases for the assembly

refname_aliases

the URL to a file containing reference name aliases. For more info see https://jbrowse.org/jb2/docs/config_guide#configuring-reference-name-aliasing

Value

a character vector of JBrowseR assembly configuration

Details

The string returned by assembly is stringified JSON. JBrowseR is an interface to JBrowse 2, which receives its configuration in JSON format. The stringified JSON returned by assembly is parsed into a JavaScript object in the browser, and is used to configure the genome browser.

It is important to note that while only the fasta file is passed as an argument, assembly assumes that a fasta index of the same name is located with the fasta file (as well as a gzi file in the case of a bgzip fasta).

For example:

assembly("data/hg38.fa")

Assumes that data/hg38.fa.fai also exists.

assembly("data/hg38.fa", bgzip = TRUE)

Assumes that data/hg38.fa.fai and data/hg38.fa.gzi both exist.

This is a JBrowse 2 convention, and the default naming output of samtools and bgzip.

For more information on creating these files, visit https://jbrowse.org/jb2/docs/quickstart_cli#adding-a-genome-assembly

Examples

assembly("https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz", bgzip = TRUE)
#> [1] "{ \"name\": \"hg19\", \"sequence\": { \"type\": \"ReferenceSequenceTrack\", \"trackId\": \"hg19-ReferenceSequenceTrack\", \"adapter\": { \"type\": \"BgzipFastaAdapter\", \"fastaLocation\": { \"uri\": \"https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz\" }, \"faiLocation\": { \"uri\": \"https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.fai\" }, \"gziLocation\": { \"uri\": \"https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.gzi\" } } } }"