track_data_frame: Create a track from an R data frame for a custom JBrowse 2...

View source: R/data_frame.R

track_data_frameR Documentation

Create a track from an R data frame for a custom JBrowse 2 view

Description

Creates the necessary configuration string for an R data frame so that it can be viewed as a track in a JBrowse custom linear genome view.

Usage

track_data_frame(track_data, track_name, assembly)

Arguments

track_data

the data frame with track data. Must have cols: chrom, start, end, name. The column additional can optionally be include with more feature information. If a score column is present, it will be used and the track will be rendered to display quantitative features.

track_name

the name to use for the track

assembly

the config string generated by assembly

Value

a character vector of stringified track JSON configuration

Examples

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

df <- data.frame(
        chrom = c(1, 2),
        start = c(123, 456),
        end = c(789, 101112),
        name = c('feature1', 'feature2')
      )

track_data_frame(df, "my_features", assembly)

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