Learn R Programming

Rariant (version 1.8.3)

convertUtils: Position converters

Description

Utility functions to convert between 'GRanges' and 'character' objects.

Usage

gr2pos(x, range = TRUE)

pos2gr(x)

Arguments

x
GRanges or character object.
range
Should the range instead of the start position be returned?

Value

  • A GRanges object or character object, with the positions.

Examples

Run this code
library(GenomicRanges)

gr = GRanges(1:2, IRanges(1:2, width = 1))

pos = gr2pos(gr)
gr2 = pos2gr(pos)

identical(gr, gr2)

Run the code above in your browser using DataLab