Skip to contents

For each position i of the sequence the log-likelihood ratio score of the length-w window is \(score(i) = \sum_j \log_2(p(b_{i+j-1}, j) / bg(b))\), where p(b, j) is the motif probability of base b at column j and bg the zero-order background. Scores are converted to p-values \(P(S \ge score)\) with the Staden (1994) dynamic-programming distribution of the discretized score (integer grid of 1/scale bits), as in FIMO. Scanning is single-strand.

Usage

Motfom(sequence, pwm, background = NULL, pseudocount = 0, scale = 1000L)

Arguments

sequence

DNA string over ACGT.

pwm

Motif probability matrix, w rows, 4 columns (A, C, G, T).

background

Optional 4 background frequencies (default uniform).

pseudocount

Added to every pwm cell before normalization.

scale

Discretization grid, scores rounded to 1/scale bits.

Value

List with scores, pvalues, best_score, best_pvalue, best_position (0-based), width, n_windows, method.

References

Grant, C. E., Bailey, T. L. and Noble, W. S. (2011), FIMO: scanning for occurrences of a given motif, Bioinformatics 27(7), 1017-1018 (score and dynamic-programming p-values, Methods). Staden, R. (1994), Searching for motifs in nucleic acid sequences, Methods in Molecular Biology 25, 93-102.

Examples

pwm <- rbind(c(0.9, 0.05, 0.03, 0.02), c(0.05, 0.9, 0.03, 0.02), c(0.02, 0.03, 0.9, 0.05))
m <- Motfom("TTACGTTAACGA", pwm)
c(m$best_position, m$best_pvalue)
#> [1] 2.000000 0.015625