Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_Motif.MotifTestPWM Class Reference

List of all members.

Public Member Functions

def setUp
def test_simple

Public Attributes

 m
 s

Detailed Description

Definition at line 1506 of file test_Motif.py.


Member Function Documentation

Definition at line 1507 of file test_Motif.py.

01507 
01508     def setUp(self):
01509         handle = open("Motif/SRF.pfm")
01510         self.m = Motif.read(handle, "jaspar-pfm")
01511         handle.close()
01512         self.s = Seq("ACGTGTGCGTAGTGCGT", self.m.alphabet)

Here is the call graph for this function:

Test if Motif PWM scoring works.

Definition at line 1513 of file test_Motif.py.

01513 
01514     def test_simple(self):
01515         """Test if Motif PWM scoring works."""
01516         result = self.m.scanPWM(self.s)
01517         self.assertEqual(6, len(result))
01518         # The fast C-code in Bio/Motif/_pwm.c stores all results as 32-bit
01519         # floats; the slower Python code in Bio/Motif/_Motif.py uses 64-bit
01520         # doubles. The C-code and Python code results will therefore not be
01521         # exactly equal. Test the first 5 decimal places only to avoid either
01522         # the C-code or the Python code to inadvertently fail this test.
01523         self.assertAlmostEqual(result[0], -29.18363571, places=5)
01524         self.assertAlmostEqual(result[1], -38.3365097, places=5)
01525         self.assertAlmostEqual(result[2], -29.17756271, places=5)
01526         self.assertAlmostEqual(result[3], -38.04542542, places=5)
01527         self.assertAlmostEqual(result[4], -20.3014183, places=5)
01528         self.assertAlmostEqual(result[5], -25.18009186, places=5)
01529 


Member Data Documentation

Definition at line 1509 of file test_Motif.py.

Definition at line 1511 of file test_Motif.py.


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