gintervals.from_strings: Creates 1D intervals from coordinate strings

View source: R/intervals-core.R

gintervals.from_stringsR Documentation

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)

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.

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.

See Also

gintervals, gintervals.2d

Examples



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


misha documentation built on Aug. 24, 2026, 5:14 p.m.