granges_to_string: GRanges to string

View source: R/granges_to_string.R

granges_to_stringR Documentation

GRanges to string

Description

Convert a GRanges object to a concatenated string of coordinates (e.g. "chr4:70000-90000,chr10:200-150001"). This can be used for specifying which regions you want to query (e.g. when using tabix).

Usage

granges_to_string(
  gr,
  pos_sep = "-",
  chrom_sep = ":",
  ranges_sep = ",",
  verbose = TRUE
)

Arguments

gr

GRanges object.

pos_sep

Character to separate start/end genomic positions with.

chrom_sep

Character to separate chromosome name from start/end positions.

ranges_sep

Character to separate each genomic range with.

verbose

Print messages.

Value

A concatenated string of coordinates.

Examples

gr1 <- echotabix::construct_query(query_dat = echodata::BST1)
gr2 <- echotabix::construct_query(query_dat = echodata::LRRK2)
gr <- suppressWarnings(c(gr1, gr2))

string <- echotabix::granges_to_string(gr=gr)

RajLabMSSM/echotabix documentation built on Nov. 21, 2023, 8:02 a.m.