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

Package Motif

source code

Tools for sequence motif analysis (OBSOLETE, see Bio.motifs instead).

This module (Bio.Motif) is now obsolete, and will be deprecated and
removed in a future release of release of Biopython. Please use the
new module Bio.motifs instead.

This contains the core Motif class containing various I/O methods as
well as methods for motif comparisons and motif searching in sequences.
It also inlcudes functionality for parsing AlignACE and MEME programs.

Submodules [hide private]

Functions [hide private]
 
_from_pfm(handle) source code
 
_from_sites(handle) source code
 
parse(handle, format)
Parses an output file of motif finding programs.
source code
 
read(handle, format)
Reads a motif from a handle using a specified file-format.
source code
 
_test()
Run the Bio.Motif module's doctests.
source code
Variables [hide private]
  _parsers = {"AlignAce": _AlignAce_read, "MEME": _MEME_read,}
  _readers = {"jaspar-pfm": _from_pfm, "jaspar-sites": _from_sites}
  __warningregistry__ = {('The module Bio.Motif is now obsolete,...
Function Details [hide private]

parse(handle, format)

source code 
Parses an output file of motif finding programs.

Currently supported formats:
 - AlignAce
 - MEME

You can also use single-motif formats, although the Bio.Motif.read()
function is simpler to use in this situation.
 - jaspar-pfm
 - jaspar-sites

For example:

>>> from Bio import Motif
>>> for motif in Motif.parse(open("Motif/alignace.out"),"AlignAce"):
...     print motif.consensus()
TCTACGATTGAG
CTGCACCTAGCTACGAGTGAG
GTGCCCTAAGCATACTAGGCG
GCCACTAGCAGAGCAGGGGGC
CGACTCAGAGGTT
CCACGCTAAGAGAAGTGCCGGAG
GCACGTCCCTGAGCA
GTCCATCGCAAAGCGTGGGGC
GAGATCAGAGGGCCG
TGGACGCGGGG
GACCAGAGCCTCGCATGGGGG
AGCGCGCGTG
GCCGGTTGCTGTTCATTAGG
ACCGACGGCAGCTAAAAGGG
GACGCCGGGGAT
CGACTCGCGCTTACAAGG

read(handle, format)

source code 
Reads a motif from a handle using a specified file-format.

This supports the same formats as Bio.Motif.parse(), but
only for files containing exactly one record.  For example,
reading a pfm file:

>>> from Bio import Motif
>>> motif = Motif.read(open("Motif/SRF.pfm"),"jaspar-pfm")
>>> motif.consensus()
Seq('GCCCATATATGG', IUPACUnambiguousDNA())

Or a single-motif MEME file,

>>> from Bio import Motif
>>> motif =  Motif.read(open("Motif/meme.out"),"MEME")
>>> motif.consensus()
Seq('CTCAATCGTA', IUPACUnambiguousDNA())

If the handle contains no records, or more than one record,
an exception is raised:

>>> from Bio import Motif
>>> motif = Motif.read(open("Motif/alignace.out"),"AlignAce")
Traceback (most recent call last):
    ...
ValueError: More than one motif found in handle

If however you want the first record from a file containing
multiple records this function would raise an exception (as
shown in the example above).  Instead use:

>>> from Bio import Motif
>>> motif = Motif.parse(open("Motif/alignace.out"),"AlignAce").next()
>>> motif.consensus()
Seq('TCTACGATTGAG', IUPACUnambiguousDNA())

Use the Bio.Motif.parse(handle, format) function if you want
to read multiple records from the handle.

_test()

source code 
Run the Bio.Motif module's doctests.

This will try and locate the unit tests directory, and run the doctests
from there in order that the relative paths used in the examples work.


Variables Details [hide private]

__warningregistry__

Value:
{('The module Bio.Motif is now obsolete, and will bedeprecated and rem\
oved in a future release ofrelease of Biopython. As a replacement for \
Bio.Motif,please use the new module Bio.motifs instead. Pleasebe aware\
 that though the functionality of Bio.Motifis retained (and extended) \
in Bio.motifs, usage maybe different.',
  <type 'exceptions.PendingDeprecationWarning'>,
  24): 1}