Package Bio :: Package Motif :: Module Thresholds :: Class ScoreDistribution
[hide private]
[frames] | no frames]

Class ScoreDistribution

source code

Class representing approximate score distribution for a given motif.

Utilizes a dynamic programming approch to calculate the distribution of scores with a predefined precision. Provides a number of methods for calculating thresholds for motif occurences.

Instance Methods [hide private]
 
__init__(self, motif, precision=1000) source code
 
_index_diff(self, x, y=0.0) source code
 
_add(self, i, j) source code
 
modify(self, scores, mo_probs, bg_probs) source code
 
threshold_fpr(self, fpr)
Approximate the log-odds threshold which makes the type I error (false positive rate).
source code
 
threshold_fnr(self, fnr)
Approximate the log-odds threshold which makes the type II error (false negative rate).
source code
 
threshold_balanced(self, rate_proportion=1.0, return_rate=False)
Approximate the log-odds threshold which makes FNR equal to FPR times rate_proportion
source code
 
threshold_patser(self)
Threshold selection mimicking the behaviour of patser (Hertz, Stormo 1999) software.
source code
Method Details [hide private]

threshold_patser(self)

source code 

Threshold selection mimicking the behaviour of patser (Hertz, Stormo 1999) software.

It selects such a threshold that the log(fpr)=-ic(M) note: the actual patser software uses natural logarithms instead of log_2, so the numbers are not directly comparable.