Package Bio :: Package IntelliGenetics :: Module Record
[hide private]
[frames] | no frames]

Source Code for Module Bio.IntelliGenetics.Record

 1  # Copyright 2001 by Katharine Lindner.  All rights reserved. 
 2  # This code is part of the Biopython distribution and governed by its 
 3  # license.  Please see the LICENSE file that should have been included 
 4  # as part of this package. 
 5   
 6  """Martel based parser to read IntelliGenetics formatted files (DEPRECATED). 
 7   
 8  This module defines a Record class to hold a sequence from the IntelliGenetics/ 
 9  MASE file format in a similar represenation to the original raw file. 
10  """ 
11  # standard library 
12  import string 
13   
14   
15  from Bio.Seq import Seq 
16  """Hold IntelliGenetics data in a straightforward format. 
17   
18  classes: 
19  o Record - All of the information in an IntelliGenetics record. 
20  """ 
21   
22 -class Record:
23 """Hold IntelliGenetics information in a format similar to the original record. 24 25 The Record class is meant to make data easy to get to when you are 26 just interested in looking at GenBank data. 27 28 Attributes: 29 comments 30 title 31 sequence 32 """
33 - def __init__(self):
34 self.comments = [] 35 self.title = '' 36 self.sequence = Seq('')
37
38 - def __str__( self ):
39 output = 'Title: %s\n' % self.title 40 for comment in self.comments: 41 output = output + '%s\n' % comment 42 output = output + out_sequence( self.sequence.data ) 43 return output
44
45 -def out_sequence( seq ):
46 output = '' 47 for j in range( 0, len( seq ), 80 ): 48 output = output + '%s\n' % seq[ j: j + 80 ] 49 output = output + '\n' 50 return output
51