fit.gev: Fit a gev distribution for a pwm matrix.

Description Usage Arguments Details Value Author(s) Examples

Description

Fit a gev distribution for a pwm matrix.

Usage

1
fit.gev(pwm, sequences, gc.content = 0.5, both.strands = TRUE)

Arguments

pwm

position specific count matrix with 4 rows: A, C, G, T

sequences

the promoter sequences to fit the model

gc.content

GC content to be passed to the affinity function

both.strands

compute affinity for both strands (default: TRUE)

Details

sequences is a list of character vectors. Each of these character vectors contains promoter sequences of the same length, since the parameters of the generalized extreme value distribution for the pwm are dependent on the sequence length. For each set of sequences of the same length, the GEV parameters are fit. Finally these parameters are used in a linear model dependent on the logarithm base 10 of the length of the sequence.

Value

An object of class GevFit. It contains two elements:

params

the length dependent parameters given as the regression coefficients shape0, shape1, scale0, scale1, loc0 and loc1. These can be used to compute the gev parameters of a sequence of length l as follows: shape = shape0 + shape1 * log10(l) etc.

Author(s)

Matthias Heinig <heinig@molgen.mpg.de>

Examples

1
2
3
4
5
6
pwm = matrix(c(5, 4, 3, 1, 10, 12, 5, 3, 3, 5, 3, 10), nrow=4)
sequences = lapply(c(100, 200, 300), function(l) sapply(1:100,
function(x) paste(c("A", "C", "G", "T")[sample(4, l, replace=TRUE)],
collapse="")))

fit.gev(pwm, sequences)

matthuska/tRap documentation built on May 21, 2019, 1:23 p.m.