Package Bio :: Package motifs :: Module matrix :: Class PositionSpecificScoringMatrix
[hide private]
[frames] | no frames]

Class PositionSpecificScoringMatrix

source code

       object --+        
                |        
             dict --+    
                    |    
GenericPositionMatrix --+
                        |
                       PositionSpecificScoringMatrix

Instance Methods [hide private]
 
calculate(self, sequence)
Returns the PWM score for a given sequence for all positions.
source code
 
search(self, sequence, threshold=0.0, both=True)
Find hits with PWM score above given threshold.
source code
 
mean(self, background=None)
Expected value of the score of a motif.
source code
 
std(self, background=None)
Standard deviation of the score of a motif.
source code
 
dist_pearson(self, other)
Return the similarity score based on pearson correlation for the given motif against self.
source code
 
dist_pearson_at(self, other, offset) source code
 
distribution(self, background=None, precision=1000)
calculate the distribution of the scores at the given precision.
source code

Inherited from GenericPositionMatrix: __getitem__, __init__, __str__, reverse_complement

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]
  max
Maximal possible score for this motif.
  min
Minimal possible score for this motif.
  gc_content
Compute the fraction GC content.

Inherited from GenericPositionMatrix: anticonsensus, consensus, degenerate_consensus

Inherited from object: __class__

Method Details [hide private]

calculate(self, sequence)

source code 
Returns the PWM score for a given sequence for all positions.

Notes:

 - the sequence can only be a DNA sequence
 - the search is performed only on one strand
 - if the sequence and the motif have the same length, a single
   number is returned
 - otherwise, the result is a one-dimensional list or numpy array

search(self, sequence, threshold=0.0, both=True)

source code 
Find hits with PWM score above given threshold.

A generator function, returning found hits in the given sequence
with the pwm score higher than the threshold.

dist_pearson(self, other)

source code 
Return the similarity score based on pearson correlation for the given motif against self.

We use the Pearson's correlation of the respective probabilities.


Property Details [hide private]

max

Maximal possible score for this motif.

returns the score computed for the consensus sequence.

Get Method:
unreachable.max(self) - Maximal possible score for this motif.

min

Minimal possible score for this motif.

returns the score computed for the anticonsensus sequence.

Get Method:
unreachable.min(self) - Minimal possible score for this motif.

gc_content

Compute the fraction GC content.

Get Method:
unreachable.gc_content(self)