Skip to content

Creation strategies

A creation strategy builds the unmodified OpenMM System from your input, then hands it to the modifications. Choose one with strategy_name in create_alchemical_states. Pass the options of the strategy as keyword arguments to the same call.

strategy_name Input Extra
"openff" (default) SMILES or SDF files and a force field. Packmol builds the box. openff
"sire" Amber (or any Sire-readable) topology and coordinates: top_file, crd_file sire

Before 0.3.0 the default was "sire". If you pass top_file or crd_file without strategy_name, fes-ml stops with an error that tells you to pass strategy_name="sire".

Sire

Dynamics options follow Sire's conventions:

dynamics_kwargs = {
    "timestep": "1fs",
    "cutoff_type": "PME",
    "cutoff": "12A",
    "constraint": "h_bonds",
    "integrator": "langevin_middle",
    "temperature": "298.15K",
    "pressure": "1atm",
    "platform": "cuda",
    "map": {"use_dispersion_correction": True, "tolerance": 0.0005},
}

fes.create_alchemical_states(
    lambda_schedule=schedule,
    alchemical_atoms=ligand,
    strategy_name="sire",
    top_file="system.prm7",
    crd_file="system.rst7",
    dynamics_kwargs=dynamics_kwargs,
)

Results can depend on the Sire version that built the system, so record it with your results.

EMLE

Options of the EMLECalculator go to the EMLEPotential modification:

modifications_kwargs = {"EMLEPotential": {"method": "electrostatic", "backend": "torchani", "device": "cpu"}}

The strategy provides the files and charges EMLE needs. The old emle_kwargs argument still works but is deprecated.

OpenFF

The OpenFF strategy builds the system with the OpenFF toolkit and Interchange. Dynamics settings are those of Interchange's MDConfig; these are the defaults:

from openff.units import unit as offunit

mdconfig_dict = {
    "periodic": True,
    "constraints": "h-bonds",
    "vdw_method": "cutoff",
    "vdw_cutoff": offunit.Quantity(12.0, "angstrom"),
    "mixing_rule": "lorentz-berthelot",
    "switching_function": True,
    "switching_distance": offunit.Quantity(11.0, "angstrom"),
    "coul_method": "pme",
    "coul_cutoff": offunit.Quantity(12.0, "angstrom"),
}

Solvation options go in packmol_kwargs, passed to Interchange's pack_box; for example a ligand in a cubic cyclohexane box:

packmol_kwargs = {"mass_density": 0.779 * offunit.gram / offunit.milliliter}

See the strategy reference for every option, including partial_charges_method and hydrogen_mass.