bindDens2readDens {ChIPsim}R Documentation

Convert a feature density into a read density

Description

Given a feature density this function produces two read densities, one for each strand.

Usage

bindDens2readDens(bindDens, fragment, nfrag = 1e+05, bind = 147, 
	minLength = 150, maxLength = 180, ...)

Arguments

bindDens

Numeric vector with the feature density for one chromosome.

fragment

Function giving the fragment length distribution.

nfrag

Number of fragments that should be simulated to generate the read distribution.

bind

Length of binding site.

minLength

Minimum fragment length.

maxLength

Maximum fragment length.

...

Further arguments to fragment.

Value

A two column matrix. The first column contains the read density for the forward strand, the second column the read density for the reverse strand.

Author(s)

Peter Humburg

See Also

feat2dens, sampleReads

Examples

set.seed(1)
## generate a (relatively short) sequence of nucleosome features
features <- placeFeatures(start=200, length=1e5)

## calculate feature density
featureDens <- feat2dens(features, length=1e5)

## convert to read density
readDens <- bindDens2readDens(featureDens, fragDens, meanLength=160) 

[Package ChIPsim version 1.46.0 Index]