ssdCoverage: Standardized SD of the genomic coverage

Description Usage Arguments Details Value Methods Examples

Description

Compute variability of the genomic coverage, measured as standardized SD per thousand sequences (see details). For instance, this can measure how pronounced are the peaks in a ChIP-Seq experiments, which can serve as a quality control to detect inefficient immuno-precipitation.

Usage

1
ssdCoverage(x, mc.cores=1)

Arguments

x

Object with ranges indicating the start and end of each read. Currently, x can be of class list, RangedData and IRangesList.

mc.cores

Set mc.cores to a value greater than 1 to perform computations in parallel, using package mclapply.

Details

ssdCoverage first computes the coverage for each sample and computes the standard deviation (SD) of the coverage. However, SD is not an appropriate measure of coverage unevenness, as its expected value is proportional to sqrt(n), where n is the number of reads (this can be seen with simple algebra).

ssdCoverage therefore reports 1000*SD/sqrt(n), which can be interpreted as the standardized SD per thousand sequences.

Value

Numeric vector with coefficients of variation.

Methods

signature(x = "IRangesList")

A single coefficient of variation is returned, as a weighted average of the coefficients of variation for each chromosome (weighted according to the chromosome length).

signature(x = "RangedData")

The method for IRangesList is used on ranges(x).

signature(x = "list")

A vector with coefficients of variation for each element in x are returned, by repeatedly calling the method for RangedData objects. Use mc.cores to speed up computations with mclapply, but be careful as this requires more memory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
set.seed(1)
#Simulate IP data
peak1 <- round(rnorm(500,100,10))
peak1 <- RangedData(IRanges(peak1,peak1+38),space='chr1')
peak2 <- round(rnorm(500,200,10))
peak2 <- RangedData(IRanges(peak2,peak2+38),space='chr1')
ip <- rbind(peak1,peak2)

#Generate uniform background
bg <- runif(1000,1,300)
bg <- RangedData(IRanges(bg,bg+38),space='chr1')

rdl <- list(ip,bg)
ssdCoverage(rdl)
giniCoverage(rdl)

htSeqTools documentation built on Nov. 17, 2017, 9:10 a.m.