MM (atom typing?) bug

Greetings Avogadro developers!

I sent this to Geoff, but thought that I should probably start trying to fix bugs if I’m going to be using Avogadro for my classes.

Attached are two structures (should be identical) but one was saved as PDB and the other as CML. If you read them in to Avogadro, set up the MMFF94 forcefield and do a single-point energy calculation, you get two different results:

Surprise.pdb : 150.415 kJ/mol
Surprise.cml: -219.643 kJ/mol

Any idea why there’s such a discrepancy? My guess was messed-up atom-typing on read-in. Any ideas which bit of code I should be looking at to find the error?

Best regards,

–Dan

Attached are two structures (should be identical) but one was saved as PDB and the other as CML. If you read them in to Avogadro, set up the MMFF94 forcefield and do a single-point energy calculation, you get two different results:

Surprise.pdb : 150.415 kJ/mol
Surprise.cml: -219.643 kJ/mol

Any idea why there’s such a discrepancy? My guess was messed-up atom-typing on read-in. Any ideas which bit of code I should be looking at to find the error?

I can tell you this. There is definitely different atom typing:

< PDB vs. > CML:
< 26 C 3
< 27 O 7

26 C 2
27 O 35
32c32
< 31 N 10


31 N 8
38c38
< 37 H 28


37 H 23

So the difference here is that PDB types the C as some sort of carbonyl (rather than a generic sp2 carbon), the O as a carbonyl or amide, the N as an amide, rather than a generic amine, and the H as an amide rather than a generic amine.

In short, the PDB looks like the correct typing! No, I don’t quite know why the CML typing is “more generic,” although it’s possible the PDB records helped – if you look at the PDB, you can see each residue correctly listed.

The atom typing for MMFF94 is in Open Babel: src/forcefields/forcefieldmmf94.cpp.

Hope that helps,
-Geoff