randomizeFeature-methods: function that randomizes the genomic coordinates

Description Usage Arguments Value

Description

This function randomly distributes the coordinates of genomic features which is stored in a GRanges object. The randomization can be constrained by supplied arguments. The function is still in Beta mode - the regions can overlap excluded regions, and the randomized regions are not disjoint. Please take care that the excluded and included regions are not too strict when compared to the total width of the ranges.

Usage

1
2
3
4
5
6
7
8
randomizeFeature(feature, chrom.sizes = NULL, stranded = TRUE,
  keep.strand.prop = TRUE, keep.chrom = TRUE, exclude = NULL,
  include = NULL, seed = NULL, nrand = 1)

## S4 method for signature 'GRanges'
randomizeFeature(feature, chrom.sizes = NULL,
  stranded = TRUE, keep.strand.prop = TRUE, keep.chrom = TRUE,
  exclude = NULL, include = NULL, seed = NULL, nrand = 1)

Arguments

feature

a GRanges object to be randomized

chrom.sizes

sizes of chromosomes as a named vector (names are chromsomes names and elements of the vectors are lengths). , if not given sizes in GRanges object will be used if no sizes there the end of each chr will be the end last feature on each chr

stranded

if FALSE, all of the returned features will be strandless (will have "*" in the strand slot)

keep.strand.prop

If TRUE strands will have the same proportion as the features

keep.chrom

If TRUE, number of features and randomized features for a chromosome will match. Currently seeting this to FALSE is not supported.

exclude

A GRanges object where no randomized feature should overlap, can be gaps or unmappable regions in the genome as an example.

include

A GRanges object which defines the boundaries of randomized features. If not provided the whole genome is used, as defined using the chrom.sizes parameter.

seed

random number generator seed

nrand

number of randomizations (default:1)

Value

returns a GRanges object which is randomized version of the feature, along with a "set" column in the metadata which designates to which iteration of the randomization the range belong.


genomation documentation built on Nov. 8, 2020, 5:21 p.m.