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
25 from Bio.Seq import Seq
26 from Bio.NBRF.ValSeq import valid_sequence_dict
27
28
29
30 """Hold NBRF data in a straightforward format.
31
32 classes:
33 o Record - All of the information in an NBRF record.
34 """
35
37 """Hold NBRF information in a format similar to the original record.
38
39 The Record class is meant to make data easy to get to when you are
40 just interested in looking at NBRF data.
41
42 Attributes:
43 sequence_type
44 sequence_name
45 comment
46 sequence
47
48 """
54
62
64 output = ''
65 for j in range( 0, len( seq ), 80 ):
66 output = output + '%s\n' % seq[ j: j + 80 ]
67 output = output + '\n'
68 return output
69