Trees | Indices | Help |
---|
|
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 """Hold CDD data in a straightforward format. 6 7 classes: 8 o Record - All of the information in a CDD record. 9 """ 10 11 # standard library 12 import string 13 from Bio.Seq import Seq 1416 """Hold CDD information in a format similar to the original record. 17 18 The Record class is meant to make data easy to get to when you are 19 just interested in looking at CDD data. 20 21 Attributes: 22 cd 23 description 24 status 25 source 26 date 27 reference 28 taxonomy 29 aligned 30 representative 31 range 32 sequence 33 """ 385940 output = '' 41 keys = self.keys() 42 keys.sort() 43 for key in keys: 44 output = output + '%s:\n\n' % key.upper() 45 contents = self[ key ] 46 if( type( contents ) == type( '' ) ): 47 if( key == 'Sequence' ): 48 output = output + out_multiline( contents ) 49 else: 50 output = output + '%s\n' % contents 51 elif( type( contents ) == type( {} ) ): 52 output = output + output_dict( contents, 1 ) 53 elif( type( contents ) == type( [] ) ): 54 output = output + output_list( contents, 1 ) 55 elif( isinstance( contents, Seq ) ): 56 output = output + out_multiline( contents.data ) 57 output = output + '\n\n' 58 return output61 output = '' 62 prefix = '' 63 for j in range( 0, level ): 64 prefix = prefix + ' ' 65 keys = dict.keys() 66 keys.sort() 67 for key in keys: 68 contents = dict[ key ] 69 if( type( contents ) == type( '' ) ): 70 output = output + '%s%s = %s\n' % ( prefix, key, contents ) 71 elif( type( contents ) == type( {} ) ): 72 output = output + output_dict( contents, level + 1 ) 73 elif( type( contents ) == type( [] ) ): 74 output = output + output_list( contents, level + 1 ) 75 output = output + '\n' 76 return output7779 output = '' 80 prefix = '' 81 for j in range( 0, level ): 82 prefix = prefix + ' ' 83 for item in items: 84 if( type( item ) == type( '' ) ): 85 output = output + '%s%s\n' % ( prefix, item ) 86 elif( type( item ) == type( {} ) ): 87 output = output + output_dict( item, level + 1 ) 88 elif( type( item ) == type( [] ) ): 89 output = output + output_list( item, level + 1 ) 90 output = output + '\n' 91 return output92 99
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Sep 15 09:22:52 2008 | http://epydoc.sourceforge.net |