1
2
3
4
5
6 """Martel based parser to read NBRF formatted files.
7
8 This is a huge regular regular expression for NBRF, built using
9 the 'regular expressiona on steroids' capabilities of Martel.
10
11 http://www-nbrf.georgetown.edu/pirwww/pirhome.shtml
12
13
14 Notes:
15 Just so I remember -- the new end of line syntax is:
16 New regexp syntax - \R
17 \R means "\n|\r\n?"
18 [\R] means "[\n\r]"
19
20 This helps us have endlines be consistent across platforms.
21
22 """
23
24 import string
25
26
27 from Bio.Seq import Seq
28 from Bio.NBRF.ValSeq import valid_sequence_dict
29
30
31
32 """Hold NBRF data in a straightforward format.
33
34 classes:
35 o Record - All of the information in an NBRF record.
36 """
37
39 """Hold NBRF information in a format similar to the original record.
40
41 The Record class is meant to make data easy to get to when you are
42 just interested in looking at NBRF data.
43
44 Attributes:
45 sequence_type
46 sequence_name
47 comment
48 sequence
49
50 """
56
64
66 output = ''
67 for j in range( 0, len( seq ), 80 ):
68 output = output + '%s\n' % seq[ j: j + 80 ]
69 output = output + '\n'
70 return output
71