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 https://jbrowse.org/jb2/docs/config_guide#configuring-reference-name-aliasing
a character vector of JBrowseR assembly configuration
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_web#adding-a-genome-assembly
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\" } } } }"