openforcefield / amber-ff-porting

Scratch space for porting amber FFs into SMIRNOFF format
1 stars 3 forks source link

Problem with histidine chemical perception #12

Open j-wags opened 4 years ago

j-wags commented 4 years ago

David Cerutti 22:38 Testing the script for computing energies, it is now getting stuck at HID, HIE, and HIP. I have commented those out and the thing picks up right at ILE, then LEU, up to TRP (thought so!) which again hits a snag. The complaint is that AngleHandler (always angle related) cannot find relevant valence terms. For TRP:

- Topology indices (8, 10, 11): names and elements ( C), ( C), ( H),
- Topology indices (28, 30, 31): names and elements ( C), ( N), ( H),
- Topology indices (10, 8, 28): names and elements ( C), ( C), ( C),
- Topology indices (6, 8, 9): names and elements ( N), ( C), ( H),
- Topology indices (9, 8, 28): names and elements ( H), ( C), ( C),
- Topology indices (8, 10, 13): names and elements ( C), ( C), ( C),
- Topology indices (4, 6, 8): names and elements ( C), ( N), ( C),
- Topology indices (8, 10, 12): names and elements ( C), ( C), ( H),
- Topology indices (14, 13, 27): names and elements ( C), ( C), ( C),
- Topology indices (21, 23, 25): names and elements ( C), ( C), ( C),
- Topology indices (19, 21, 23): names and elements ( C), ( C), ( C),
- Topology indices (6, 8, 10): names and elements ( N), ( C), ( C),
- Topology indices (16, 18, 27): names and elements ( N), ( C), ( C),
- Topology indices (19, 18, 27): names and elements ( C), ( C), ( C),
- Topology indices (13, 14, 16): names and elements ( C), ( C), ( N),
- Topology indices (21, 23, 24): names and elements ( C), ( C), ( H),
- Topology indices (19, 21, 22): names and elements ( C), ( C), ( H),
- Topology indices (10, 13, 27): names and elements ( C), ( C), ( C),
- Topology indices (12, 10, 13): names and elements ( H), ( C), ( C),
- Topology indices (17, 16, 18): names and elements ( H), ( N), ( C),
- Topology indices (18, 19, 20): names and elements ( C), ( C), ( H),
- Topology indices (24, 23, 25): names and elements ( H), ( C), ( C),
- Topology indices (10, 13, 14): names and elements ( C), ( C), ( C),
- Topology indices (18, 19, 21): names and elements ( C), ( C), ( C),
- Topology indices (11, 10, 12): names and elements ( H), ( C), ( H),
- Topology indices (20, 19, 21): names and elements ( H), ( C), ( C),
- Topology indices (13, 27, 25): names and elements ( C), ( C), ( C),
- Topology indices (28, 30, 32): names and elements ( C), ( N), ( C),
- Topology indices (23, 25, 27): names and elements ( C), ( C), ( C),
- Topology indices (11, 10, 13): names and elements ( H), ( C), ( C),
- Topology indices (6, 8, 28): names and elements ( N), ( C), ( C),
- Topology indices (7, 6, 8): names and elements ( H), ( N), ( C),
- Topology indices (23, 25, 26): names and elements ( C), ( C), ( H),
- Topology indices (18, 27, 25): names and elements ( C), ( C), ( C),
- Topology indices (5, 4, 6): names and elements ( O), ( C), ( N),
- Topology indices (9, 8, 10): names and elements ( H), ( C), ( C),
- Topology indices (8, 28, 30): names and elements ( C), ( C), ( N),
- Topology indices (29, 28, 30): names and elements ( O), ( C), ( N),
- Topology indices (16, 18, 19): names and elements ( N), ( C), ( C),
- Topology indices (8, 28, 29): names and elements ( C), ( C), ( O),
- Topology indices (22, 21, 23): names and elements ( H), ( C), ( C),
- Topology indices (14, 16, 17): names and elements ( C), ( N), ( H),
- Topology indices (26, 25, 27): names and elements ( H), ( C), ( C),
- Topology indices (14, 16, 18): names and elements ( C), ( N), ( C),
- Topology indices (15, 14, 16): names and elements ( H), ( C), ( N),
- Topology indices (13, 27, 18): names and elements ( C), ( C), ( C),
- Topology indices (1, 4, 6): names and elements ( C), ( C), ( N),
- Topology indices (13, 14, 15): names and elements ( C), ( C), ( H),
- Topology indices (4, 6, 7): names and elements ( C), ( N), ( H),

22:39 The rest seem fine.

j-wags commented 4 years ago

I'm able to reproduce this on my computer with the latest Toolkit version.

This is probably a general chemical perception problem (not specific to Angles -- AngleHandler just runs first and thus is the first to report the exception).

My current prime suspect is aromaticity. There may be something weird going on with Histidine's side chain, such that it's perceived differently when we load it to generate the SMARTS vs. when we load it to parameterize the molecule.

j-wags commented 4 years ago

This bug reproduces when I only make an OFFXML for MainChain/HID, and then try to parameterize the same.

The OFFXML reports the following SMARTS:

                <Atom smirks="[H]C1=C([N:1](C(=N1)[H])[H])C([H])([H])[C@@]([H])([C]=O)[N][H]" epsilon="0.16999999991766696 * mole**-1 * kilocalorie" id="MainChain-HID_NA" sigma="3.2499985240310356 * angstrom"></Atom>

The parameterization reports the following OFFMol.to_smiles output:

[H]C1=C(N(C(=N1)[H])[H])C([H])([H])[C@@]([H])(C(=O)N([H])C([H])([H])[H])N([H])C(=O)C([H])([H])[H]
j-wags commented 4 years ago

I think I've fixed this by forcing the SMARTS and molecule to have their aromaticity re-perceived using the same aromaticity model in OpenEyeToolkitWrapper.find_smarts_matches.

Working on this in the OFF Toolkits stereo_smarts_search branch https://github.com/openforcefield/openforcefield/pull/649

j-wags commented 3 years ago

Until then, we should use a development build of the OpenFF toolkit, tuned to the stereo-smarts-search branch when running the FF porting workflow.

j-wags commented 3 years ago

This is blocked by an external dependency -- It will be resolved when the above-cited PR is merged and released in a stable OFFTK package.

j-wags commented 3 years ago

https://github.com/openforcefield/openforcefield/pull/649 has been merged, but isn't yet in a stable release.