track_variant: Create a VariantTrack for a custom JBrowse 2 view

View source: R/variant.R

track_variantR Documentation

Create a VariantTrack for a custom JBrowse 2 view

Description

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

Usage

track_variant(track_data, assembly)

Arguments

track_data

the URL to the VCF file

assembly

the config string generated by assembly

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/

Value

a character vector of stringified VariantTrack JSON configuration

Examples

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

track_variant("variants.vcf", assembly)

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