assembly: Create an assembly for a custom JBrowse view

View source: R/assembly.R

assemblyR Documentation

Create an assembly for a custom JBrowse view

Description

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.

Usage

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

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

Value

a character vector of JBrowseR assembly configuration

Examples

assembly("https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz", bgzip = TRUE)

JBrowseR documentation built on June 8, 2023, 6:41 a.m.