bindDens2readDens: Convert a feature density into a read density

Description Usage Arguments Value Author(s) See Also Examples

View source: R/nucSim.R

Description

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

Usage

1
2
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

1
2
3
4
5
6
7
8
9
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) 

ChIPsim documentation built on Nov. 8, 2020, 8:09 p.m.