resampleRegions {regioneR} | R Documentation

## Resample Regions

### Description

Function for sampling a region set from a univers of region sets.

### Usage

    resampleRegions(A, universe, per.chromosome=FALSE, ...)

### Arguments

`A` | a region set in any of the formats accepted by `toGRanges` (`GenomicRanges`, `data.frame`, etc...)
`universe` | a region set in any of the formats accepted by `toGRanges` (`GenomicRanges`, `data.frame`, etc...)
`per.chromosome` | boolean indicating if sample must be by chromosome.
`...` | further arguments to be passed to or from methods.

### Value

a `GenomicRanges` object. A sample from the `univers` with the same length as A.

### See Also

`toDataframe`, `toGRanges`, `randomizeRegions`, `createRandomRegions`

### Examples

    universe <- data.frame(chr=1, start=c(1,15,24,40,50), end=c(10,20,30,45,55))

    A <- data.frame(chr=1, start=c(2,12,28,35), end=c(5,25,33,43))

    resampleRegions(A, universe, per.chromosome=TRUE)

[Package regioneR version 1.26.1 Index]