Changed in version 0.8.0.
The XTC I/O interface now uses libxdrfile2, which has seeking and indexing capabilities. Note that unlike libxdrfile before it, libxdrfile2 is distributed under the GNU GENERAL PUBLIC LICENSE, version 2 (or higher).
Reading of Gromacs XTC trajectories.
See also
MDAnalysis.coordinates.xdrfile.libxdrfile2 for low-level bindings to the Gromacs trajectory file formats
Timestep for a Gromacs XTC trajectory.
Make a new Timestep containing a subset of the original Timestep.
ts.copy_slice(slice(start, stop, skip)) ts.copy_slice([list of indices])
Returns: | A Timestep object of the same type containing all header information and all atom information relevent to the selection. |
---|
Note
The selection must be a 0 based slice or array of the atom indices in this Timestep
New in version 0.8.
unitcell dimensions (A, B, C, alpha, beta, gamma)
volume of the unitcell
Read Gromacs XTC trajectory.
Arguments: |
---|
sub
an numpy integer array of what subset of trajectory atoms to load into the timestep. Intended to work similarly to the ‘sub’ argument to gromac’s trjconv.
This is usefull when one has a Universe loaded with only an unsolvated protein, and wants to read a solvated trajectory.
The length of this array must be <= to the actual number of atoms in the trajectory, and equal to number of atoms in the Universe.
Returns a writer appropriate for filename.
Sets the default keywords start, step and delta (if available). numatoms is always set from Reader.numatoms.
See also
Reader.Writer() and MDAnalysis.Writer()
Returns a Gromacs TrjWriter for filename with the same parameters as this trajectory.
All values can be changed through keyword arguments.
Arguments: |
|
---|---|
Keywords: |
|
Returns: | appropriate TrjWriter |
Close xdr trajectory file if it was open.
Specific implementation of trajectory closing.
In-place conversion of forces array force from native units to base units.
By default, the input force is modified in place and also returned.
New in version 0.7.7.
In-place conversion of force array force from base units to native units.
By default, the input force is modified in place and also returned.
New in version 0.7.7.
In-place conversion of coordinate array x from native units to base units.
By default, the input x is modified in place and also returned.
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Conversion of coordinate array x from base units to native units.
By default, the input x is modified in place and also returned.
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Convert time t from native units to base units.
By default, the input t is modified in place and also returned (although note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.)
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Convert time t from base units to native units.
By default, the input t is modified in place and also returned. (Also note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.)
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
In-place conversion of velocities array v from native units to base units.
By default, the input v is modified in place and also returned.
New in version 0.7.5.
In-place conversion of coordinate array v from base units to native units.
By default, the input v is modified in place and also returned.
New in version 0.7.5.
Time step length in ps.
The result is computed from the trajectory and cached. If for any reason the trajectory cannot be read then 0 is returned.
Time between two trajectory frames in picoseconds.
Frame number of the current time step.
This is a simple short cut to Timestep.frame.
Loads current trajectory offsets from filename (in numpy format). No error checking is performed.
Arguments: |
|
---|
Forward one step to next frame.
The number of publically available atoms that this reader will store in the timestep.
If ‘sub’ was not given in the ctor, then this value will just be the actual number of atoms in the underlying trajectory file. If however ‘sub’ was given, then this value is the number specified by the ‘sub’ sub-selection.
If for any reason the trajectory cannot be read then a negative value is returned.
Read the number of frames from the trajectory.
The result is cached. If for any reason the trajectory cannot be read then 0 is returned.
This takes a long time because the frames are counted by iterating through the whole trajectory.
Open xdr trajectory file.
Returns: | pointer to XDRFILE (and sets self.xdrfile) |
---|---|
Raises: | IOError with code EALREADY if file was already opened or ENOENT if the file cannot be found |
Position at beginning of trajectory
Saves current trajectory offsets into filename, in numpy format. A ”.npy” suffix will be appended to filename if not already present.
Arguments: |
|
---|
Time of the current frame in MDAnalysis time units (typically ps).
time = Timestep.frame * Reader.dt
Total length of the trajectory numframes * dt.
Write a Gromacs XTC trajectory.
Create a new TrjWriter
Arguments: |
|
---|---|
Keywords: |
|
Changed in version 0.8.0: The TRR writer is now able to write TRRs without coordnates/velocities/forces, depending on the properties available in the Timestep objects passed to write().
Specific implementation of trajectory closing.
Read dimensions from timestep ts and return Gromacs box vectors
In-place conversion of forces array force from native units to base units.
By default, the input force is modified in place and also returned.
New in version 0.7.7.
In-place conversion of force array force from base units to native units.
By default, the input force is modified in place and also returned.
New in version 0.7.7.
In-place conversion of coordinate array x from native units to base units.
By default, the input x is modified in place and also returned.
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Conversion of coordinate array x from base units to native units.
By default, the input x is modified in place and also returned.
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Convert time t from native units to base units.
By default, the input t is modified in place and also returned (although note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.)
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Convert time t from base units to native units.
By default, the input t is modified in place and also returned. (Also note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.)
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
In-place conversion of velocities array v from native units to base units.
By default, the input v is modified in place and also returned.
New in version 0.7.5.
In-place conversion of coordinate array v from base units to native units.
By default, the input v is modified in place and also returned.
New in version 0.7.5.
Returns True if all values are within limit values of their formats.
Due to rounding, the test is asymmetric (and min is supposed to be negative):
min < x <= max
Arguments: |
|
---|---|
Returns: | boolean |
Timestep for a Gromacs XTC trajectory.
Read Gromacs XTC trajectory.
Arguments: |
---|
sub
an numpy integer array of what subset of trajectory atoms to load into the timestep. Intended to work similarly to the ‘sub’ argument to gromac’s trjconv.
This is usefull when one has a Universe loaded with only an unsolvated protein, and wants to read a solvated trajectory.
The length of this array must be <= to the actual number of atoms in the trajectory, and equal to number of atoms in the Universe.
Write a Gromacs XTC trajectory.
Create a new TrjWriter
Arguments: |
|
---|---|
Keywords: |
|
Changed in version 0.8.0: The TRR writer is now able to write TRRs without coordnates/velocities/forces, depending on the properties available in the Timestep objects passed to write().