Description Usage Arguments Value See Also Examples

View source: R/ranges-arithmetic-stretch.R

By default, `stretch(x)`

will anchor by the center of a Ranges
object. This means that half of the value of `extend`

will be added to
the end of the range and the remaining half subtracted from the start of
the Range. The other anchors will leave the start/end fixed and stretch
the end/start respectively.

1 | ```
stretch(x, extend)
``` |

`x` |
a Ranges object, to fix by either the start, end or center
of an interval use |

`extend` |
the amount to alter the width of a Ranges object by. Either an integer vector of length 1 or an integer vector the same length as x. |

a Ranges object with modified start or end (or both) coordinates

1 2 3 4 5 6 7 8 9 10 | ```
rng <- as_iranges(data.frame(start=c(2:-1, 13:15), width=c(0:3, 2:0)))
rng2 <- stretch(anchor_center(rng), 10)
stretch(anchor_start(rng2), 10)
stretch(anchor_end(rng2), 10)
grng <- as_granges(data.frame(seqnames = "chr1",
strand = c("+", "-", "-", "+", "+", "-", "+"),
start=c(2:-1, 13:15),
width=c(0:3, 2:0)))
stretch(anchor_3p(grng), 10)
stretch(anchor_5p(grng), 10)
``` |

plyranges documentation built on Nov. 1, 2018, 3:58 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.