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

Class Motif

source code

object --+
         |
        Motif
Known Subclasses:


A class representing sequence motifs.

Instance Methods [hide private]
 
__init__(self, alphabet=None, instances=None, counts=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__str__(self, masked=False)
string representation of a motif.
source code
 
__len__(self)
return the length of a motif
source code
 
reverse_complement(self)
Gives the reverse complement of the motif
source code
 
weblogo(self, fname, format='PNG', version='2.8.2', **kwds)
uses the Berkeley weblogo service to download and save a weblogo of itself
source code
 
format(self, format)
Returns a string representation of the Motif in a given format
source code

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

Properties [hide private]
  mask
  pseudocounts
  background
  pwm
  pssm
  consensus
Returns the consensus sequence.
  anticonsensus
returns the least probable pattern to be generated from this motif.
  degenerate_consensus
Following the rules adapted from D.

Inherited from object: __class__

Method Details [hide private]

__init__(self, alphabet=None, instances=None, counts=None)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self, masked=False)
(Informal representation operator)

source code 
string representation of a motif.
        

Overrides: object.__str__

__len__(self)
(Length operator)

source code 
return the length of a motif

Please use this method (i.e. invoke len(m)) instead of referring to m.length directly.

weblogo(self, fname, format='PNG', version='2.8.2', **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.

Currently, this method uses WebLogo version 3.3.
These are the arguments and their default values passed to
WebLogo 3.3; see their website at http://weblogo.threeplusone.com
for more information:

    'stack_width' : 'medium',
    'stack_per_line' : '40',
    'alphabet' : 'alphabet_dna',
    'ignore_lower_case' : True,
    'unit_name' : "bits",
    'first_index' : '1',
    'logo_start' : '1',
    'logo_end': str(self.length),
    'composition' : "comp_auto",
    'percentCG' : '',
    'scale_width' : True,
    'show_errorbars' : True,
    'logo_title' : '',
    'logo_label' : '',
    'show_xaxis': True,
    'xaxis_label': '',
    'show_yaxis': True,
    'yaxis_label': '',
    'yaxis_scale': 'auto',
    'yaxis_tic_interval' : '1.0',
    'show_ends' : True,
    'show_fineprint' : True,
    'color_scheme': 'color_auto',
    'symbols0': '',
    'symbols1': '',
    'symbols2': '',
    'symbols3': '',
    'symbols4': '',
    'color0': '',
    'color1': '',
    'color2': '',
    'color3': '',
    'color4': '',

format(self, format)

source code 
Returns a string representation of the Motif in a given format

Currently supported fromats:
 - pfm : JASPAR single Position Frequency Matrix
 - jaspar : JASPAR multiple Position Frequency Matrix
 - transfac : TRANSFAC like files


Property Details [hide private]

mask

Get Method:
unreachable.__get_mask(self)
Set Method:
unreachable.__set_mask(self, mask)

pseudocounts

Get Method:
unreachable.__get_pseudocounts(self)
Set Method:
unreachable.__set_pseudocounts(self, value)

background

Get Method:
unreachable.__get_background(self)
Set Method:
unreachable.__set_background(self, value)

pwm

Get Method:
unreachable.pwm(self)

pssm

Get Method:
unreachable.pssm(self)

consensus

Returns the consensus sequence.
        

Get Method:
unreachable.consensus(self) - Returns the consensus sequence.

anticonsensus

returns the least probable pattern to be generated from this motif.
        

Get Method:
unreachable.anticonsensus(self) - returns the least probable pattern to be generated from this motif.

degenerate_consensus

Following the rules adapted from
D. R. Cavener: "Comparison of the consensus sequence flanking
translational start sites in Drosophila and vertebrates."
Nucleic Acids Research 15(4): 1353-1361. (1987).
The same rules are used by TRANSFAC.

Get Method:
unreachable.degenerate_consensus(self) - Following the rules adapted from D.