gr.rand: Generate random 'GRanges' on genome

View source: R/gUtils.R

gr.randR Documentation

Generate random GRanges on genome

Description

Randomly generates non-overlapping GRanges with supplied widths on supplied genome. Seed can be supplied with set.seed

Usage

gr.rand(w, genome)

Arguments

w

vector of widths (length of w determines length of output)

genome

GRanges, GRangesList, or Seqinfo genome. Default is "hg19" from the BSGenome package.

Value

GRanges with random intervals on the specifed "chromosomes"

Note

This function is currently quite slow, needs optimization

Author(s)

Marcin Imielinski

Examples


Sys.setenv(DEFAULT_GENOME = "http://mskilab.com/gUtils/hg19/hg19.chrom.sizes")

## Generate 5 non-overlapping regions of width 10 on hg19
gr.rand(rep(10,5), si2gr(hg_seqlengths()))


mskilab/gUtils documentation built on June 6, 2023, 12:08 a.m.