sampleGRanges: A function to sample GRanges from GRanges

Description Usage Arguments Value Examples

View source: R/utils.R

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

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

1
2

VplotR documentation built on Nov. 8, 2020, 7:50 p.m.