polymerist.mdtools.openmmtools.serialization

For reading OpenMM components from files and writing OpenMM components to files

Submodules

Attributes

StateLike

DEFAULT_STATE_PROPS

Classes

SimulationPaths

Encapsulates Paths to various files associated with an OpenMM Simulation

Functions

load_state_flexible(→ Optional[openmm.State])

Allows one to flexibly load an OpenMM state, either from a State object or file-like object

serialize_state_from_context(→ None)

For saving State data within an existing OpenMM Context to file

apply_state_to_context(→ None)

For applying saved State data to an existing OpenMM Context

serialize_system(→ None)

For saving an existing OpenMM System to file

serialize_openmm_pdb(→ None)

Configure and write an Protein DataBank File from an OpenMM Topology and array of positions

serialize_topology_from_simulation(→ None)

Saves a PDB of the current state of a simulation's Topology

Package Contents

class polymerist.mdtools.openmmtools.serialization.SimulationPaths[source]

Encapsulates Paths to various files associated with an OpenMM Simulation

parameters_path: pathlib.Path | None = None
paths_path: pathlib.Path | None = None
system_path: pathlib.Path | None = None
topology_path: pathlib.Path | None = None
state_path: pathlib.Path | None = None
checkpoint_path: pathlib.Path | None = None
trajectory_path: pathlib.Path | None = None
state_data_path: pathlib.Path | None = None
time_data_path: pathlib.Path | None = None
spatial_data_path: pathlib.Path | None = None
init_top_and_sys_paths(out_dir: pathlib.Path, prefix: str, record: bool = True) tuple[pathlib.Path, pathlib.Path][source]

Initialize Topology and System output paths for a given directory

classmethod from_dir_and_parameters(out_dir: pathlib.Path, prefix: str, sim_params: polymerist.mdtools.openmmtools.parameters.SimulationParameters, touch: bool = True) SimulationPaths[source]

Create file directory and initialize simulationPaths object from a set of SimulationParameters

polymerist.mdtools.openmmtools.serialization.StateLike
polymerist.mdtools.openmmtools.serialization.DEFAULT_STATE_PROPS: dict[str, bool]
polymerist.mdtools.openmmtools.serialization.load_state_flexible(state: StateLike | None = None) openmm.State | None[source]

Allows one to flexibly load an OpenMM state, either from a State object or file-like object

polymerist.mdtools.openmmtools.serialization.serialize_state_from_context(state_path: pathlib.Path, context: openmm.Context, state_params: dict[str, bool] = None) None[source]

For saving State data within an existing OpenMM Context to file

polymerist.mdtools.openmmtools.serialization.apply_state_to_context(context: openmm.Context, state: openmm.State) None[source]

For applying saved State data to an existing OpenMM Context

polymerist.mdtools.openmmtools.serialization.serialize_system(sys_path: pathlib.Path, system: openmm.System) None[source]

For saving an existing OpenMM System to file

polymerist.mdtools.openmmtools.serialization.serialize_openmm_pdb(pdb_path: pathlib.Path, topology: openmm.app.Topology, positions: numpy.typing.NDArray | list[openmm.Vec3], keep_chain_and_res_ids: bool = True, atom_labeller: polymerist.molfiles.pdb.SerialAtomLabeller | None = None, resname_map: dict[str, str] | None = None) None[source]

Configure and write an Protein DataBank File from an OpenMM Topology and array of positions Provides options to configure atom ID numbering, residue numbering, and residue naming

polymerist.mdtools.openmmtools.serialization.serialize_topology_from_simulation(pdb_path: pathlib.Path, sim: openmm.app.Simulation, keep_ids: bool = False) None[source]

Saves a PDB of the current state of a simulation’s Topology