Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_NNGene.SignatureCoderTest Class Reference

List of all members.

Public Member Functions

def setUp
def test_representation

Public Attributes

 coder
 test_seqs

Detailed Description

Test the ability to encode sequences as a set of signatures.

Definition at line 608 of file test_NNGene.py.


Member Function Documentation

Definition at line 611 of file test_NNGene.py.

00611 
00612     def setUp(self):
00613         signatures = [("GAC", "GAC"), ("AAA", "TTT"), ("CAA", "TTG")]
00614 
00615         self.coder = Signature.SignatureCoder(signatures, 9)
00616 
00617         self.test_seqs = [("GACAAAGACTTT", [1.0, 1.0, 0.0]),
00618                           ("CAAAGACGACTTTAAATTT", [0.5, 1.0, 0.0]),
00619                           ("AAATTTAAAGACTTTGAC", [1.0 / 3.0, 1.0, 0.0]),
00620                           ("GACGAC", [1.0, 0.0, 0.0]),
00621                           ("GACAAAAAAAAAGAC", [1.0, 0.0, 0.0]),
00622                           ("GACAAAAAAAAAAGAC", [0.0, 0.0, 0.0])]

Convert a sequence into its signature representation.

Definition at line 623 of file test_NNGene.py.

00623 
00624     def test_representation(self):
00625         """Convert a sequence into its signature representation.
00626         """
00627         for seq_string, expected in self.test_seqs:
00628             test_seq = Seq(seq_string, IUPAC.unambiguous_dna)
00629             predicted = self.coder.representation(test_seq)
00630 
00631             assert predicted == expected, \
00632                    "Non-expected representation %s for %s, wanted %s" \
00633                    % (predicted, seq_string, expected)


Member Data Documentation

Definition at line 614 of file test_NNGene.py.

Definition at line 616 of file test_NNGene.py.


The documentation for this class was generated from the following file: