positionSequence: Generate integer sequences from position information of...

Description Usage Arguments Value Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
6
7
8
9
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)

EpiTxDb documentation built on March 26, 2021, 6 p.m.