예제 #1
0
 def test_bad(self):
     """Should reject bad data if strict"""
     result = parse_clustal(BAD, strict=False)
     self.assertEqual(dict(result), {})
     # should fail unless we turned strict processing off
     with self.assertRaises(RecordError):
         dict(parse_clustal(BAD))
예제 #2
0
 def test_bad(self):
     """Should reject bad data if strict"""
     result = parse_clustal(BAD, strict=False)
     self.assertEqual(dict(result), {})
     # should fail unless we turned strict processing off
     with self.assertRaises(RecordError):
         dict(parse_clustal(BAD))
예제 #3
0
 def test_real(self):
     """Should handle real Clustal output"""
     data = parse_clustal(REAL)
     self.assertEqual(dict(data), {
         'abc':
         'GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA'
         'GUCGAUACGUACGUCAGUCAGUACGUCAGCAUGCAUACGUACGUCGUACGUACGU-CGAC'
         'UGACUAGUCAGCUAGCAUCGAUCAGU',
         'def':
         '------------------------------------------------------------'
         '-----------------------------------------CGCGAUGCAUGCAU-CGAU'
         'CGAUCAGUCAGUCGAU----------',
         'xyz':
         '------------------------------------------------------------'
         '-------------------------------------CAUGCAUCGUACGUACGCAUGAC'
         'UGCUGCAUCA----------------'
     })
예제 #4
0
 def test_real(self):
     """Should handle real Clustal output"""
     data = parse_clustal(REAL)
     self.assertEqual(
         dict(data), {
             'abc':
             'GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA'
             'GUCGAUACGUACGUCAGUCAGUACGUCAGCAUGCAUACGUACGUCGUACGUACGU-CGAC'
             'UGACUAGUCAGCUAGCAUCGAUCAGU',
             'def':
             '------------------------------------------------------------'
             '-----------------------------------------CGCGAUGCAUGCAU-CGAU'
             'CGAUCAGUCAGUCGAU----------',
             'xyz':
             '------------------------------------------------------------'
             '-------------------------------------CAUGCAUCGUACGUACGCAUGAC'
             'UGCUGCAUCA----------------'
         })
예제 #5
0
 def test_space_labels(self):
     """Should tolerate spaces in labels"""
     result = parse_clustal(SPACE_LABELS)
     self.assertEqual(dict(result), {'abc': 'uca', 'def ggg': 'ccc'})
예제 #6
0
 def test_two(self):
     """Should handle two-sequence input correctly"""
     result = parse_clustal(TWO)
     self.assertEqual(dict(result), {'abc': 'uuuaaa', 'def': 'cccggg'})
예제 #7
0
 def test_minimal(self):
     """Should handle single-line input correctly"""
     result = parse_clustal([MINIMAL])  # expects seq of lines
     self.assertEqual(dict(result), {'abc': 'ucag'})
예제 #8
0
 def test_null(self):
     """Should return empty dict and list on null input"""
     result = parse_clustal([])
     self.assertEqual(dict(result), {})
예제 #9
0
 def test_space_labels(self):
     """Should tolerate spaces in labels"""
     result = parse_clustal(SPACE_LABELS)
     self.assertEqual(dict(result), {'abc': 'uca', 'def ggg': 'ccc'})
예제 #10
0
 def test_two(self):
     """Should handle two-sequence input correctly"""
     result = parse_clustal(TWO)
     self.assertEqual(dict(result), {'abc': 'uuuaaa', 'def': 'cccggg'})
예제 #11
0
 def test_minimal(self):
     """Should handle single-line input correctly"""
     result = parse_clustal([MINIMAL])  # expects seq of lines
     self.assertEqual(dict(result), {'abc': 'ucag'})
예제 #12
0
 def test_null(self):
     """Should return empty dict and list on null input"""
     result = parse_clustal([])
     self.assertEqual(dict(result), {})