Skip to content
Snippets Groups Projects
Commit 661c5e67 authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

SCHWED-3472: Unit test for hhblits.ParseHeaderLine taken from SM

parent e5998ab4
No related branches found
No related tags found
No related merge requests found
...@@ -305,6 +305,17 @@ class TestHHblitsBindings(unittest.TestCase): ...@@ -305,6 +305,17 @@ class TestHHblitsBindings(unittest.TestCase):
'HHHHHHHHHHHHCC') 'HHHHHHHHHHHHCC')
self.assertEqual(prof['msa'].GetCount(), 253) self.assertEqual(prof['msa'].GetCount(), 253)
def fastParseHeader(self):
header_line = ' 1 814cbc1899f35c872169524af30fc2 100.0 5E-100' + \
' 5E-104 710.5 34.1 277 3-293 2-280 (281)'
hit, offset = hhblits.ParseHeaderLine(header_line)
self.assertEqual(hit.hit_id, '814cbc1899f35c872169524af30fc2')
self.assertAlmostEqual(hit.evalue, 0)
self.assertAlmostEqual(hit.prob, 100.0)
self.assertAlmostEqual(hit.pvalue, 0)
self.assertAlmostEqual(hit.score, 710.5)
self.assertAlmostEqual(hit.ss_score, 34.1)
def testParseHHblitsOutput(self): def testParseHHblitsOutput(self):
header, hits = hhblits.ParseHHblitsOutput(open("testfiles/test.hhr")) header, hits = hhblits.ParseHHblitsOutput(open("testfiles/test.hhr"))
self.assertEqual(header.query, 'Test') self.assertEqual(header.query, 'Test')
...@@ -385,8 +396,6 @@ class TestHHblitsBindings(unittest.TestCase): ...@@ -385,8 +396,6 @@ class TestHHblitsBindings(unittest.TestCase):
'Test VDPVNFKLLSHCLLVTLAAHL\ne69e1ac0'+ 'Test VDPVNFKLLSHCLLVTLAAHL\ne69e1ac0'+
'a4b2554d... ATPEQAQLVHKEIRKIVKDTC\n') 'a4b2554d... ATPEQAQLVHKEIRKIVKDTC\n')
# ParseHHblitsOutput
if __name__ == "__main__": if __name__ == "__main__":
hhsuite_root_dir = os.getenv('EBROOTHHMINSUITE') hhsuite_root_dir = os.getenv('EBROOTHHMINSUITE')
if not hhsuite_root_dir: if not hhsuite_root_dir:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment