Skip to content
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

[DRAFT] PR for interfacing out parameterization #12

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

annamarieweber
Copy link
Collaborator

No description provided.

@xperrylinn
Copy link
Collaborator

Nice!

@@ -226,17 +226,13 @@ def get_input_set(
openff_topology = get_openff_topology(openff_counts)
openmm_topology = openff_topology.to_openmm()

assert np.all(ffs == ffs[0]), "All Molecules must use the same force field"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I had previously implemented but this isn't generally true.

  1. We might want to parameterize water differently than everything else.
  2. We might need to include a few custom parameters from another force field.

You don't need to implement either, but it'd be good to stay flexible so we can add these later on.

INTERCHANGE_PARAMETERIZER: dict[str,str] = {
"sage": ["openff_unconstrained-2.0.0.offxml"]
}
DEFAULT_PARAMETERIZER: dict[str,str] = {
Copy link
Owner

@orionarcher orionarcher Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interchange should probably be the default parameterizer.

Comment on lines +123 to +125
force_field = ForceField(*(self.parameterizer_type.value.get(self.force_field)))

system = force_field.createSystem(topology=self.topology, nonbondedMethod=NoCutoff, polarization='mutual', mutualInducedTargetEpsilon=0.00001,constraints=None, rigidWater=False)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is so straightforward!

@@ -192,6 +193,7 @@ def get_coordinates(
]
coords = Molecule.from_sites(sites)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I first implemented this I used a raw Molecule call to pymatgen.core.structure.Molecule but in hindsight that was a mistake. In the codebase, there is also a openff.toolkit.Molecule, an Openbabel Molecule, and an RDkit Molecule. For openff, I import openff.toolkit as tk and then call tk.Molecule. Let's replicate that for the pymatgen object too.

A few options:

import pymatgen.core.structure.Molecule as pmg_Molecule
import pymatgen.core.structure # then use structure.Molecule
import pymatgen.core.structure as pmg # then use pmg.Molecule

I'll make a pass through the rest of the codebase to ferret this out.

Copy link
Owner

@orionarcher orionarcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants