Creates the necessary configuration string for an indexed VCF file so that it can be used in a JBrowse custom linear genome view.

track_variant(track_data, assembly)

Arguments

track_data

the URL to the VCF file

assembly

the config string generated by assembly

Value

a character vector of stringified VariantTrack JSON configuration

Details

It is important to note that while only the VCF file is passed as an argument, tracks_variant assumes that a VCF index of the same name is located with the file

For example:

track_alignments("data/variants.vcf")

Assumes that data/variants.vcf.tbi also exists.

This is a JBrowse 2 convention, and the default naming output of tabix

For more information on creating an index with tabix, visit https://www.htslib.org/

Examples

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

track_variant("variants.vcf", assembly)
#> [1] "{ \"type\": \"VariantTrack\", \"name\": \"variants\", \"assemblyNames\": [\"hg19\"], \"trackId\": \"hg19_variants\", \"adapter\": { \"type\": \"VcfTabixAdapter\", \"vcfGzLocation\": { \"uri\": \"variants.vcf\" }, \"index\": { \"location\": { \"uri\": \"variants.vcf.tbi\"  } }}}"