Last data update: 2014.03.03

R: Report coverage.
coverageR Documentation

Report coverage.

Description

Report the coverage using bedtools coverage algorithm.

Usage

coverage(reads, annotation, sf = NULL, outfile = NULL)

Arguments

reads

a data.table of values or a character vector indicating the input file name. Note: the data must be in a BED-like format.

annotation

a object of type annotationsSet or a character vector indicating the input BED file name.

sf

a number indicating the scaling factor. Each coverage value is multiplied by this factor before being reported. Useful for normalizing coverage by, e.g., reads per million (RPM).

outfile

a character vector indicating the output file name. If not provided, the result will be internalized in R.

Value

An object of type data.table with 8 columns, corresponding to:

  1. Chromosome

  2. Starting position

  3. Ending position

  4. Gene name

  5. Gene strand (+ or -)

  6. Positions. One based positions of the gene.

  7. Depth at each position of the gene.

Examples

data(annotations)
bam  <- system.file("extdata", "wt_rep1.bam", package = "yCrypticRNAs")
fragments <- bam_to_reads(bam, annotations)
coverage(fragments, annotations, sf = 0.069872847)

Results