| 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 | ||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||
| Functions | ||
| ||