Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.Geo.Record.Record Class Reference

List of all members.

Public Member Functions

def __init__
def __str__

Public Attributes

 entity_type
 entity_id
 entity_attributes
 col_defs
 table_rows

Detailed Description

Hold GEO information in a format similar to the original record.

The Record class is meant to make data easy to get to when you are
just interested in looking at GEO data.

Attributes:
entity_type
entity_id
entity_attributes
col_defs
table_rows

Definition at line 16 of file Record.py.


Constructor & Destructor Documentation

Definition at line 30 of file Record.py.

00030 
00031     def __init__(self):
00032         self.entity_type = ''
00033         self.entity_id = ''
00034         self.entity_attributes = {}
00035         self.col_defs = {}
00036         self.table_rows = []

Here is the caller graph for this function:


Member Function Documentation

Definition at line 37 of file Record.py.

00037 
00038     def __str__( self ):
00039         output = ''
00040         output = output + 'GEO Type: %s\n' % self.entity_type
00041         output = output + 'GEO Id: %s\n' % self.entity_id
00042         att_keys = self.entity_attributes.keys()
00043         att_keys.sort()
00044         for key in att_keys:
00045             contents = self.entity_attributes[ key ]
00046             if( type( contents ) == type( [] ) ):
00047                 for item in contents:
00048                     try:
00049                         output = output + '%s: %s\n' % ( key, item[ :40 ] )
00050                         output = output + out_block( item[ 40: ] )
00051                     except:
00052                         pass
00053             elif( type( contents ) == type( '' ) ):
00054                 output = output + '%s: %s\n' % ( key, contents[ :40 ] )
00055                 output = output + out_block( contents[ 40: ] )
00056             else:
00057                 print contents
00058                 output = output + '%s: %s\n' % ( key, val[ :40 ] )
00059                 output = output + out_block( val[ 40: ] )
00060         col_keys = self.col_defs.keys()
00061         col_keys.sort()
00062         output = output + 'Column Header Definitions\n'
00063         for key in col_keys:
00064             val = self.col_defs[ key ]
00065             output = output + '    %s: %s\n' % ( key, val[ :40 ] )
00066             output = output + out_block( val[ 40: ], '    ' )
00067         #May have to display VERY large tables,
00068         #so only show the first 20 lines of data
00069         MAX_ROWS = 20+1 # include header in count
00070         for row in self.table_rows[0:MAX_ROWS]:
00071             output = output + '%s: ' % self.table_rows.index( row )
00072             for col in row:
00073                 output = output + '%s\t' % col
00074             output = output + '\n'
00075         if len(self.table_rows) > MAX_ROWS:
00076             output = output + '...\n'
00077             row = self.table_rows[-1]
00078             output = output + '%s: ' % self.table_rows.index( row )
00079             for col in row:
00080                 output = output + '%s\t' % col
00081             output = output + '\n'
00082             
00083         return output

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 34 of file Record.py.

Definition at line 33 of file Record.py.

Definition at line 32 of file Record.py.

Definition at line 31 of file Record.py.

Definition at line 35 of file Record.py.


The documentation for this class was generated from the following file: