intra-range-methods {GenomicRanges}R Documentation

Intra range transformations of a GenomicRanges object

Description

See ?`intra-range-methods` and ?`inter-range-methods` in the IRanges package for a quick introduction to intra range and inter range transformations.

This man page documents intra range transformations of a GenomicRanges object (i.e. of an object that belongs to the GenomicRanges class or one of its subclasses, this includes for example GRanges objects).

See ?`inter-range-methods` for inter range transformations of a GenomicRanges object.

Usage

## S4 method for signature 'GenomicRanges'
shift(x, shift=0L, use.names=TRUE)

## S4 method for signature 'GenomicRanges'
narrow(x, start=NA, end=NA, width=NA, use.names=TRUE)
## S4 method for signature 'GappedAlignments'
narrow(x, start=NA, end=NA, width=NA, use.names=TRUE)
## S4 method for signature 'GAlignmentsList'
narrow(x, start=NA, end=NA, width=NA, use.names=TRUE)

## S4 method for signature 'GenomicRanges'
flank(x, width, start=TRUE, both=FALSE,
        use.names=TRUE, ignore.strand=FALSE)

## S4 method for signature 'GenomicRanges'
promoters(x, upstream=2000, downstream=200, ...)

## S4 method for signature 'GenomicRanges'
resize(x, width, fix="start", use.names=TRUE,
        ignore.strand=FALSE)

## S4 method for signature 'GenomicRanges'
restrict(x, start=NA, end=NA, keep.all.ranges=FALSE,
        use.names=TRUE)

## S4 method for signature 'GenomicRanges'
trim(x, use.names=TRUE)

Arguments

x

A GenomicRanges object.

shift, use.names, start, end, width, both, fix, keep.all.ranges, upstream, downstream

See ?`intra-range-methods`.

ignore.strand

TRUE or FALSE. Whether the strand of the input ranges should be ignored or not. See details below.

...

Additional arguments to methods.

Details

Author(s)

P. Aboyoun and V. Obenchain <vobencha@fhcrc.org>

See Also

Examples

gr <- GRanges(
        seqnames=Rle(paste("chr", c(1, 2, 1, 3), sep=""), c(1, 3, 2, 4)),
        ranges=IRanges(1:10, width=10:1, names=letters[1:10]),
        strand=Rle(strand(c("-", "+", "*", "+", "-")), c(1, 2, 2, 3, 2)),
        score=1:10,
        GC=seq(1, 0, length=10)
      )
gr

shift(gr, 1)
narrow(gr[-10], start=2, end=-2)
flank(gr, 10)
resize(gr, 10)
restrict(gr, start=3, end=7)

gr <- GRanges("chr1", IRanges(rep(10, 3), width=6), c("+", "-", "*"))
promoters(gr, 2, 2)

[Package GenomicRanges version 1.12.1 Index]