Package Bio :: Package NeuralNetwork :: Package Gene :: Module Motif :: Class MotifFinder
[hide private]
[frames] | no frames]

Class MotifFinder

source code

object --+
         |
        MotifFinder

Find motifs in a set of Sequence Records.
    

Instance Methods [hide private]
 
__init__(self, alphabet_strict=1)
Initialize a finder to get motifs.
source code
 
find(self, seq_records, motif_size)
Find all motifs of the given size in the passed SeqRecords.
source code
 
_get_motif_dict(self, seq_records, motif_size)
Return a dictionary with information on motifs.
source code
 
find_differences(self, first_records, second_records, motif_size)
Find motifs in two sets of records and return the differences.
source code
 
_add_motif(self, motif_dict, motif_to_add)
Add a motif to the given dictionary.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, alphabet_strict=1)
(Constructor)

source code 
Initialize a finder to get motifs.

Arguments:

o alphabet_strict - Whether or not motifs should be
restricted to having all of there elements within the alphabet
of the sequences. This requires that the Sequences have a real
alphabet, and that all sequences have the same alphabet.

Overrides: object.__init__

find(self, seq_records, motif_size)

source code 
Find all motifs of the given size in the passed SeqRecords.

Arguments:

o seq_records - A list of SeqRecord objects which the motifs
will be found from.

o motif_size - The size of the motifs we want to look for.

Returns:
A PatternRepository object that contains all of the motifs (and their
counts) found in the training sequences).

_get_motif_dict(self, seq_records, motif_size)

source code 
Return a dictionary with information on motifs.

This internal function essentially does all of the hard work for
finding motifs, and returns a dictionary containing the found motifs
and their counts. This is internal so it can be reused by
find_motif_differences.

find_differences(self, first_records, second_records, motif_size)

source code 
Find motifs in two sets of records and return the differences.

This is used for finding motifs, but instead of just counting up all
of the motifs in a set of records, this returns the differences
between two listings of seq_records.

o first_records, second_records - Two listings of SeqRecord objects
to have their motifs compared.

o motif_size - The size of the motifs we are looking for.

Returns:
A PatternRepository object that has motifs, but instead of their
raw counts, this has the counts in the first set of records
subtracted from the counts in the second set.