Learn R Programming

misha (version 5.11.23)

gintervals.from_strings: Creates 1D intervals from coordinate strings

Description

Creates a set of 1D intervals by parsing UCSC-style coordinate strings.

Usage

gintervals.from_strings(regions = NULL)

Value

A data frame representing the intervals, sorted as by gintervals. A "strand" column is added only when at least one region specifies a strand.

Arguments

regions

a character vector of region strings. Accepted formats per element: "chrom", "chrom:start-end", "chrom:start..end", optionally followed by ":+" or ":-".

Details

Parses strings of the form "chrom:start-end" ("chrom:start..end" is also accepted) into a 1D intervals data frame. A chromosome-only string such as "chr1" expands to the full chromosome extent. An optional trailing strand suffix ":+" or ":-" adds a "strand" column.

Coordinates are zero-based and half-open, matching the convention used by gintervals.

See Also

gintervals, gintervals.2d

Examples

Run this code
# \dontshow{
options(gmax.processes = 2)
# }

gdb.init_examples()
gintervals.from_strings("chr1:1000-2000")
gintervals.from_strings(c("chr1:1000-2000:+", "chr2:50-60:-"))

Run the code above in your browser using DataLab