System preparation¶
autopath.preparation.SystemPreparation ¶
Prepare a solvated or membrane-embedded simulation system for OpenMM MD.
Orchestrates ligand parametrization (via OpenFF, GAFF, or Espaloma),
protein loading, residue-variant assignment, solvation or membrane
embedding, and OpenMM system creation. Writes a system.xml,
system.pdb, and AMBER-compatible topology/coordinate files to
out_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
forcefield
|
list of str
|
OpenMM ForceField XML files to load. Defaults to AMBER14 with TIP3P-FB water. |
['amber14-all.xml', 'amber14/tip3pfb.xml', 'amber/tip3pfb_HFE_multivalent.xml']
|
lig_ff
|
str
|
Ligand force field including version, e.g. |
'openff-2.3.0'
|
hydrogenMass
|
float
|
Hydrogen mass in amu for mass repartitioning. 1.5 amu allows a
4 fs timestep. Set to |
1.5
|
boxShape
|
str
|
Solvent box shape: |
'dodecahedron'
|
padding
|
float
|
Minimum distance in nm between the solute and the box edge.
Mutually exclusive with |
1.2
|
num_solvent
|
int
|
Explicit number of solvent molecules to add. Mutually exclusive
with |
None
|
ionicStrength
|
float
|
Salt concentration in molar. |
0.15
|
ions
|
tuple of str
|
|
('Na+', 'Cl-')
|
is_membrane
|
bool
|
When True, add a lipid bilayer instead of bulk solvent. |
False
|
lipid_type
|
str
|
Lipid residue name (e.g. |
'POPC'
|
membrane_relax_iterations
|
int
|
Minimisation iterations run after each of |
0
|
membrane_ligand_z
|
float or None
|
Ligand-only membrane systems: z (nm) of the ligand centroid from the membrane
centre (default 3.0, in the water above the upper leaflet). |
3.0
|
nonbondedCutoff
|
float
|
Nonbonded cutoff in nm. None picks 1.2 nm for CHARMM force fields (any
|
None
|
switchDistance
|
float
|
Lennard-Jones switching distance in nm. None picks 1.0 nm for CHARMM
force fields and 0.9 nm otherwise. Must be below |
None
|
out_dir
|
str
|
Directory where all output files are written. |
'system'
|
run ¶
run(protein: str = None, variants: dict = None, ligands: Union[str, List[tuple[str, str, str]]] = None) -> tuple[System, Topology]
Build, solvate, and parametrize the full simulation system.
Stages:
- Load protein PDB and optionally apply residue variants (protonation states, disulfide bonds, etc.).
- Parametrize and add each ligand to the OpenMM Modeller.
- Solvate with explicit water/ions or embed in a lipid bilayer.
- Create the OpenMM System with PME electrostatics and HBond constraints.
- Write
system.xml,system.pdb, and AMBER topology / coordinate files toself.out_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
protein
|
str
|
Path to the prepared protein PDB file. None builds a ligand-only box
(requires |
None
|
variants
|
dict
|
Residue variant map passed to |
None
|
ligands
|
str or list of tuple
|
Either a single SDF/PDB path (str) or a list of
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
Fully parametrized OpenMM System object. |
topology |
Topology
|
Topology of the solvated/membrane system. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If membrane building fails. |
Exception
|
Re-raised if the protein PDB cannot be loaded. |
autopath.pdb_preprocessor.PDBPreprocessor ¶
Prepare a PDB for MD simulation using PDBFixer and MDAnalysis.
Wraps PDBFixer to fix missing atoms/residues, replace non-standard residues, add hydrogens at a target pH, and optionally cap chain termini with ACE/NME capping groups.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pdbfile
|
str or file - like
|
Path to the input PDB file, or an already-open file object / StringIO. |
None
|
pdbxfile
|
str or file - like
|
Same for PDBx/mmCIF input. Mutually exclusive with pdbfile. |
None
|
fix ¶
fix(replace_nonstandard_residues: bool = True, keep_heterogens: bool = False, ignore_terminal_missing_residues: bool = False, pH: float = 7.4, discard_input_hydrogens: bool = False, cap_termini: bool = False) -> PDBFixer
Fix common PDB problems and optionally cap chain termini.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
replace_nonstandard_residues
|
bool
|
Replace non-standard residues with their standard equivalents. |
True
|
keep_heterogens
|
bool
|
If False, remove all heterogens except water. |
False
|
ignore_terminal_missing_residues
|
bool
|
If True, missing residues at the very beginning or end of a chain are not modelled in. |
False
|
pH
|
float
|
pH used to determine protonation states when adding hydrogens. |
7.4
|
discard_input_hydrogens
|
bool
|
Remove all hydrogens from the input before re-adding them at the requested pH. Useful when input protonation states are incorrect. |
False
|
cap_termini
|
bool
|
Add ACE (N-terminus) and NME (C-terminus) capping groups to each chain. Chains that already carry ACE or NME are not double-capped. |
False
|
Returns:
| Type | Description |
|---|---|
PDBFixer
|
The PDBFixer object with the fixed, protonated (and optionally capped) structure. |