Download Notebook View in GitHub Open in Google Colab
Mixing Sage and Amber force fields: BRD4 benchmark
This example applies SMIRNOFF-format parameters to BRD4 inhibitors from the living review on binding free energy benchmark systems by Mobley and Gilson. The BRD4 system comes from the accompanying GitHub repository.
# Retrieve protein and ligand files for BRD4 and a docked inhibitor from the benchmark systems GitHub repository
# https://github.com/MobleyLab/benchmarksets
import requests
repo_url = (
"https://raw.githubusercontent.com/MobleyLab/benchmarksets/master/input_files/"
)
sources = {
"receptor.pdb": repo_url + "BRD4/pdb/BRD4.pdb",
"ligand.pdb": repo_url + "BRD4/pdb/ligand-1.pdb",
"ligand.sdf": repo_url + "BRD4/sdf/ligand-1.sdf",
}
for filename, url in sources.items():
r = requests.get(url)
open(filename, "w").write(r.text)
from openff.toolkit import ForceField, Molecule
Later we will use Interchange.__add__
, which is an experimental feature. It needs to be turned on by setting the environment variable below, and by doing so we accept some stability and accuracy risks.
%env INTERCHANGE_EXPERIMENTAL=1
env: INTERCHANGE_EXPERIMENTAL=1
ligand_molecule = Molecule("ligand.sdf")
sage = ForceField("openff-2.0.0.offxml")
ligand = sage.create_interchange(topology=ligand_molecule.to_topology())
receptor_molecule = Molecule.from_polymer_pdb("receptor.pdb")
ff14sb = ForceField("ff14sb_off_impropers_0.0.3.offxml")
receptor = ff14sb.create_interchange(topology=receptor_molecule.to_topology())
complex_system = receptor + ligand
# TODO
# complex.box = pdbfile box vectors ...
# complex.positions = np.vstack([receptor.positions, ligand.positions])
Warning (not error because allow_undefined_stereo=True): RDMol has unspecified stereochemistry. Undefined chiral centers are:
- Atom C (index 4)
- Atom C (index 26)
- Atom C (index 40)
- Atom C (index 54)
- Atom C (index 68)
- Atom C (index 74)
- Atom C (index 89)
- Atom C (index 91)
- Atom C (index 103)
- Atom C (index 114)
- Atom C (index 136)
- Atom C (index 142)
- Atom C (index 156)
- Atom C (index 186)
- Atom C (index 192)
- Atom C (index 214)
- Atom C (index 238)
- Atom C (index 255)
- Atom C (index 257)
- Atom C (index 269)
- Atom C (index 283)
- Atom C (index 300)
- Atom C (index 319)
- Atom C (index 336)
- Atom C (index 357)
- Atom C (index 376)
- Atom C (index 395)
- Atom C (index 419)
- Atom C (index 435)
- Atom C (index 451)
- Atom C (index 470)
- Atom C (index 492)
- Atom C (index 494)
- Atom C (index 506)
- Atom C (index 525)
- Atom C (index 549)
- Atom C (index 571)
- Atom C (index 588)
- Atom C (index 605)
- Atom C (index 625)
- Atom C (index 635)
- Atom C (index 667)
- Atom C (index 673)
- Atom C (index 693)
- Atom C (index 710)
- Atom C (index 735)
- Atom C (index 741)
- Atom C (index 757)
- Atom C (index 769)
- Atom C (index 779)
- Atom C (index 795)
- Atom C (index 817)
- Atom C (index 836)
- Atom C (index 850)
- Atom C (index 877)
- Atom C (index 883)
- Atom C (index 895)
- Atom C (index 916)
- Atom C (index 937)
- Atom C (index 959)
- Atom C (index 961)
- Atom C (index 978)
- Atom C (index 980)
- Atom C (index 997)
- Atom C (index 1019)
- Atom C (index 1021)
- Atom C (index 1041)
- Atom C (index 1047)
- Atom C (index 1064)
- Atom C (index 1076)
- Atom C (index 1100)
- Atom C (index 1102)
- Atom C (index 1114)
- Atom C (index 1116)
- Atom C (index 1133)
- Atom C (index 1155)
- Atom C (index 1177)
- Atom C (index 1201)
- Atom C (index 1220)
- Atom C (index 1235)
- Atom C (index 1249)
- Atom C (index 1263)
- Atom C (index 1284)
- Atom C (index 1305)
- Atom C (index 1329)
- Atom C (index 1343)
- Atom C (index 1353)
- Atom C (index 1370)
- Atom C (index 1385)
- Atom C (index 1396)
- Atom C (index 1398)
- Atom C (index 1415)
- Atom C (index 1432)
- Atom C (index 1444)
- Atom C (index 1464)
- Atom C (index 1478)
- Atom C (index 1480)
- Atom C (index 1492)
- Atom C (index 1509)
- Atom C (index 1529)
- Atom C (index 1531)
- Atom C (index 1543)
- Atom C (index 1557)
- Atom C (index 1568)
- Atom C (index 1589)
- Atom C (index 1591)
- Atom C (index 1608)
- Atom C (index 1629)
- Atom C (index 1643)
- Atom C (index 1673)
- Atom C (index 1686)
- Atom C (index 1698)
- Atom C (index 1710)
- Atom C (index 1712)
- Atom C (index 1729)
- Atom C (index 1745)
- Atom C (index 1764)
- Atom C (index 1781)
- Atom C (index 1791)
- Atom C (index 1806)
- Atom C (index 1816)
- Atom C (index 1835)
- Atom C (index 1850)
- Atom C (index 1872)
- Atom C (index 1891)
- Atom C (index 1911)
- Atom C (index 1930)
- Atom C (index 1947)
- Atom C (index 1969)
- Atom C (index 1971)
- Atom C (index 1988)
- Atom C (index 2002)
- Atom C (index 2017)
/home/runner/micromamba/envs/openff-docs-examples/lib/python3.10/site-packages/openff/interchange/_experimental.py:35: UserWarning: Interchange object combination is experimental and likely to produce strange results. Any workflow using this method is not guaranteed to be suitable for production. Use with extreme caution and thoroughly validate results!
return func(*args, **kwargs)
Export to OpenMM
complex_system.to_openmm()
<openmm.openmm.System; proxy of <Swig Object of type 'OpenMM::System *' at 0x7fe93e06fc30> >
Export to Amber
# TODO: Fix inferring residue information with mixed topology
if False:
complex_system.to_inpcrd("complex.inpcrd")
complex_system.to_prmtop("complex.prmtop")
Export to GROMACS
complex_system.to_gro("complex.gro")
complex_system.to_top("complex.top")
/home/runner/micromamba/envs/openff-docs-examples/lib/python3.10/site-packages/openff/interchange/interop/gromacs/export/_export.py:46: UserWarning: WARNING: System defined with no box vectors, which GROMACS does not offically support in versions 2020 or newer (see https://gitlab.com/gromacs/gromacs/-/issues/3526). Setting box vectors to a 5 nm cube.
self._write_gro(gro, decimal)