createBins {QDNAseq} | R Documentation

## Builds bin annotation data for a particular bin size

### Description

Builds bin annotation data for a particular bin size.

### Usage

    createBins(bsgenome, binSize, ignoreMitochondria=TRUE, excludeSeqnames=NULL,
      verbose=getOption("QDNAseq::verbose", TRUE))

### Arguments

`bsgenome` | A BSgenome package.
`binSize` | A `numeric` scalar specifying the width of the bins in units of kbp (1000 base pairs), e.g. `binSize=15` corresponds to 15 kbp bins.
`ignoreMitochondria` | Whether to ignore the mitochondria, defined as chromosomes named 'chrM', 'chrMT', 'M', or 'MT'.
`excludeSeqnames` | Character vector of seqnames which should be ignored.
`verbose` | If `TRUE`, verbose messages are produced.

### Value

Returns a `data.frame` with columns `chromosome, start, end, bases, and gc`, which correspond to the chromosome name, positions of the first and last base pair in the bin, the percentage of characterized nucleotides (A, C, G, or T, i.e. non-N), and GC content (percentage of C and G nucleotides of non-N nucleotides).

### Parallel processing

The future is used parallelize the following functions:

- `createBins()` - parallelizes binned GC content across chromosomes

- `calculateBlacklist()` - parallelizes overlap counts across bins)

### Author(s)

Ilari Scheinin

### See Also

`getBinAnnotations`().

### Examples

    ## Not run: # NOTE: These take a very long time to run.
    library(BSgenome.Hsapiens.UCSC.hg19)
    bins <- createBins(BSgenome.Hsapiens.UCSC.hg19, 15)
    bins$mappability <- calculateMappability(bins,
        bigWigFile='/path/to/wgEncodeCrgMapabilityAlign50mer.bigWig',
        bigWigAverageOverBed='/path/to/bigWigAverageOverBed')
    bins$blacklist <- calculateBlacklist(bins,
        bedFiles=c('/path/to/wgEncodeDacMapabilityConsensusExcludable.bed',
        '/path/to/wgEncodeDukeMapabilityRegionsExcludable.bed'))
    bins$residual <- iterateResiduals(readCountsG1K)

    ## End(Not run)

[Package QDNAseq version 1.26.0 Index]