Package Biskit :: Module PDBParseFile :: Class PDBParseFile
[hide private]
[frames] | no frames]

Class PDBParseFile

source code


Instance Methods [hide private]
str idFromName(self, fname)
Extract PDB code from file name.
  update(self, model, source, skipRes=None, lookHarder=0)
Update empty or missing fields of model from the source.
  __xplorAtomIndicesTest(self, source)
In some cases the setup with parallell xplor trajectories run out of atom indices when writing the pdb files to disc.
letter __firstLetter(self, aName)
Return first letter in a string (e.g.
( list, array ) __collectAll(self, fname, skipRes=None)
Parse ATOM/HETATM lines from PDB.

Inherited from PDBParser.PDBParser: __init__, needsUpdate, parse2new

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Static Methods [hide private]
bool supports(source)
The method is static and can thus be called directly with the parser class rather than with an instance:
str description()
The method is static and can thus be called directly with the parser class rather than with an instance:

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

supports(source)
Static Method

source code 

The method is static and can thus be called directly with the parser class rather than with an instance:

>>> if PDBParser.supports('myfile.pdb'):
>>>     ...
Returns: bool
True if the given source is supported by this parser implementation
Decorators:
Overrides: PDBParser.PDBParser.supports

description()
Static Method

source code 

The method is static and can thus be called directly with the parser class rather than with an instance:

>>> if PDBParser.description('myfile.pdb'):
>>>     ...
Returns: str
short free text description of the supported format
Decorators:
Overrides: PDBParser.PDBParser.description

idFromName(self, fname)

source code 

Extract PDB code from file name.
Parameters:
  • fname (str) - file name
Returns: str
first 4 letters of filename if available

update(self, model, source, skipRes=None, lookHarder=0)

source code 

Update empty or missing fields of model from the source. The model will be connected to the source via model.source.
Parameters:
  • model (PDBModel) - existing model
  • source (str) - source PDB file
  • skipRes ([ str ]) - list residue names that should not be parsed
  • lookHarder (

    1|0

    @raise PDBParserError - if something is wrong with the source file
    ) - ignored
Overrides: PDBParser.PDBParser.update

__xplorAtomIndicesTest(self, source)

source code 

In some cases the setup with parallell xplor trajectories run out of atom indices when writing the pdb files to disc. When this happens (usualy for the TIP3 waters in the later of the 10 parallell trajectories) the atom indices get replaced with ***** which will cause the parsing to fail. The error message recieved is quite cryptic - this function is here to give a more comprehensible message.
Parameters:
  • source (str) - file that failed to be parsed

__firstLetter(self, aName)

source code 

Return first letter in a string (e.g. atom mane)
Parameters:
  • aName (str) - atom name
Returns: letter
first letter (i.e. not a number) from a string.

__collectAll(self, fname, skipRes=None)

source code 

Parse ATOM/HETATM lines from PDB. Collect coordinates plus dictionaries with the other pdb records of each atom. REMARK, HEADER, etc. lines are ignored.

Some changes are made to the dictionary from PDBFile.readline():
   - the 'position' entry (with the coordinates) is removed
   - leading and trailing spaces are removed from 'name' ..
   - .. but a 'name_original' entry keeps the old name with spaces
   - a 'type' entry is added. Its value is 'ATOM' or 'HETATM'
   - a 'after_ter' entry is added. Its value is 1, if atom is
     preceeded by a 'TER' line, otherwise 0
   - empty 'element' entries are filled with the first non-number
     letter from the atom 'name'
Parameters:
  • fname (str) - name of pdb file
  • skipRes (list of str) - list with residue names that should be skipped
Returns: ( list, array )
tuple of list of dictionaries from PDBFile.readline() and xyz array N x 3