Package Bio :: Package NeuralNetwork :: Package Gene :: Module Signature :: Class SignatureCoder
[hide private]
[frames] | no frames]

Class SignatureCoder

source code

object --+
         |
        SignatureCoder

Convert a Sequence into its signature representatives.

This takes a sequence and a set of signatures, and converts the sequence into a list of numbers representing the relative amounts each signature is seen in the sequence. This allows a sequence to serve as input into a neural network.

Instance Methods [hide private]
 
__init__(self, signatures, max_gap)
Initialize with the signatures to look for.
source code
 
representation(self, sequence)
Convert a sequence into a representation of its signatures.
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, signatures, max_gap)
(Constructor)

source code 

Initialize with the signatures to look for.

Arguments:

o signatures - A complete list of signatures, in order, that are to be searched for in the sequences. The signatures should be represented as a tuple of (first part of the signature, second_part of the signature) -- ('GATC', 'GATC').

o max_gap - The maximum gap we can have between the two elements of the signature.

Overrides: object.__init__

representation(self, sequence)

source code 

Convert a sequence into a representation of its signatures.

Arguments:

o sequence - A Seq object we are going to convert into a set of signatures.

Returns: A list of relative signature representations. Each item in the list corresponds to the signature passed in to the initializer and is the number of times that the signature was found, divided by the total number of signatures found in the sequence.