track_alignments: Create an AlignmentsTrack for a custom JBrowse 2 view

Description Usage Arguments Details Value Examples

View source: R/alignments.R

Description

Creates the necessary configuration string for an indexed BAM or CRAM alignment so that it can be used in a JBrowse custom linear genome view.

Usage

1

Arguments

track_data

the URL to the BAM/CRAM alignments

assembly

the config string generated by assembly

Details

It is important to note that while only the BAM/CRAM file is passed as an argument, tracks_alignment assumes that a BAM/CRAM index of the same name is located with the file

For example:

track_alignments("data/alignments.bam")

Assumes that data/alignments.bam.bai also exists.

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

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

Value

a character vector of stringified AlignmentTrack JSON configuration

Examples

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

track_alignments("alignments.bam", assembly)
track_alignments("alignments.cram", assembly)

JBrowseR documentation built on July 8, 2021, 1:06 a.m.