GromacsGroFile¶
-
class
simtk.openmm.app.gromacsgrofile.
GromacsGroFile
(file)¶ 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.
-
__init__
(file)¶ Load a .gro file.
The atom positions can be retrieved by calling getPositions().
Parameters: file (string) – the name of the file to load
Methods
__init__
(file)Load a .gro file. getNumFrames
()Get the number of frames stored in the file. getPeriodicBoxVectors
([frame])Get the vectors defining the periodic box. getPositions
([asNumpy, frame])Get the atomic positions. getUnitCellDimensions
([frame])Get the dimensions of the crystallographic unit cell. -
getNumFrames
()¶ Get the number of frames stored in the file.
-
getPositions
(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
-
getPeriodicBoxVectors
(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
-
getUnitCellDimensions
(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
-