pdbTool
index

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, useChainID=True, strictResNames=False) 
    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. If useChainID
    is True, if chainID is not a space, it will be used as the segment name, with
    the segid field ignored. If useChainID=False, the chainID field is ignored.
    If strictResNames is True, atoms will not be loaded if the residue name in 
    the PDB record differs from that in the PSF.
 
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. If it is not present
                     or the value is negative, 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.
  writeAtoms()     - write ATOM records only for all atoms in selection. No
                     write initialization or closing is performed.
 
  writeOneAtom(atom,atomPos,occupancy,bfactor,altLoc) -
                     Write out a single PDB ATOM record for the specified
                     atom. All but the first argument are optional and may
                     be specified by keyword argument names.
 
  writeInitialize(atomIndex=1) - 
                     initialize file or contents buffer for a new 
                     structure, clearing the chainID and setting the 
                     atom index to the optional argument.
  writeClose()     - Close file written to using writeOneAtom(). The file
                     is also closed if the PDBTool object goes out of scope
                     or otherwise deleted.
  numModels()      - return the number of MODEL records in the PDB entry.
  models()         - return a list of integer models present in the PDB entry.
  altLocs()        - return a list of all (unique) characters which appear in
                     the altLoc field.
  format()         - Return the file format type: "PDB", "CIF" or "unknown".
                     If the format type is "unknown", determinFormat is called.
  determineFormat()- Set format by examining the current contents of the
                     file or string input. The format() method should usually
                     be called instead.
 
REMARK fields are manipulated using the following methods:
  readRemarks()     - read in the REMARK records from the input file.
  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.
 
CONECT records are manipulated using the following methods:
  readConect()      - read in the CONECT records from the input file.
  addConect(list)   - add a CONECT record, where list contains 2 or more
                      integer atom ids (offset 1).
  clearConect()     - remove all CONECT records.
  conect()          - return the current CONECT records as a list of lists of
                      integer ids.
  numRead()         - return the number of ATOM records succesfully read
                      during the previous call to read().
 
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 simulationWorld.logLevel is not NONE.
  aux1(atom)    - the aux1 (occupancy) field for the specified atom.
                  This member can be set using setAux1(atom,value).
  occupancy()   - synonym for aux1.
  aux2(atom)    - the aux2 (bfactor) field for the specified atom.
                  This member can be set using setAux2(atom,value).
  bfactor()     - synonym for aux2(atom).
 
  occupancies() - return a list of occupancies of all atoms.
  bfactors()    - return a list of bfactors of all atoms.
 
  hetatmSel     - atomSel.AtomSel which atoms to write HETATM entries
                  for. Atoms not in this selection instead are written with
                  ATOM entries, and this selection is empty by default.
  includeHETATM - boolean. If True, read HETATM records as ATOM records [False].
  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. Additionally, a TER record
                  will be written between ATOM records when the segment name 
                  changes, and at the end of a structure. An exception will 
                  be thrown if the segment name is longer than one character.
  remarksCatName- For reading mmCIF files, this string specifies the name of
                  the category for the Xplor-NIH remarks ["XplorNIH_remarks"].
 
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().
 
 
 
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

 
Classes
       
builtins.object
AltLocRecord
CDSList_AltLocRecord
CDSList_char
PDBTool

 
class AltLocRecord(builtins.object)
    AltLocRecord(*args)
 

 
  Methods defined here:
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)

Static methods defined here:
__swig_destroy__ = delete_AltLocRecord(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
bfactor

 
occupancy

 
pos

 
thisown

 
The membership flag

 
class CDSList_AltLocRecord(builtins.object)
    CDSList_AltLocRecord(*args)
 

 
  Methods defined here:
__delitem__(self, *args, **kwargs) -> 'void'
__getitem__(self, *args) -> 'CDSList< AltLocRecord >'
__getslice__(self, *args, **kwargs) -> 'CDSList< AltLocRecord >'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__len__(self, *args, **kwargs) -> 'int'
__repr__ = _swig_repr(self)
__setitem__(self, *args, **kwargs) -> 'void'
append(self, *args, **kwargs) -> 'void'
help(self, *args, **kwargs) -> 'String'
remove(self, *args, **kwargs) -> 'void'
removeAll(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_CDSList_AltLocRecord(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class CDSList_char(builtins.object)
    CDSList_char(*args)
 

 
  Methods defined here:
__delitem__(self, *args, **kwargs) -> 'void'
__getitem__(self, *args) -> 'CDSList< char >'
__getslice__(self, *args, **kwargs) -> 'CDSList< char >'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__len__(self, *args, **kwargs) -> 'int'
__repr__ = _swig_repr(self)
__setitem__(self, *args, **kwargs) -> 'void'
append(self, *args, **kwargs) -> 'void'
help(self, *args, **kwargs) -> 'String'
remove(self, *args, **kwargs) -> 'void'
removeAll(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_CDSList_char(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class PDBTool(builtins.object)
    PDBTool(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
addConect(self, *args, **kwargs) -> 'void'
addRemark(self, *args, **kwargs) -> 'void'
addRemarks(self, remarks)
add multiline string or list of strings as multiple remarks.
allowedAltLoc(self, *args, **kwargs) -> 'CDSList< char > const'
altLocs(self, *args, **kwargs) -> 'CDSList< String >'
aux1(self, *args, **kwargs) -> 'float_type'
aux2(self, *args, **kwargs) -> 'float_type'
bfactor(self, *args, **kwargs) -> 'float_type'
bfactors(self, *args, **kwargs) -> 'CDSVector< float_type >'
clearConect(self, *args, **kwargs) -> 'void'
clearRemarks(self, *args, **kwargs) -> 'void'
conect(self, *args, **kwargs) -> 'CDSList< CDSList< int > >'
contents(self, *args, **kwargs) -> 'String'
determineFormat(self, *args, **kwargs) -> 'PDBTool::PDBformat'
filename(self, *args, **kwargs) -> 'String const'
format(self, *args, **kwargs) -> 'PDBTool::PDBformat'
hetatmSel(self, *args, **kwargs) -> 'AtomSel const'
includeHETATM(self, *args, **kwargs) -> 'bool const'
makeBackup(self, *args, **kwargs) -> 'bool const'
models(self, *args, **kwargs) -> 'CDSList< int >'
numModels(self, *args, **kwargs) -> 'int'
numRead(self, *args, **kwargs) -> 'int'
occupancies(self, *args, **kwargs) -> 'CDSVector< float_type >'
occupancy(self, *args, **kwargs) -> 'float_type'
pyXplorHelp(self, *args, **kwargs) -> 'String'
read(self, *args, **kwargs) -> 'CDSList< String >'
readAtoms(self, *args, **kwargs) -> 'CDSVector< bool >'
readCIF(self, *args, **kwargs) -> 'CDSList< String >'
readConect(self, *args, **kwargs) -> 'CDSList< CDSList< int > >'
readPDB(self, *args, **kwargs) -> 'CDSList< String >'
readRemarks(self, *args, **kwargs) -> 'CDSList< String >'
remarks(self, *args, **kwargs) -> 'CDSList< String >'
remarksCatName(self, *args, **kwargs) -> 'String const'
selection(self, *args, **kwargs) -> 'AtomSel const'
setAllowedAltLoc(self, *args, **kwargs) -> 'void'
setAux1(self, *args, **kwargs) -> 'void'
setAux2(self, *args, **kwargs) -> 'void'
setContents(self, *args, **kwargs) -> 'void'
setFilename(self, *args, **kwargs) -> 'void'
setHetatmSel(self, *args, **kwargs) -> 'void'
setIncludeHETATM(self, *args, **kwargs) -> 'void'
setMakeBackup(self, *args, **kwargs) -> 'void'
setRemarksCatName(self, *args, **kwargs) -> 'void'
setSelection(self, *args, **kwargs) -> 'void'
setStrictResNames(self, *args, **kwargs) -> 'void'
setUseChainID(self, *args, **kwargs) -> 'void'
setVerbose(self, *args, **kwargs) -> 'void'
setWriteChainID(self, *args, **kwargs) -> 'void'
strictResNames(self, *args, **kwargs) -> 'bool const'
useChainID(self, *args, **kwargs) -> 'bool const'
useIupacNames(self, *args, **kwargs) -> 'void'
useXplorNames(self, *args, **kwargs) -> 'void'
verbose(self, *args, **kwargs) -> 'int const'
write(self, *args, **kwargs) -> 'void'
writeAtoms(self, *args, **kwargs) -> 'void'
writeChainID(self, *args, **kwargs) -> 'bool const'
writeClose(self, *args, **kwargs) -> 'void'
writeInitialize(self, *args, **kwargs) -> 'void'
writeOneAtom(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_PDBTool(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

Data and other attributes defined here:
CIF = 2
PDB = 1
UNKNOWN = 0

 
Functions
       
pyXplorHelp(*args) -> 'String'