OpenMM
|
GromacsGroFile parses a Gromacs .gro file and constructs a set of atom positions from it. More...
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 | 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. | |
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.
def __init__ | ( | self, | |
file | |||
) |
Load a .gro file.
The atom positions can be retrieved by calling getPositions().
file | (string) the name of the file to load |
def getNumFrames | ( | self | ) |
Get the number of frames stored in the file.
def getPositions | ( | self, | |
asNumpy = False , |
|||
frame = 0 |
|||
) |
Get the atomic positions.
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.
frame | (int=0) the index of the frame for which to get the unit cell dimensions |
atomNames |
A list containing the name of each atom stored in the file.
elements |
A list containing the element of each atom stored in the file.
positions |
The atom positions read from the file.
If the file contains multiple frames, these are the positions in the first frame.
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.