openff-interchange
openff-interchange copied to clipboard
Packmol interface: can't pack mnsol benchmark inputs with assumed evaluator defaults
Description
I'm trying to test if we can pack mnsol (from the 2.0 sage benchmark) with Interchange. My rough understanding (from the paper and some limited looking at the evaluator v3.11 code) is that it was possible to pack all the systems with 2k molecules, a cubic box and a 0.95 * unit.gram/unit.milliliter target density.
However, I can't seem to be able to make this work using Interchange.
The main questions here are:
- Is this a correct assumption for how the sage MNSOL benchmarks were run, or is there more to it that I'm missing?
- Should we be able to reproduce this with Interchange?
- If so, how?
Reproduction
Here's a good example case:
from openff.units import unit
from openff.units.openmm import from_openmm
from openmm import NonbondedForce
from openff.toolkit import Molecule, Topology, ForceField
from openff.interchange.components._packmol import pack_box, UNIT_CUBE
from openff.interchange import Interchange
import pytest
solvent = Molecule.from_smiles('CCCCO')
solvent.generate_conformers()
solvent.assign_partial_charges(partial_charge_method='am1bcc')
ligand = Molecule.from_smiles('CCCCCCCC')
ligand.generate_conformers()
ligand.assign_partial_charges(partial_charge_method='am1bcc')
off_top = Topology.from_molecules(ligand)
solvated_off_top = pack_box(
molecules=[solvent],
number_of_copies=[2000],
solute=off_top,
tolerance=2.0*unit.angstrom,
mass_density=0.95 * unit.gram/unit.milliliter,
box_shape=UNIT_CUBE,
center_solute=True,
working_directory='.',
retain_working_files=False,
)
Output
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
File ~/software/mambaforge/install/envs/openfe/lib/python3.12/site-packages/openff/interchange/components/_packmol.py:718, in pack_box(molecules, number_of_copies, solute, tolerance, box_vectors, mass_density, box_shape, center_solute, working_directory, retain_working_files)
717 try:
--> 718 result = subprocess.check_output(
719 packmol_path,
720 stdin=file_handle,
721 stderr=subprocess.STDOUT,
722 ).decode("utf-8")
723 except subprocess.CalledProcessError as error:
File ~/software/mambaforge/install/envs/openfe/lib/python3.12/subprocess.py:466, in check_output(timeout, *popenargs, **kwargs)
464 kwargs['input'] = empty
--> 466 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
467 **kwargs).stdout
File ~/software/mambaforge/install/envs/openfe/lib/python3.12/subprocess.py:571, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
570 if check and retcode:
--> 571 raise CalledProcessError(retcode, process.args,
572 output=stdout, stderr=stderr)
573 return CompletedProcess(process.args, retcode, stdout, stderr)
CalledProcessError: Command '/home/ialibay/software/mambaforge/install/envs/openfe/bin/packmol' returned non-zero exit status 173.
The above exception was the direct cause of the following exception:
PACKMOLRuntimeError Traceback (most recent call last)
Cell In[8], line 18
15 ligand.assign_partial_charges(partial_charge_method='am1bcc')
17 off_top = Topology.from_molecules(ligand)
---> 18 solvated_off_top = pack_box(
19 molecules=[solvent],
20 number_of_copies=[2000],
21 solute=off_top,
22 tolerance=2.0*unit.angstrom,
23 mass_density=0.95 * unit.gram/unit.milliliter,
24 box_shape=UNIT_CUBE,
25 center_solute=True,
26 working_directory='.',
27 retain_working_files=False,
28 )
File ~/software/mambaforge/install/envs/openfe/lib/python3.12/site-packages/openff/utilities/utilities.py:80, in requires_package.<locals>.inner_decorator.<locals>.wrapper(*args, **kwargs)
77 except Exception as e:
78 raise e
---> 80 return function(*args, **kwargs)
File ~/software/mambaforge/install/envs/openfe/lib/python3.12/site-packages/openff/interchange/components/_packmol.py:725, in pack_box(molecules, number_of_copies, solute, tolerance, box_vectors, mass_density, box_shape, center_solute, working_directory, retain_working_files)
723 except subprocess.CalledProcessError as error:
724 if "173" in str(error):
--> 725 raise PACKMOLRuntimeError from error
727 packmol_succeeded = result.find("Success!") > 0
729 if not packmol_succeeded:
PACKMOLRuntimeError:
Software versions
Interchange v0.3.29