Learn R Programming

htSeqTools (version 1.18.0)

ssdCoverage: Standardized SD of the genomic coverage

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

ssdCoverage(x, mc.cores=1)

Arguments

x
Object with ranges indicating the start and end of each read. Currently, x can be of class RangedDataList, RangedData and IRangesList.
mc.cores
Set mc.cores to a value greater than 1 to perform computations in parallel, using package mclapply.

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 = "RangedDataList")
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.

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.

Examples

Run this code
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 <- RangedDataList(ip,bg)
ssdCoverage(rdl)
giniCoverage(rdl)

Run the code above in your browser using DataLab