addOffset: Estimate background reads

View source: R/qsea.createSet.R

addOffsetR Documentation

Estimate background reads

Description

This function sets the background reads offset parameters for the qseaSet object, either by estimating offset reads, or by setting user provided values.

Usage

addOffset(qs,enrichmentPattern , maxPatternDensity=0.01,offset)

Arguments

qs

the qseaSet object

enrichmentPattern

name of the enrichment pattern, as specified in addPatternDensity

maxPatternDensity

Maximum pattern density, at which the window is treated as pattern free.

offset

This parameter alternatively allows to specify the amount of background reads for each sample manually. In this case, please provide average background reads for CNV free windows in rpkm scale.

Value

The function returns the qseaSet object, extended by the estimated amount of background reads for all samples

Author(s)

Mathias Lienhard

See Also

addPatternDensity, getOffset

Examples

#simulate data with varing background fractions
qs=getExampleQseaSet(expSamplingDepth=5e4, repl=5,bgfraction=seq(0,.8,.2))
#estimate the background in simulated data
addOffset(qs, "CpG", maxPatternDensity=0.7)
#return the background on different scales
getOffset(qs, scale="fraction") #estimated fraction of total reads
getOffset(qs, scale="rpw") #average background reads per CNV free window


MatthiasLienhard/qsea documentation built on March 22, 2023, 1:15 p.m.