Package mmLib :: Module PDB :: Class PDBRecord
[hide private]
[frames] | no frames]

Class PDBRecord

source code

object --+    
         |    
      dict --+
             |
            PDBRecord
Known Subclasses:

Base class for all PDB file records.

Instance Methods [hide private]
 
__str__(self)
str(x)
source code
 
write(self)
Return a properly formed PDB record string from the instance dictionary values.
source code
 
read(self, line)
Read the PDB record line and convert the fields to the appropriate dictionary values for this class.
source code
 
reccat(self, rec_list, field)
Return the concatenation of field in all the records in rec_list.
source code
 
reccat_list(self, rec_list, field, sep)
Call reccat, then split the result by the separator.
source code
 
reccat_tuplelist(self, rec_list, field, sep1, sep2)
Call reccat_list with sep1 as the list separator, then split the items into tuples by sep2.
source code
 
reccat_dictlist(self, rec_list, field, master_key) source code
 
reccat_multi(self, rec_list, primary_key, translations)
Create a list of dictionaries from a list of records.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __init__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]
  _name = None
hash(x)
  _field_list = None
hash(x)

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

reccat_multi(self, rec_list, primary_key, translations)

source code 

Create a list of dictionaries from a list of records. This method has complex behavior to support translations of several PDB records into a Python format. The primary key is used to seperate the dictionaries within the list, and the translation argument is a list of strings or 2-tuples. If the translation is a string, the value from the PDB record field is copied to the return dictionary. If the field is a 2-tuple==t, then t[0] is the return dictionary key whose value is a list formed from the list of PDB fields in t[1].