randomize_regions: Randomize Regions

Description Usage Arguments Details Value Examples

View source: R/randomize.R

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

1
2
3
4
5
6
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

1
2
3
4
5
   # 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)

annotatr documentation built on Nov. 8, 2020, 8:16 p.m.