haddock.modules.refinement.openmm.openmm module

OpenMM Molecular Dynamics refinement module for HADDOCK3.

class haddock.modules.refinement.openmm.openmm.OPENMM(identificator: int, model: PDBFile, path: Path, directory_dict: dict[str, str], params: dict[str, Any])[source]

Bases: object

OPENMM class.

create_solvation_box(solvent_model: str) str | None[source]

Create solvation box for an explicit solvent simulation.

Parameters:

solvent_model (str) – One of the OpenMM’s solvent models.

Returns:

box_path (Optional[str]) – Path to the solvated system

Raises:

Exception – Not able to generate the solvation box.

equilibrate_solvation_box(pdb_filepath: str, solvent_model: str) str | None[source]

Machinery for the equilibration of water in presence of the protein.

Here, the idea is to:
  1. Check if something has to be done

  2. Initiate the system

  3. Construct restrain forces on protein atom positions

  4. Run simulation under restrain

  5. Save new coordinates file

Parameters:
  • pdb_filepath (str) – Path to a water boxed system

  • solvent_model (str) – One of the OpenMM’s solvent models.

Returns:

eq_pdb_filepath (str) – Path to an equilibrated water boxed system, readdy of MD

Raises:

Exception – Unable to preform the equilibration.

generate_output_ensemble(replicas_outputs: list[dict[str, str | list[str]]]) str[source]

Combine all replicas outputs into a single file.

Parameters:

replicas_outputs (list[dict[str, Union[str, list[str]]]]) – List of dictionnary mapping to all simulation replicas outputs.

Returns:

final_openmm_output (str) – Path to the ensemble (composed of the equilibrated, intermediates, and final structure), for all replicas, generated by the module.

get_pdb_filepath(folder: bool | str | None = None) str[source]

Get correct path to pdb file.

Parameters:

folder (str) – Path to folder

handle_chainbreaks(pdb_fpath: str) str[source]
import_constraints()[source]

Cast parameter string to proper openmm constraints.

openmm_pdbfixer()[source]

Call Pdbfixer on the model pdb.

static remove_water_and_ions(input_filepath: str) str[source]

Remove water from the output of an explicit solvent run.

Uses the pdb-tools.pdb_delhetatm() module to do this

NOTE: May produce an issue with TER atoms (Water + ions)

NOTE2: May lead to issue with modified AA e.g: phsophoserine, etc…

Parameters:

input_filepath (str) – Path to the file to be modified

Returns:

output_filepath (str) – Path to the modified file not containing anymore HETATM

run() None[source]

Run openmm simulation.

run_openmm(inputPDBfile: str, output_directory: str, solvent_model: str, replica_index: int) dict[source]

Run openmm simulation of the model pdb.

Parameters:
  • inputPDBfile (str) – Path to the PDB file.

  • output_folder (str) – Path to the output directory.

  • solvent_model (str) – One of the OpenMM’s solvent models.

Returns:

output_files (dict) – Dict holding paths to configurations generated along the simulation