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.
Methods
|
|
__init__
representation
|
|
__init__
|
__init__ (
self,
signatures,
max_gap,
)
Initialize with the signatures to look for.
Arguments:
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 ).
max_gap - The maximum gap we can have between the two
elements of the signature.
|
|
representation
|
representation ( self, sequence )
Convert a sequence into a representation of its signatures.
Arguments:
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.
|
|