1
2
3
4
5
6 """Martel based parser to read SAF formatted files.
7
8 This is a huge regular regular expression for Saf, built using
9 the 'regular expressiona on steroids' capabilities of Martel.
10
11 #http://www.embl-heidelberg.de/predictprotein/Dexa/optin_safDes.html
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 from Bio.Align.Generic import Alignment
25 import Bio.Alphabet
26
27
28
29 """Hold SAF data in a straightforward format.
30
31 classes:
32 o Record - All of the information in an Saf record.
33 """
34
36 """Hold Saf information in a format similar to the original record.
37
38 The Record class is meant to make data easy to get to when you are
39 just interested in looking at Saf data.
40
41 Attributes:
42 alignment
43
44 """
47
55
57 output = ''
58 for j in range( 0, len( seq ), 80 ):
59 output = output + '%s\n' % seq[ j: j + 80 ]
60 output = output + '\n'
61 return output
62