Back to index

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

List of all members.

Public Member Functions

def setUp
def test_representation

Public Attributes

 match_strings
 coder

Detailed Description

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

Definition at line 275 of file test_NNGene.py.


Member Function Documentation

Definition at line 278 of file test_NNGene.py.

00278 
00279     def setUp(self):
00280         motifs = ["GAG", "GAT", "GCC", "ATA"]
00281 
00282         self.match_strings = (("GATCGCC", [0.0, 1.0, 1.0, 0.0]),
00283                               ("GATGATCGAGCC", [.5, 1.0, .5, 0.0]))
00284         
00285         self.coder = Motif.MotifCoder(motifs)
00286 
        
Convert a sequence into its motif representation.

Definition at line 287 of file test_NNGene.py.

00287 
00288     def test_representation(self):
00289         """Convert a sequence into its motif representation.
00290         """
00291         for match_string, expected in self.match_strings:
00292             seq_to_code = Seq(match_string, IUPAC.unambiguous_dna)
00293             matches = self.coder.representation(seq_to_code)
00294 
00295             assert matches == expected, \
00296                    "Did not match representation, expected %s, got %s" \
00297                    % (expected, matches)
00298 
00299 # --- Tests for schemas


Member Data Documentation

Definition at line 284 of file test_NNGene.py.

Definition at line 281 of file test_NNGene.py.


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