convertUtils {Rariant} | R Documentation

## 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

    library(GenomicRanges)

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

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

    identical(gr, gr2)

[Package Rariant version 1.16.0 Index]