qmmm_pme.common package

Submodules

qmmm_pme.common.file_manager module

A module defining the class and functions needed to load and write files.

class qmmm_pme.common.file_manager.FileManager(working_directory='./')[source]

Bases: object

A class to load and generate inputs and outputs.

Parameters:

working_directory (str) – The current working directory.

end_log(name)[source]

Terminate an existing log file.

Parameters:

name (str) – The directory/name of log file to be terminated.

Return type:

None

load(pdb_list, topology_list, forcefield_list)[source]

Load files necessary to generate a system.

Parameters:
  • pdb_list (list[str]) – The directories containing the PDB files which define the System geometry.

  • topology_list (list[str]) – The directories containing the XML files which define the System topology.

  • forcefield_list (list[str]) – The directories containing the XML files which define the System interactions.

Returns:

Data for the State and Topology record classes.

Return type:

tuple[dict[str, NDArray[np.float64]], dict[str, list[str]], dict[str, list[list[int]]]]

start_csv(name, header)[source]

Utility to start writing a CSV file.

Parameters:
  • name (str) – The directory/name of CSV file to be written.

  • header (str) – The header for the CSV file.

Return type:

None

start_dcd(name, write_interval, num_particles, timestep)[source]

Utility to start writing a DCD file.

Parameters:
  • name (str) – The directory/name of DCD file to be written.

  • write_interval (int) – The interval between successive writes to the DCD file.

  • num_particles (int) – The number of particles in the System.

  • timestep (int | float) – The timestep that the Simulation propagates with, in femtoseconds.

Return type:

None

Note

Based on DCD writer from OpenMM.

start_log(name)[source]

Utility to start writing a log file.

Parameters:

name (str) – The directory/name of log file to be written.

Return type:

None

write_to_csv(name, line)[source]

Write data to an existing CSV file.

Parameters:
  • name (str) – The directory/name of CSV file to be written.

  • lines – The lines to be written to the CSV file.

  • line (str) –

Return type:

None

write_to_dcd(name, write_interval, num_particles, positions, box, frame)[source]

Write data to an existing DCD file.

Parameters:
  • name (str) – The directory/name of DCD file to be written.

  • write_interval (int) – The interval between successive writes to the DCD file.

  • num_particles (int) – The number of particles in the System.

  • positions (NDArray[np.float64]) – The current positions of all atoms in the System, in Angstroms.

  • box (NDArray[np.float64]) – The current box vectors of the System, in Angstroms.

  • frame (int) – The current frame of the Simulation.

Return type:

None

Note

Based on DCD writer from OpenMM.

write_to_log(name, lines, frame)[source]

Write data to an existing log file.

Parameters:
  • name (str) – The directory/name of log file to be written.

  • lines (str) – The lines to be written to the log file.

  • frame (int) – The current frame of the Simulation.

Return type:

None

write_to_pdb(name, positions, box, all_groups, residues, elements, atoms)[source]

Utility to write PDB files with State current coordinates.

Parameters:
  • name (str) – The directory/name of PDB file to be written.

  • positions (NDArray[np.float64]) – The current positions of all atoms in the System, in Angstroms.

  • box (NDArray[np.float64]) – The current box vectors of the System, in Angstroms.

  • all_groups (list[list[int]]) – The indices of all atoms in the System grouped by residue.

  • residues (list[str]) – |residues|

  • elements (list[str]) – The element symbols of all atoms in the Topology of the System object.

  • atoms (list[str]) – …

Return type:

None

Note

Based on PDB writer from OpenMM.

qmmm_pme.common.units module

A module containing unit conversions and constants.

Warning

This module may be deprecated in the near future.

qmmm_pme.common.utils module

A module containing helper functions accessed by multiple classes.

qmmm_pme.common.utils.align_dict(dictionary)[source]

Create a ‘flat’ version of energy dictionary generated by Simulation calculations.

Parameters:
  • energy – The energy calculated by the Simulation.

  • dictionary (dict[str, Any]) –

Returns:

A flattend dictionary of energies.

Return type:

dict[str, float]

qmmm_pme.common.utils.compute_lattice_constants(box)[source]

Calculates length and angle lattice constants.

Returns the lattice constants a, b, c, alpha, beta, and gamma using a set of box vectors for a periodic triclinic system.

Parameters:

box (NDArray[np.float64]) – The current box vectors of the System, in Angstroms.

Returns:

The characteristic lengths of a triclinic box, in Angstroms, and the characteristic angles of a triclinic box, in degrees.

Return type:

tuple[float, float, float, float, float, float]

qmmm_pme.common.utils.compute_least_mirror(i_vector, j_vector, box)[source]

Calculates a least mirror vector.

Returns the least mirror coordinates of i_vector with respect to j_vector given a set of box vectors from a periodic triclinic system.

Parameters:
  • i_vector (ndarray[Any, dtype[float64]]) – Position vector, in Angstroms.

  • j_vector (ndarray[Any, dtype[float64]]) – Reference vector, in Angstroms.

  • box (ndarray[Any, dtype[float64]]) – The current box vectors of the System, in Angstroms.

Returns:

Least mirror vector of the position vector with respect to the reference vector.

Return type:

ndarray[Any, dtype[float64]]

Module contents

A sub-package containing core functionalities, classes, utilities, and constants.