sampleGRanges.GRanges: A function to sample GRanges within GRanges

View source: R/utils.R

sampleGRanges.GRangesR Documentation

A function to sample GRanges within GRanges

Description

This function takes a given GRanges and returns another GRanges object. The new GRanges has the same number of ranges and the same chromosome, width and strand distributions than the original GRanges.

Usage

## S3 method for class 'GRanges'
sampleGRanges(
  x,
  n = NULL,
  width = NULL,
  exclude = FALSE,
  avoid_overlap = FALSE
)

Arguments

x

GRanges object

n

Integer, number of sampled GRanges

width

Integer, width of sampled GRanges

exclude

Boolean, should the original GRanges be excluded?

avoid_overlap

Boolean, should the sampled GRanges not be overlapping?

Value

A GRanges object of length n

Examples

data(ce11_proms)
sampleGRanges(ce11_proms, 100)

js2264/VplotR documentation built on Jan. 4, 2024, 7:49 p.m.