View source: R/sample_random_regions.R
sampleRandomRegions | R Documentation |
Sample random regions from the mappable parts of the genome with a given fraction from CpG islands.
sampleRandomRegions(allowedRegions = NULL, N = 100L, regWidth = 200L)
allowedRegions |
An unstranded GRanges object of the "allowed" of the genome, usually the mappable regions. |
N |
Number of regions to sample. |
regWidth |
Region width. |
In order to make the results deterministic, set the random
number seed before calling sampleRandomRegions
using
set.seed
.
A GRanges object with randomly sampled mappable regions of width
regWidth
with fractionCGI
coming from CpG islands.
regs <- GenomicRanges::GRanges(
seqnames = rep(c("chr1", "chr2"), each = 2),
ranges = IRanges::IRanges(start = 1:4, end = 5:8))
set.seed(123)
sampleRandomRegions(regs, N = 2, regWidth = 3L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.