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

Compare parameters #8

Open
slochower opened this issue Mar 2, 2018 · 4 comments
Open

Compare parameters #8

slochower opened this issue Mar 2, 2018 · 4 comments

Comments

@slochower
Copy link
Owner

Write a loop to spit out parameter comparisons.

We have the atom mapping, so we can easily loop through atoms and should be able to do a direct comparison.

For bonds, I'm a little less clear because the bond order is not going to be the same in each structure. One thought is to create a dictionary or set, and compare the set by keys.

@davidlmobley
Copy link
Collaborator

Compare parameters between what and what? I might know a trick to make traversing the bonds easy for you.

@slochower
Copy link
Owner Author

I'd like to generalize the loop at the bottom of the first notebook:

for smirnoff_bond, reference_bond in zip(merged.bonds, reference.bonds):
[...]

to spit out places where the starting parameters (GAFF v1.7, GAFF v1.8, whatever...) are different from the SMIRNOFF99Frosst ones, for the molecules under consideration. I just haven't gotten around to it yet and used this Issue to make a quick note to myself, but if you have a way to do it, I'd love to take a look!

@davidlmobley
Copy link
Collaborator

I'm not looking at the code right now as I just have a moment,but I agree it's easiest if your atoms are in the same order (seems like this would be easy if you start with the same mol2 files for each force field); then if you read them as an OEMol your bonds should also be in the same order and then you can also just loop over atoms and bonds and cross-check.

If not, then you could make each molecule in consideration into an object (OEMol or OpenMM Topology or similar) where it's easy to traverse over bonds. Then, loop over atoms in one molecule (A), use your atom mapping to look up the corresponding atoms in the other molecule (B), then loop over the bonds in A connected to your atom of interest. Each bond involves a pair of atoms in A; since you know the atom indices in B from your mapping, you can identify the corresponding bond in B, so there should be no problem.

This notebook has SOME overlap with what you're trying to do; it compares a SMIRNOFF forcefield with a parm@Frosst forcefield on a set of molecules and whenever it finds an energetic difference, drills down to identify the specific parameters/force terms which are responsible for the difference and prints out exactly how they differ between the two force fields.https://github.com/openforcefield/openforcefield/blob/master/utilities/SMIRNOFF_vs_frosst/SMIRNOFF_vs_frosst.ipynb

@slochower
Copy link
Owner Author

I'm not looking at the code right now as I just have a moment,but I agree it's easiest if your atoms are in the same order (seems like this would be easy if you start with the same mol2 files for each force field); then if you read them as an OEMol your bonds should also be in the same order and then you can also just loop over atoms and bonds and cross-check.

Exactly. In the first example notebook, this is true. In the second example notebook, this is not the case because dummy atoms get shuffled, changing all the atom indexing. In general, this is not a problem because I can create a dictionary that maps between atoms in one structure and another (thanks to you).

This notebook has SOME overlap with what you're trying to do; it compares a SMIRNOFF forcefield with a parm@Frosst forcefield on a set of molecules and whenever it finds an energetic difference, drills down to identify the specific parameters/force terms which are responsible for the difference and prints out exactly how they differ between the two force fields.https://github.com/openforcefield/openforcefield/blob/master/utilities/SMIRNOFF_vs_frosst/SMIRNOFF_vs_frosst.ipynb

Fantastic. This looks great. In the near future, once we have ΔG binding data for SMIRNOFF99Frosst, it will be good to see if we can rationalize the differences relative to, e.g., GAFF, by looking at where the parameter sets differ. The first priority now is to setup and do the calculations.

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

No branches or pull requests

2 participants