Previous topic

5.17. The Gromacs xtc/trr library libxdrfile

Next topic

6. Selection exporters

This Page

5.18. TRZ trajectory I/O — MDAnalysis.coordinates.TRZ

Classes to read IBIsCO / YASP binary trajectories.

Reads coordinates, velocities and more (see attributes of the Timestep).

class MDAnalysis.coordinates.TRZ.TRZReader(trzfilename, numatoms=None, convert_units=None, **kwargs)[source]

Reads an IBIsCO or YASP trajectory file

Data:
ts

Timestep object containing coordinates of current frame

Methods:
len(trz)

returns the number of frames

for ts in trz

iterates through the trajectory

Format:

TRZ format detailed below, each line is a single fortran write statement, so is surrounded by 4 bytes of metadata In brackets after each entry is the size of the content of each line:

Header::

title(80c) nrec (int4)

Frame::

nframe, ntrj*nframe, natoms, treal (3*int4, real8) boxx, 0.0, 0.0, 0.0, boxy, 0.0, 0.0, 0.0, boxz (real8 * 9) pressure, pt11, pt12, pt22, pt13, pt23, pt33 (real8 *7) 6, etot, ptot, ek, t, 0.0, 0.0 (int4, real8 * 6) rx (real4 * natoms) ry rz vx vy vz

Creates a TRZ Reader

Arguments:
trzfilename

name of input file

numatoms

number of atoms in trajectory, must taken from topology file!

convert_units

converts units to MDAnalysis defaults

close()[source]

Close trz file if it was open

delta[source]

Time step between frames in ps

Assumes that this step is constant (ie. 2 trajectories with different steps haven’t been stitched together) Returns 0 in case of IOError

numatoms[source]

Number of atoms in a frame

numframes[source]

Total number of frames in a trajectory

open_trajectory()[source]

Open the trajectory file

rewind()[source]

Reposition reader onto first frame

class MDAnalysis.coordinates.TRZ.Timestep(arg)[source]

TRZ custom Timestep

Attributes .. attribute:: frame

Index of the frame, (1 based)
numatoms
Number of atoms in the frame (will be constant through trajectory)
time
Current time of the system in ps (will not always start at 0)
pressure
Pressure of the system box in kPa
pressure_tensor
Array containing pressure tensors in order: xx, xy, yy, xz, yz, zz
total_energy
Hamiltonian for the system in kJ/mol
potential_energy
Potential energy of the system in kJ/mol
kinetic_energy
Kinetic energy of the system in kJ/mol
temperature
Temperature of the system in Kelvin

Private Attributes .. attribute:: _unitcell

Unitcell for system. [Lx, 0.0, 0.0, 0.0, Ly, 0.0, 0.0, 0.0, Lz]. Use the attribute dimensions to access this information.
_pos
Position of particles in box (native nm)
_velocities
Velocities of particles in box (native nm/ps)
dimensions[source]

Unit cell dimensions [A,B,C,alpha,beta,gamma].