randomize_regions {annotatr} | R Documentation

## Randomize Regions

### Description

`randomize_regions` is a wrapper function for `regioneR::randomizeRegions()` that simplifies the creation of randomized regions for an input set of regions read with `read_regions()`. It relies on the `seqlengths` of `regions` in order to build the appropriate `genome` object for `regioneR::randomizeRegions()`.

### Usage

    randomize_regions(
      regions,
      allow.overlaps = TRUE,
      per.chromosome = TRUE,
      quiet = FALSE
    )

### Arguments

`regions` | A `GRanges` object from `read_regions`.
`allow.overlaps` | A logical stating whether random regions can overlap input regions (TRUE) or not (FALSE). Default TRUE.
`per.chromosome` | A logical stating whether the random regions should remain on the same chromosome (TRUE) or not (FALSE). Default TRUE.
`quiet` | Print progress messages (FALSE) or not (TRUE).

### Details

NOTE: The data associated with the input `regions` are not passed on to the random regions.

### Value

A `GRanges` object of randomized regions based on `regions` from `read_regions()`. NOTE: Data associated with the original regions is not attached to the randomized regions.

### Examples

       # Create random region set based on ENCODE ChIP-seq data
       file = system.file('extdata', 'Gm12878_Stat3_chr2.bed.gz', package = 'annotatr')
       r = read_regions(con = file, genome = 'hg19')

       random_r = randomize_regions(regions = r)

[Package annotatr version 1.20.0 Index]