Description Usage Arguments Details Value Author(s) See Also Examples
Given a read density this function returns the starting positions of sequence reads.
1 | sampleReads(readDens, nreads = 6e+06, strandProb = c(0.5, 0.5))
|
readDens |
A two column matrix of read densities (as produced by |
nreads |
Number of read positions to generate. |
strandProb |
A numeric vector with two elements giving weights for forward and reverse strand. |
The expected number of reads for each strand is strandProb * nreads
.
A list with components fwd
and rev
giving the read positions on the
forward and reverse strand respectively.
Peter Humburg
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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)
## sample reads
## of course you would usually want a much larger number
readPos <- sampleReads(readDens, nreads=1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.