Package Bio :: Package NeuralNetwork :: Package Gene :: Module Schema :: Class SchemaFactory
[hide private]
[frames] | no frames]

Class SchemaFactory

source code

object --+
         |
        SchemaFactory

Generate Schema from inputs of Motifs or Signatures.
Instance Methods [hide private]
 
__init__(self, ambiguity_symbol='*')
Initialize the SchemaFactory
source code
 
from_motifs(self, motif_repository, motif_percent, num_ambiguous)
Generate schema from a list of motifs.
source code
 
_get_num_motifs(self, repository, motif_list)
Return the number of motif counts for the list of motifs.
source code
 
_get_unique_schema(self, cur_schemas, motif_list, num_ambiguous)
Retrieve a unique schema from a motif.
source code
 
_schema_from_motif(self, motif, motif_list, num_ambiguous)
Create a schema from a given starting motif.
source code
 
from_signatures(self, signature_repository, num_ambiguous) 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, ambiguity_symbol='*')
(Constructor)

source code 

Initialize the SchemaFactory

Arguments:

o ambiguity_symbol -- The symbol to use when specifying that a position is arbitrary.

Overrides: object.__init__

from_motifs(self, motif_repository, motif_percent, num_ambiguous)

source code 

Generate schema from a list of motifs.

Arguments:

o motif_repository - A MotifRepository class that has all of the motifs we want to convert to Schema.

o motif_percent - The percentage of motifs in the motif bank which should be matches. We'll try to create schema that match this percentage of motifs.

o num_ambiguous - The number of ambiguous characters to include in each schema. The positions of these ambiguous characters will be randomly selected.

_get_unique_schema(self, cur_schemas, motif_list, num_ambiguous)

source code 

Retrieve a unique schema from a motif.

We don't want to end up with schema that match the same thing, since this could lead to ambiguous results, and be messy. This tries to create schema, and checks that they do not match any currently existing schema.

_schema_from_motif(self, motif, motif_list, num_ambiguous)

source code 

Create a schema from a given starting motif.

Arguments:

o motif - A motif with the pattern we will start from.

o motif_list - The total motifs we have.to match to.

o num_ambiguous - The number of ambiguous characters that should be present in the schema.

Returns:

o A string representing the newly generated schema.

o A list of all of the motifs in motif_list that match the schema.