rescale() rescales IRanges, GRanges, IRangesList and GRangesList by using minima and maxima derived from to and from.

rescale(x, to = 1L, from = 1L)

# S4 method for IRanges
rescale(x, to = 1L, from = 1L)

# S4 method for IRangesList
rescale(x, to = 1L, from = 1L)

# S4 method for GRanges
rescale(x, to = 1L, from = 1L)

# S4 method for GRangesList
rescale(x, to = 1L, from = 1L)

Arguments

x

a IRanges, GRanges, IRangesList and GRangesList object

to, from

an IRanges object, a character vector coercible to IRanges or a integer vector parallel to x or with length = 1L.

Value

an object of the same type and dimensions as x

See also

IRanges for details on character vectors coercible to IRanges.

Author

H. Pagès, F. Ernst

Examples

x <- IRanges("5-10")
# widen the ranges
rescale(x, 100, 10)
#> IRanges object with 1 range and 0 metadata columns:
#>           start       end     width
#>       <integer> <integer> <integer>
#>   [1]        41       100        60
# widen and shift
rescale(x, "31-60", "5-14")
#> IRanges object with 1 range and 0 metadata columns:
#>           start       end     width
#>       <integer> <integer> <integer>
#>   [1]        31        48        18