addBackground: Add background for a simulated 4C-seq sample

Description Usage Arguments Value Author(s) Examples

Description

This helper function adds background noise to an empty 4C-seq sample. If the virtual fragment library of the 4C-seq sample does already include counts, those may be overwritten.

Usage

1
2
addBackground(simTable, vpStart, powerlawAlpha = 1.35, imRegionDist = 1000000, 
bgFragCov = 0.01, imFragCov = 0.8, maxFragBG = 1000, maxFragIM = 1500)

Arguments

simTable

virtual simulation fragment library (should be empty)

vpStart

position of the experiment's viewpoint

powerlawAlpha

alpha for powerlaw background distribution (default: 1.35)

imRegionDist

length of intermediate region between viewpoint and far-cis region

bgFragCov

coverage rate per fragment for background region fragments (typically low)

imFragCov

coverage rate per fragment for intermediate region fragments

maxFragBG

maximum signal strength / read number for background fragments

maxFragIM

maximum signal strength / read number for fragments in the intermediate region between viewpoint and pure background

Value

Data frame with background reads

Author(s)

Carolin Walter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
    if(interactive()) {
        simLibFile <- system.file("extdata", "simLib_short.csv", 
            package="Basic4CSim")
        # load virtual simulation fragment library
        simLib = read.csv(simLibFile, sep = "\t", header = TRUE)
        vpStart = 69999869
        # create empty simulation fragment count table
        simTable = data.frame(simLib[,1:3], "readsL" = 0, "readsR" = 0, 
            simLib[,c(5,9,10)])
        colnames(simTable) = c("chromosomeName", "start", "end", 
            "readsL", "readsR", "isNonBlind", "leftFragEndValid", "rightFragEndValid")
        # add actual background
        set.seed(42)
        simTable = addBackground(simTable, vpStart)
        head(simTable)
    }

walter-ca/Basic4CSim documentation built on May 28, 2019, 12:34 a.m.