Biskit :: AmberRstParser :: AmberRstParser :: Class AmberRstParser
[hide private]
[frames] | no frames]

Class AmberRstParser

source code

Convert an Amber restart file to array, PDBModel or a Amber crd file.

Note: AmberRstParser is currently ignoring both the velocity and boxinfo record (although this could be easily changed).

Instance Methods [hide private]
  __init__(self, frst)
  __del__(self)
[float] __nextLine(self)
Extract next line of coordinates from crd file
array __frame(self)
Collect next complete coordinate frame
array getXyz(self)
Get coordinate array.
PDBModel getModel(self, ref, rnAmber=0)
Get model.
str getFirstCrdLine(self)
Return the first line of Amber crd.
  writeCrd(self, fcrd, append=1, lastAtom=None)
Write/Append Amber-formatted block of coordinates to a file.

Instance Variables [hide private]
  n
number of atoms
  xyz
will hold coordinate array
  box
will hold box array if any

Method Details [hide private]

__init__(self, frst)
(Constructor)

source code 
Parameters:
  • frst (str) - input restart file

__del__(self)
(Destructor)

source code 

__nextLine(self)

source code 

Extract next line of coordinates from crd file
Returns: [float]
coordinates

__frame(self)

source code 

Collect next complete coordinate frame
Returns: array
coordinate frame

getXyz(self)

source code 

Get coordinate array.
Returns: array
coordinates, N.array( N x 3, 'f')
Raises:

getModel(self, ref, rnAmber=0)

source code 

Get model.
Parameters:
  • ref (PDBModel) - reference with same number and order of atoms
  • rnAmber (1|0) - rename Amber to standard residues (HIE, HID, HIP, CYX)
Returns: PDBModel
PDBModel

getFirstCrdLine(self)

source code 

Return the first line of Amber crd.
Returns: str
first line of Amber crd formatted coordinate block

writeCrd(self, fcrd, append=1, lastAtom=None)

source code 

Write/Append Amber-formatted block of coordinates to a file. If a file handle is given, the file will not be closed.
Parameters:
  • fcrd (str or file object) - file to write to
  • append (0|1) - append to existing file (default: 1)
  • lastAtom (int) - skip all atoms beyond this one (default: None)

Instance Variable Details [hide private]

n


number of atoms

xyz


will hold coordinate array

box


will hold box array if any