scoreDistEmpirical: Empirical score distribution

Description Usage Arguments Value See Also Examples

View source: R/simulate_wrapper.R

Description

This function estimates the empirical score distribution on a set of randomly generated DNA sequences based on the background model. This function is only used for benchmarking analysis.

Usage

1
scoreDistEmpirical(pfm, bg, seqlen, nsim)

Arguments

pfm

An R matrix that represents a position frequency matrix

bg

A Background object

seqlen

Integer-valued vector that defines the lengths of the individual sequences. For a given DNAStringSet, this information can be retrieved using numMotifHits.

nsim

Integer number of random samples.

Value

List containing

scores

Vector of scores

dist

Score distribution

See Also

scoreDist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Load sequences
seqfile = system.file("extdata", "seq.fasta", package = "motifcounter")
seqs = Biostrings::readDNAStringSet(seqfile)

# Load background
bg = readBackground(seqs, 1)

# Load motif
motiffile = system.file("extdata", "x31.tab", package = "motifcounter")
motif = t(as.matrix(read.table(motiffile)))


# Compoute the empirical score distribution in
# sequences of length 1kb using 1000 samples
motifcounter:::scoreDistEmpirical(motif, bg, seqlen = 1000, nsim = 1000)

motifcounter documentation built on Nov. 8, 2020, 5:44 p.m.