Back to index

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

List of all members.

Public Member Functions

def setUp
def test_representation

Public Attributes

 motif_coder
 match_strings

Detailed Description

Test encoding sequences as a grouping of motifs.

Definition at line 433 of file test_NNGene.py.


Member Function Documentation

Definition at line 436 of file test_NNGene.py.

00436 
00437     def setUp(self):
00438         ambiguity_chars = {"G" : "G",
00439                            "A" : "A",
00440                            "T" : "T",
00441                            "C" : "C",
00442                            "R" : "AG",
00443                            "*" : "AGTC"}
00444 
00445         motif_representation = Schema.Schema(ambiguity_chars)
00446         motifs = ("GA", "GATAG", "GA*AG", "GATRG", "*A")
00447         self.motif_coder = Schema.SchemaCoder(motifs,
00448                                               motif_representation)
00449 
00450         self.match_strings = [("GATAG", [.5, .5, .5, .5, 1.0]),
00451                               ("GAGAGATA", [float(3) / float(4), 0,
00452                                             float(1) / float(4), 0,
00453                                             1])]

Convert a string into a representation of motifs.

Definition at line 454 of file test_NNGene.py.

00454 
00455     def test_representation(self):
00456         """Convert a string into a representation of motifs.
00457         """
00458         for match_string, expected in self.match_strings:
00459             match_seq = Seq(match_string, IUPAC.unambiguous_dna)
00460             found_rep = self.motif_coder.representation(match_seq)
00461             assert found_rep == expected, "Got %s, expected %s" % \
                   (found_rep, expected)

Member Data Documentation

Definition at line 449 of file test_NNGene.py.

Definition at line 446 of file test_NNGene.py.


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