positionSequence {EpiTxDb} | R Documentation

## Generate integer sequences from position information of `Ranges`

### Description

`positionSequence` generates sequences of integer values along the range information of `x`. This can be used for navigating specific positions on a range information.

### Usage

    positionSequence(x, order = FALSE, decreasing = FALSE)

    ## S4 method for signature 'Ranges'
    positionSequence(x, order = FALSE, decreasing = FALSE)

    ## S4 method for signature 'RangesList'
    positionSequence(x, order = FALSE, decreasing = FALSE)

    ## S4 method for signature 'Ranges'
    as.integer(x)

### Arguments

`x` | a `Ranges` object, like a `GRanges` or `IRanges`, or a `RangesList` object, like a `GRangesList` or `IRangesList`
`order` | `TRUE` or `FALSE`: Should the position be ordered? (default: `order = FALSE`)
`decreasing` | `TRUE` or `FALSE`: If `order = TRUE` Should the position be ordered in a decreasing order? (default: `order = FALSE`)

### Value

a `integer` vector if x is a `GRanges` object and a `IntegerList` if x is a `GRangesList`

### Examples

    library(GenomicRanges)
    # Returns an integer vector
    gr <- GRanges("chr1:1-5:+")
    positionSequence(gr)
    gr2 <- GRanges("chr1:1-5:-")
    positionSequence(gr)
    # returns an IntegerList
    grl <- GRangesList("1" = gr,"2" = gr,"3" = gr2) # must be named
    positionSequence(grl)

[Package EpiTxDb version 1.4.0 Index]