Learn R Programming

htSeqTools (version 1.18.0)

coverageDiff: Compute the difference in coverage between two objects

Description

Computes coverage of sample1 minus coverage of sample2, taking into account that the chromosomes in sample1 and sample2 are not necessarily the same.

Usage

coverageDiff(sample1, sample2, chrLength)

Arguments

sample1
Object with reads from sample 1. Typically, a RangedData object.
sample2
Object with reads from sample 2. Typically, a RangedData object.
chrLength
Named vector with chromosome lengths. This can be obtained from the Bioconductor annotation packages, e.g. BSgenome.Dmelanogaster.UCSC.dm3 for drosophila melanogaster, etc.

Value

SimpleRleList with differences in coverage.

Details

Computation is restricted to chromosomes in names(chrLength).

Examples

Run this code
sample1 <- RangedData(IRanges(1:10,11:20),space='chr1')
sample2 <- RangedData(IRanges(1:10,11:20),space=rep(c('chr1','chr2'),each=5))
chrLength <- c(50,25); names(chrLength) <- c('chr1','chr2')
coverageDiff(sample1,sample2,chrLength)

Run the code above in your browser using DataLab