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   
12   
13  from Bio.Seq import Seq 
14  """Hold IntelliGenetics data in a straightforward format. 
15   
16  classes: 
17  o Record - All of the information in an IntelliGenetics record. 
18  """ 
19   
20 -class Record:
21 """Hold IntelliGenetics information in a format similar to the original record. 22 23 The Record class is meant to make data easy to get to when you are 24 just interested in looking at GenBank data. 25 26 Attributes: 27 comments 28 title 29 sequence 30 """
31 - def __init__(self):
32 self.comments = [] 33 self.title = '' 34 self.sequence = Seq('')
35
36 - def __str__( self ):
37 output = 'Title: %s\n' % self.title 38 for comment in self.comments: 39 output = output + '%s\n' % comment 40 output = output + out_sequence( self.sequence.data ) 41 return output
42
43 -def out_sequence( seq ):
44 output = '' 45 for j in range( 0, len( seq ), 80 ): 46 output = output + '%s\n' % seq[ j: j + 80 ] 47 output = output + '\n' 48 return output
49