restart_reader

A module containing the RestartFileReader class

Summary

Classes:

RestartFileReader

A class for reading restart files.

Reference

class RestartFileReader(
filename: str,
moldescriptor_filename: str | None = None,
reference_residues: Residues | None = None,
md_engine_format: MDEngineFormat | str = MDEngineFormat.PQ,
)[source]

Bases: BaseReader

A class for reading restart files.

Inherits from the BaseReader class. It reads restart files from the following molecular dynamics engines: - PQ - QMCFC

The restart file of these two md-engines are very similar. Both contain one line including the step information and one line including the box information. The following lines contain the atom information. The atom information is different for the two md-engines. The atom information of the PQ restart file contains the atom name, atom id, residue id, x position, y position, z position, x velocity, y velocity, z velocity, x force, y force and z force. The atom information of the QMCFC restart file contains the atom name, atom id, residue id, x position, y position, z position, x velocity, y velocity, z velocity, x force, y force, z force, x pos of previous step, y pos of previous step, z pos of previous step, x vel of previous step, y vel of previous step, z vel of previous step, x force of previous step, y force of previous step and z force of previous step. The old values are ignored.

For more information on how the restart file of PQ simulations is structured, see the corresponding documentation of the PQ code.

Parameters:
  • filename (str) – The filename of the restart file.

  • moldescriptor_filename (str, optional) – The filename of the moldescriptor file that is read by the MoldescriptorReader to obtain the reference residues of the system, by default None

  • reference_residues (Residues, optional) – The reference residues of the system, in general these are obtained by the MoldescriptorReader - only used if moldescriptor_filename is None, by default None

  • md_engine_format (MDEngineFormat | str, optional) – The format of the restart file, by default MDEngineFormat.PQ

read() AtomicSystem[source]

Reads the restart file and returns an AtomicSystem and an Np1DIntArray containing the molecular types.

It reads the restart file and extracts the box information and the atom information. The atom information is then used to create an AtomicSystem object. The box information is used to create a Cell object. The AtomicSystem and the Cell are then used to create a Frame object.

If a moldescriptor file is given, the molecular types are read from the moldescriptor file and added to the Topology of the Frame.

Returns:

The AtomicSystem object including the Topology with the molecular types.

Return type:

AtomicSystem

logger = <CustomLogger PQAnalysis.RestartFileReader (INFO)>