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

Class Motif

source code

object --+
         |
        Motif

A class representing sequence motifs.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_check_length(self, len) source code
 
_check_alphabet(self, alphabet) source code
 
add_instance(self, instance)
adds new instance to the motif
source code
 
set_mask(self, mask)
sets the mask for the motif
source code
 
pwm(self)
returns the PWM computed for the set of instances
source code
 
search_instances(self, sequence)
a generator function, returning found positions of instances of the motif in a given sequence
source code
 
score_hit(self, sequence, position, normalized=1, masked=0)
give the pwm score for a given position
source code
 
search_pwm(self, sequence, threshold=0.0, normalized=1, masked=1)
a generator function, returning found hits in a given sequence with the pwm score higher than the threshold
source code
 
sim(self, motif, masked=0)
return the similarity score for the given motif against self.
source code
 
read(self, stream)
reads the motif from the stream
source code
 
__str__(self)
string representation of motif
source code
 
write(self, stream)
writes the motif to the stream
source code
 
to_fasta(self)
FASTA representation of motif
source code
 
weblogo(self, fname, format='PNG', **kwds)
uses the Berkeley weblogo service to download and save a weblogo of itself
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

set_mask(self, mask)

source code 

sets the mask for the motif

The mask should be a string containing asterisks in the position of significant columns and spaces in other columns

sim(self, motif, masked=0)

source code 

return the similarity score for the given motif against self.

We use the Pearson's correlation of the respective probabilities. If the motifs have different length or mask raise the ValueError.

read(self, stream)

source code 

reads the motif from the stream

the self.alphabet variable must be set before

__str__(self)
(Informal representation operator)

source code 

string representation of motif

Overrides: object.__str__

weblogo(self, fname, format='PNG', **kwds)

source code 

uses the Berkeley weblogo service to download and save a weblogo of itself

requires an internet connection. The parameters from **kwds are passed directly to the weblogo server.