assembly: Create an assembly for a custom JBrowse view

View source: R/assembly.R

assemblyR Documentation

Create an assembly for a custom JBrowse view


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)



the URL to your fasta file


whether or not your fasta is bgzip compressed


a vector of strings of the aliases for the assembly


the URL to a file containing reference name aliases. For more info see


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:


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


a character vector of JBrowseR assembly configuration


assembly("", bgzip = TRUE)

JBrowseR documentation built on July 20, 2022, 1:09 a.m.