OpenMM
GromacsGroFile Class Reference

GromacsGroFile parses a Gromacs .gro file and constructs a set of atom positions from it. More...

List of all members.

Public Member Functions

def __init__
 Load a .gro file.
def getNumFrames
 Get the number of frames stored in the file.
def getPositions
 Get the atomic positions.
def getPeriodicBoxVectors
 Get the vectors defining the periodic box.
def getUnitCellDimensions
 Get the dimensions of the crystallographic unit cell.

Public Attributes

 positions
 The atom positions read from the file.
 elements
 A list containing the element of each atom stored in the file.
 atomNames
 A list containing the name of each atom stored in the file.
 residueIds
 A list containing the ID of the residue that each atom belongs to.
 residueNames
 A list containing the name of the residue that each atom belongs to.

Detailed Description

GromacsGroFile parses a Gromacs .gro file and constructs a set of atom positions from it.

A .gro file also contains some topological information, such as elements and residue names, but not enough to construct a full Topology object. This information is recorded and stored in the object's public fields.


Constructor & Destructor Documentation

def __init__ (   self,
  file 
)

Load a .gro file.

The atom positions can be retrieved by calling getPositions().

Parameters:
file(string) the name of the file to load

Member Function Documentation

def getNumFrames (   self)

Get the number of frames stored in the file.

def getPeriodicBoxVectors (   self,
  frame = 0 
)

Get the vectors defining the periodic box.

Parameters:
frame(int=0) the index of the frame for which to get the box vectors
def getPositions (   self,
  asNumpy = False,
  frame = 0 
)

Get the atomic positions.

Parameters:
asNumpy(boolean=False) if true, the values are returned as a numpy array instead of a list of Vec3s
frame(int=0) the index of the frame for which to get positions
def getUnitCellDimensions (   self,
  frame = 0 
)

Get the dimensions of the crystallographic unit cell.

Parameters:
frame(int=0) the index of the frame for which to get the unit cell dimensions

Member Data Documentation

A list containing the name of each atom stored in the file.

A list containing the element of each atom stored in the file.

The atom positions read from the file.

If the file contains multiple frames, these are the positions in the first frame.

A list containing the ID of the residue that each atom belongs to.

A list containing the name of the residue that each atom belongs to.


The documentation for this class was generated from the following file:
 All Classes Functions Variables