Learn R Programming

Repitools (version 1.18.0)

genomeBlocks: Creates bins across a genome.

Description

Creates a compact GRanges representation of bins across specified chromosomes of a given genome.

Usage

"genomeBlocks"(genome, chrs = names(genome), width = NULL, spacing = width) "genomeBlocks"(genome, chrs = seqnames(genome), width = NULL, spacing = width)

Arguments

genome
Either a BSgenome object, or a named vector of integers (names being choromosome names, integers being the chromosome lengths), to get the chromosome lengths from.
chrs
A vector containing which chromosomes to create bins across. May either be numeric indicies or chromosome names. Default is all chromosomes given by genome.
width
The width in base pairs of each bin.
spacing
The space between the centres of each adjacent bin. By default, is equal to the spacing parameter, which gives non-overlapping bins. Values larger than spacing will give overlapping bins, and values smaller than spacing will give gaps between each bin.

Value

GRanges object, compatible with direct usage in annotationBlocksCounts

See Also

annotationBlocksCounts

Examples

Run this code
  chr.lengths <- c(800, 200, 200)
  names(chr.lengths) <- c("chr1", "chr2", "chr3")
  genomeBlocks(chr.lengths, width = 200)

Run the code above in your browser using DataLab