pdbTool
index
pdbTool.py

An object to read and write PDB files to or from the current Simulation. 
 
If there is a possibility that atom naming is inconsistent with
Xplor-NIH standards, the protocol.initCoords() helper should be
used, as it can handling naming translations.
 
Constructor:
 
  PDBTool(filename, atomSel) 
    both arguments are optional. If the selection is omitted, it defaults
    to all atoms of the current simulation.Simulation. If the filename is 
    blank, the contents string buffer is used for reading/writing.
 
The primary methods of the class are:
  read(model)      - read the pdb file. If the model argument is present, the
                     specified PDB MODEL entry is read, else the first MODEL
                     is read. The return value is a list of unmatched ATOM
                     entries, if any. If the specified model number is not 
                     found, an exception is thrown. ATOM entries with non-
                     allowed AltLoc entries or entries with the insertion code
                     column set are ignored.
  write(coords)    - write the file. Make a backup if makeBackup()==1.
                     If the coords argument is present it should specify a 
                     sequence of CDSVectors of atom positions, one for each 
                     atom in the Simulation. These are written as separate
                     MODEL entries. If this argument is absent, the current
                     Simulation's coordinates are written with no MODEL entry.
  models()         - return the number of MODEL records in the PDB entry.
 
REMARK fields are manipulated using the following methods:
  addRemark(string) - add a remark field (one line).
  addRemarks(arg)   - in this case, arg is a multiline string.
                      Each line is successively added as a remark.
  clearRemarks()    - remove all remark fields.
  remarks()         - return the current remark fields in a list.
 
The following accessors are available:
 
  selection     - an atomSel.AtomSel which specifies atoms to be read or 
                  written.
  filename      - the file name to be read or written.
  contents      - string buffer used if the filename is blank. To read from a
                  string, first use setContents(string), then call read(). To
                  get the PDB record as a string, first call write(), then
                  getContents().
  makeBackup    - boolean. If true, make a backup of the current pdb file
                  before writing. Default value: true.
  verbose       - whether to print a warning when unknown atoms are read in.
                  Default: true if simWorld.logLevel is not NONE.
  aux1(atom)    - the aux1 (occupancy) field for the specified atom.
                  This member can be set using setAux1(atom,value).
  aux2(atom)    - the aux2 (bfactor) field for the specified atom.
                  This member can be set using setAux2(atom,value).
  allowedAltLoc - ATOM entries with one of these values will be read- 
                  otherwise the entry will be ignored. 
                  default value: [' ', 'A']
  useChainID    - overwrite the segment name with the chainID PDB field, if
                  the chainID field is not blank. This is only used when 
                  reading a PDB record.
  writeChainID  - write the segment name to the chainID pdb field and leave
                  the segment name field blank. An exception will be thrown
                  if the segment name is longer than one character.
 
For a given member, values can be read using the method member() and set via
setMember(val).
 
The atom name field is controlled by the following methods:
  useXplorNames() - use the XPLOR naming convention. This includes
                    changing the "*" character to a "'".
  useIupacNames() - use the IUPAC naming conventions.
 
The following is a low-level helper routine:
 
  readAtoms() - array for each atom (by index) specifying whether it
                was read in the last call to read().
 
 
 

 
Classes
       
__builtin__.object
CDSList_char
CDSList_charPtr
PDBTool
PDBToolPtr

 
class CDSList_char(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_CDSList_char>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__init__(self, *args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9e50>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_char' objects>
list of weak references to the object (if defined)

 
class CDSList_charPtr(CDSList_char)
    
Method resolution order:
CDSList_charPtr
CDSList_char
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from CDSList_char:
__del__(self, destroy=<built-in function delete_CDSList_char>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes inherited from CDSList_char:
__dict__ = <dictproxy object at 0xee9b40>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_char' objects>
list of weak references to the object (if defined)

 
class PDBTool(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_PDBTool>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
addRemark(*args)
addRemarks(self, remarks)
add multiline string as multiple remarks
        
allowedAltLoc(*args)
aux1(*args)
aux2(*args)
bfactor(*args)
clearRemarks(*args)
contents(*args)
filename(*args)
help(*args)
makeBackup(*args)
models(*args)
occupancy(*args)
read(*args)
readAtoms(*args)
remarks(*args)
selection(*args)
setAllowedAltLoc(*args)
setAux1(*args)
setAux2(*args)
setContents(*args)
setFilename(*args)
setMakeBackup(*args)
setSelection(*args)
setStrictResNames(*args)
setUseChainID(*args)
setVerbose(*args)
setWriteChainID(*args)
strictResNames(*args)
useChainID(*args)
useIupacNames(*args)
useXplorNames(*args)
verbose(*args)
write(*args)
writeChainID(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xef51a0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'PDBTool' objects>
list of weak references to the object (if defined)

 
class PDBToolPtr(PDBTool)
    
Method resolution order:
PDBToolPtr
PDBTool
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from PDBTool:
__del__(self, destroy=<built-in function delete_PDBTool>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
addRemark(*args)
addRemarks(self, remarks)
add multiline string as multiple remarks
        
allowedAltLoc(*args)
aux1(*args)
aux2(*args)
bfactor(*args)
clearRemarks(*args)
contents(*args)
filename(*args)
help(*args)
makeBackup(*args)
models(*args)
occupancy(*args)
read(*args)
readAtoms(*args)
remarks(*args)
selection(*args)
setAllowedAltLoc(*args)
setAux1(*args)
setAux2(*args)
setContents(*args)
setFilename(*args)
setMakeBackup(*args)
setSelection(*args)
setStrictResNames(*args)
setUseChainID(*args)
setVerbose(*args)
setWriteChainID(*args)
strictResNames(*args)
useChainID(*args)
useIupacNames(*args)
useXplorNames(*args)
verbose(*args)
write(*args)
writeChainID(*args)

Data and other attributes inherited from PDBTool:
__dict__ = <dictproxy object at 0xee9868>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'PDBTool' objects>
list of weak references to the object (if defined)

 
Functions
       
help(...)