Learn R Programming

Tnseq (version 0.1.2)

BiasFactor: Calculate the bias factor induced by the genomic replication process for each insertion

Description

The whole genome is first divided into N consecutive regions (windows). The number of read counts is summed within each window and is modelled as a function of the window using the locally weighed scatterplot smoothing (LOESS) function. Finally, we calculate a fitted value for each insertion, and then normalize these fitted values to have the product of these values equal to one. The normalized values are the bias factors(one for each insertion).

Usage

BiasFactor(Location, Count, window=10000)

Arguments

Location
a numeric vector specifying insertion locations.
Count
a numeric vector of read counts over locations.
window
the number of regions to divide the whole genome.

Value

bias.factor
bias factor for each insertion.
yfit
the fitted count value for each insertion.
w
window id
yw
total read counts over windows.
ywfit
the fitted count value for each window.

Examples

Run this code

## Not run: ------------------------------------
# data(serratia)
# countData=serratia[,-c(1,2,3)]
# location=serratia$Loc
# 
# 
# # obtain bias factor for the first sample
# foo=BiasFactor(location, countData[,1],  window=10000)  
# 
# # obtain the adjusted counts after the bias correction
# countData.adj=countData[,1]/foo$bias.factor
# 
# 
## ---------------------------------------------

Run the code above in your browser using DataLab