reposition: move all ranges in a GRanges to randomly chosen chromosomes...

View source: R/reposition.R

repositionR Documentation

move all ranges in a GRanges to randomly chosen chromosomes with new starting positions

Description

move all ranges in a GRanges to randomly chosen chromosomes with new starting positions

Usage

reposition(gr, backoff = -20000)

Arguments

gr

a GRanges-class instance

backoff

an integer in bases to move a range whose end hangs over end of chromosome

Details

Purpose is to obtain a set of ranges with widths identical to gr, but randomly relocated over the genome

Value

A GRanges

Note

It would be nice to be able to reposition to locations that are remote but that share certain characteristics like GC proportion ...

Currently if a chromosome is not represented in gr it is not a candidate for hosting a repositioned range.

Examples

set.seed(1234)
gr = GRanges(c("chr1", "chr4"), IRanges(c(50000, 100000), c(100000, 200000)))
reposition(gr)

genomicsclass/ph525x documentation built on July 16, 2022, 1:37 p.m.