-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenMM/OpenFF interfaces fail for multi-component molecules #191
Comments
Based on trace back (above) I think the issue is in molecule = Molecule.from_rdkit(
rdmol=rdkit_mol,
allow_undefined_stereo=True,
hydrogens_are_explicit=True,
)
if self._partial_charges_method == "mmff94":
molecule.assign_partial_charges(
self._partial_charges_method,
toolkit_registry=RDKitToolkitWrapper(),
)
if self._partial_charges_method == "espaloma-am1bcc":
molecule.assign_partial_charges(
self._partial_charges_method,
toolkit_registry=EspalomaChargeToolkitWrapper(),
)
topology = molecule.to_topology() From:
I propose replacing the lines above in our code with something like (and # Get disconnected molecules (maybe there is a better way to do this with rdkit).
disconnected_molecules = list(get_disconnected_components(mol).values())
# Make OpenFF Molecules.
for disconnected in disconnected_molecules:
molecule = Molecule.from_rdkit(
rdmol=disconnected.to_rdkit_mol(),
allow_undefined_stereo=True,
hydrogens_are_explicit=True,
)
if self._partial_charges_method == "mmff94":
molecule.assign_partial_charges(
self._partial_charges_method,
toolkit_registry=RDKitToolkitWrapper(),
)
if self._partial_charges_method == "espaloma-am1bcc":
molecule.assign_partial_charges(
self._partial_charges_method,
toolkit_registry=EspalomaChargeToolkitWrapper(),
)
# Parse to Topology.
topology = .from_molecules(openff_molecules) |
Rereading the error, they offer rdkit_mol = mol.to_rdkit_mol()
fragment_mols = rdkit.Chem.AllChem.GetMolFrags(rdkit_mol, asMols=True)
# Iterate and assign the charges....
# Parse to Topology.
topology = .from_molecules(openff_molecules) |
Using
stko.OpenMMEnergy
with anstk.Molecule
with multiple molecules (e.g. host guest system) fails with an error from the openff interchange.The text was updated successfully, but these errors were encountered: