molecular_simulations.build.build_interface module

Interface-based system building module for DeepDriveMD.

This module provides the InterfaceBuilder class for building molecular systems targeting specific protein-protein interfaces, with support for DeepDriveMD enhanced sampling simulations.

Classes:

InterfaceBuilder: Build systems for interface-targeted simulations.

class molecular_simulations.build.build_interface.InterfaceBuilder(path, pdb, interfaces, target, binder, padding=10.0, protein=True, rna=False, dna=False, polarizable=False)[source]

Bases: ExplicitSolvent

Build systems for driving binding to specific protein interfaces.

For a given target/binder pair, builds systems for driving binding to each of the supplied interfaces using DeepDriveMD. Includes writing the required YAML configuration files for running DeepDrive simulations.

Parameters:
  • path (Path | str) – Base directory path for output files.

  • pdb (str) – Path to input PDB file.

  • interfaces (dict[str, Any]) – Dictionary of interface configurations, keyed by site name (e.g., ‘site0’). Each interface should contain: ‘contact_sel’, ‘distance_sel’, ‘vector’, and ‘com’.

  • target (Path | str) – Path to target protein structure.

  • binder (Path | str) – Path to binder protein structure.

  • padding (float) – Padding around solute in Angstroms. Defaults to 10.0.

  • protein (bool) – Whether to load protein force field. Defaults to True.

  • rna (bool) – Whether to load RNA force field. Defaults to False.

  • dna (bool) – Whether to load DNA force field. Defaults to False.

  • polarizable (bool) – Whether to use polarizable force field. Defaults to False.

interfaces

Dictionary of interface site configurations.

target

MDAnalysis AtomGroup for the target protein.

binder

Path to binder structure file.

root

Root output directory based on target name.

com

Center of mass of the target protein.

Example

>>> interfaces = {
...     "site0": {
...         "contact_sel": "resid 10-50",
...         "distance_sel": "resid 10-50",
...         "vector": [10.0, 0.0, 0.0],
...         "com": [50.0, 50.0, 50.0],
...     }
... }
>>> builder = InterfaceBuilder(
...     path="./build",
...     pdb="complex.pdb",
...     interfaces=interfaces,
...     target="target.pdb",
...     binder="binder.pdb",
... )
>>> builder.build_all()

Initialize the InterfaceBuilder.

__init__(path, pdb, interfaces, target, binder, padding=10.0, protein=True, rna=False, dna=False, polarizable=False)[source]

Initialize the InterfaceBuilder.

build_all()[source]

Build systems for all interface sites.

Iterates through each interface site for the target and builds the corresponding solvated system with the binder positioned near the interface.

Return type:

None

place_binder(vector, com)[source]

Position the binder near the target interface.

Translates the binder structure to be positioned near the interface as defined by the displacement vector.

Parameters:
  • vector (ndarray) – Displacement vector from interface center of mass.

  • com (ndarray) – Center of mass of the interface region.

Return type:

AtomGroup

Returns:

MDAnalysis AtomGroup containing the repositioned binder.

merge_proteins(binder)[source]

Merge target and binder into a single structure.

Combines the target and binder AtomGroups and writes a unified PDB file for subsequent system building.

Parameters:

binder (AtomGroup) – MDAnalysis AtomGroup for the positioned binder.

Return type:

None

parse_interface(site='site0')[source]

Extract configuration data for an interface site.

Parameters:

site (str) – Name of the interface site to parse. Defaults to ‘site0’.

Return type:

list

Returns:

Tuple containing (contact_sel, distance_sel, vector, com, input_shape) for the specified interface site.

write_ddmd_yaml(contact_selection, distance_selection)[source]

Write the DeepDriveMD simulation configuration YAML.

Creates the prod.yaml file containing all settings for running a DeepDriveMD enhanced sampling simulation.

Parameters:
  • contact_selection (str) – MDAnalysis selection string for contact calculations.

  • distance_selection (str) – MDAnalysis selection string for distance calculations.

Return type:

None

write_cvae_yaml(input_shape)[source]

Write the CVAE model configuration YAML.

Creates the cvae-prod-settings.yaml file containing neural network architecture and training hyperparameters.

Parameters:

input_shape (tuple[int, ...]) – Shape of input tensor for the CVAE model, typically (1, N, N) for contact matrices.

Return type:

None