Expand a range with multiplicative and additive constants
S4ExpandRange(limits, expand = expansion()) # S4 method for `NULL` S4ExpandRange(limits, expand = expansion()) # S4 method for numeric S4ExpandRange(limits, expand = expansion()) # S4 method for Ranges S4ExpandRange(limits, expand = expansion())
limits | An object indicating a range |
---|---|
expand | A |
An object indicating a range
The expand
argument consist of 4 constants that code for the
following:
A multiplicative constant relative to the width of the limits
argument to subtract from the start of the limits.
An additive constant to subtract from the start of the limits.
A multiplicative constant relative to the width of the limits
argument to add to the end of the limits.
An additive constant to add to the end of the limits.
Integer-based classes such as IRanges
and GRanges
are rounded
to the nearest integer.
#> [1] 4 26#> IRanges object with 1 range and 0 metadata columns: #> start end width #> <integer> <integer> <integer> #> [1] 4 26 23# GenomicRanges require(GenomicRanges) S4ExpandRange(GenomicRanges::GRanges(c("chr1", "chr2"), c("10-20", "20-30")), expansion(0.5, 1))#> GRanges object with 2 ranges and 0 metadata columns: #> seqnames ranges strand #> <Rle> <IRanges> <Rle> #> [1] chr1 4-26 * #> [2] chr2 14-36 * #> ------- #> seqinfo: 2 sequences from an unspecified genome; no seqlengths