frame_reader
A module containing classes for reading a frame from a string.
Summary
Classes:
Base class for frame readers. |
|
A frame reader for extended xyz position frames. |
|
This class provides methods for reading a frame from a string. |
Functions:
Return the frame reader implementation for a trajectory format. |
Reference
- class BaseFrameReader(
- md_format: MDEngineFormat | str = MDEngineFormat.PQ,
Bases:
ABCBase class for frame readers.
Subclasses implement the parsing for a concrete frame format while this class provides shared MD-engine handling and topology construction.
- Parameters:
md_format (MDEngineFormat | str, optional) – The format of the MD engine. Default is “PQ”.
- abstractmethod read(
- frame_string: str,
- topology: Topology | None = None,
- traj_format: TrajectoryFormat | str = TrajectoryFormat.XYZ,
Reads a frame from a string.
- logger = <CustomLogger PQAnalysis.BaseFrameReader (INFO)>
- class ExtXYZFrameReader(
- md_format: MDEngineFormat | str = MDEngineFormat.PQ,
Bases:
BaseFrameReaderA frame reader for extended xyz position frames.
- Parameters:
md_format (MDEngineFormat | str, optional) – The format of the MD engine. Default is “PQ”.
- read(
- frame_string: str,
- topology: Topology | None = None,
- traj_format: TrajectoryFormat | str = TrajectoryFormat.EXTXYZ,
Reads an extended xyz frame from a string.
- logger = <CustomLogger PQAnalysis.ExtXYZFrameReader (INFO)>
- class XYZFrameReader(
- md_format: MDEngineFormat | str = MDEngineFormat.PQ,
Bases:
BaseFrameReaderThis class provides methods for reading a frame from a string. The string can be a single frame or a whole trajectory. The format of the string can be specified with the format parameter. Generally, this class should not be used directly. Instead, the
TrajectoryReaderclass can be used to read a whole trajectory as well as a single frame from a file.For more information about the format of the string, see
TrajectoryFormat.- Parameters:
md_format (MDEngineFormat | str, optional) – The format of the MD engine. Default is “PQ”.
- read(
- frame_string: str,
- topology: Topology | None = None,
- traj_format: TrajectoryFormat | str = TrajectoryFormat.XYZ,
Reads a frame from a string.
- Parameters:
frame_string (str) – The string to read the frame from.
topology (Topology | None, optional) – The topology of the frame. Default is None.
traj_format (TrajectoryFormat | str, optional) – The format of the trajectory. Default is TrajectoryFormat.XYZ.
- Returns:
The frame read from the string.
- Return type:
- Raises:
FrameReaderError – If the given format is not valid.
- read_charges(
- frame_string: str,
Reads the charge values of the atoms in a frame from a string.
- Parameters:
frame_string (str) – The string to read the frame from.
- Returns:
The frame read from the string.
- Return type:
- read_forces(
- frame_string: str,
Reads the forces of the atoms in a frame from a string.
- Parameters:
frame_string (str) – The string to read the frame from.
- Returns:
The frame read from the string.
- Return type:
- read_positions(
- frame_string: str,
Reads the positions of the atoms in a frame from a string.
- Parameters:
frame_string (str) – The string to read the frame from.
- Returns:
The frame read from the string.
- Return type:
- read_velocities(
- frame_string: str,
Reads the velocities of the atoms in a frame from a string.
- Parameters:
frame_string (str) – The string to read the frame from.
- Returns:
The frame read from the string.
- Return type:
- logger = <CustomLogger PQAnalysis.XYZFrameReader (INFO)>
- get_frame_reader(
- traj_format: TrajectoryFormat | str,
- md_format: MDEngineFormat | str = MDEngineFormat.PQ,
Return the frame reader implementation for a trajectory format.