binGenome {h5vc} | R Documentation

## Function for binning a genome.

### Description

Function for generating a `GRanges` representation of a binning of the genome given in the `reference` object.

### Usage

    binGenome(reference, binsize = 1e+06, chroms = seqnames(reference))

### Arguments

`reference` | A `BSgenome` object.
`binsize` | Size of bins along the genome.
`chroms` | Which chromosomes to use, defaults to all chromosome described as `seqnames` of the `reference` object.

### Details

This function creates a `GRanges` object that represents bins of size `binsize` along the genome represented by the `reference` object.

### Value

A `GRanges` object that represents bins of size `binsize` along the genome represented by the `reference` object, includes special handling of chromosomes shorter than `binsize` and the last bin of each chromosome.

### Author(s)

Paul Theodor Pyl

### See Also

`defineBlocks`

### Examples

    library(BSgenome.Hsapiens.NCBI.GRCh38)
    bins <- binGenome(Hsapiens, binsize = 100e6, chroms = c("1","2","3","X","MT"))
    bins

[Package h5vc version 2.18.0 Index]