Exemplo n.º 1
0
 def test_MinimalRnaviewParser_short(self):
     """MinimalRnaviewparser: should leave lists empty if no lines found"""
     lines = RNAVIEW_LINES_SHORT.split('\n')
     res = MinimalRnaviewParser(lines)
     self.assertEqual(len(res['FN']), 1)
     self.assertEqual(res['UC'], [])
     self.assertEqual(res['BM'], [])
     self.assertEqual(len(res['PC']), 4)
     self.assertEqual(len(res['BP']), 11)
     self.assertEqual(len(res['NP']), 1)
Exemplo n.º 2
0
 def test_MinimalRnaviewParser(self):
     """MinimalRnaviewParser: should divide lines into right classes"""
     exp = {'FN': ['PDB data file name: 1EHZ.pdb'], 'UC':\
     ['uncommon residue   I    1  on chain A [#1] assigned to: I',
     'uncommon residue 2MG   10  on chain A [#10] assigned to: g'],
     'BP':['1_72, A:     1 I-C    72 A: X/X cis         n/a',
     '58_60, A:    58 a-C    60 A: S/S tran   syn    !(s_s)'],
     'BM':['9_12_23_| [1 3]  A: 9 A  +  A: 12 U  +  A: 23 A',
     '13_22_46_| [2 3]  A: 13 C  +  A: 22 G  +  A: 46 g'],
     'PC':['Standard  WW--cis  WW-tran  HH--cis  HH-tran  SS--cis  SS-tran',
     '19        3        1        0        1        0        0',
     'WH--cis  WH-tran  WS--cis  WS-tran  HS--cis  HS-tran',
     '0        3        0        2        0        0'],
     'NP':['The total base pairs =  30 (from   76 bases)']}
     obs = MinimalRnaviewParser(RNAVIEW_LINES.split('\n'))
     self.assertEqual(len(obs), len(exp))
     self.assertEqual(obs, exp)