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