ranges-shift: Shift all coordinates in a genomic interval left or right,...

Description Usage Arguments Details Value See Also Examples

Description

Shift all coordinates in a genomic interval left or right, upstream or downstream

Usage

1
2
3
4
5
6
7
shift_left(x, shift = 0L)

shift_right(x, shift = 0L)

shift_upstream(x, shift = 0L)

shift_downstream(x, shift = 0L)

Arguments

x

a Ranges object .

shift

the amount to move the genomic interval in the Ranges object by. Either a non-negative integer vector of length 1 or an integer vector the same length as x.

Details

Shifting left or right will ignore any strand information in the Ranges object, while shifting upstream/downstream will shift coordinates on the positive strand left/right and the negative strand right/left. By default, unstranded features are treated as positive. When using shift_upstream() or shift_downstream() when the shift argument is indexed by the strandedness of the input ranges.

Value

a Ranges object with start and end coordinates shifted.

See Also

IRanges::shift(), GenomicRanges::shift()

Examples

1
2
3
4
5
6
7
8
9
ir <- as_iranges(data.frame(start = 10:15, width = 5))
shift_left(ir, 5L)
shift_right(ir, 5L)
gr <- as_granges(data.frame(start = 10:15,
                            width = 5,
                            seqnames = "seq1",
                            strand = c("+", "+", "-", "-", "+", "*")))
shift_upstream(gr, 5L)
shift_downstream(gr, 5L)

plyranges documentation built on Nov. 8, 2020, 7:36 p.m.