shirtsgroup / InterMol

Conversion tool for molecular simulations
MIT License
187 stars 54 forks source link

InterMol selecting the last match for dihedrals? #312

Closed mrshirts closed 7 years ago

mrshirts commented 7 years ago

From David and Paul:

We're suspecting another issue in InterMol to do with dihedrals, which looks like the inverse of the gromacs bug that was fixed last year. It seems like InterMol keeps parsing the list of dihedrals and selects the last one that matches, even if a better match can be found further up in the list.

For OPLS the normal atom types (opls_XXX) correspond to bonded atom types which are a subset of the atom types. E.g. gromacs picks H NA CW X 3 13.38880 0.00000 -13.38880 0.00000 0.00000 0.00000 ;

for a dihedral in the pyrrole ring, where InterMol seems to select X CW NA X 3 11.71520 0.00000 -11.71520 0.00000 0.00000 0.00000 ;

Could it be that intermol does not consider the reverse order for dihedral atoms? (i.e. l k j i as well as i j k l ). In the pyrrole topology we have e.g.: CS CW NA H

dspoel commented 7 years ago

Here is the topology file: https://github.com/dspoel/liquid-simulations/blob/master/FF/GROMACS/OPLS/TOP/GAS/pyrrole.top

dspoel commented 7 years ago

And corresponding gro file: https://github.com/dspoel/liquid-simulations/blob/master/FF/GROMACS/OPLS/GRO/GAS/FLEX/pyrrole_T0.gro.gz

dspoel commented 7 years ago

Looking at code in gromacs_parser.py, is

 def find_dihedraltype(self, bondingtypes, improper):

the routine selecting the dihedral? It does not seem to have any "best match" algorithm as far as I can tell (but maybe I misunderstand).

dspoel commented 7 years ago

The corresponding gromacs source code would be gmxpreprocess/toppush.cpp, function natom_match

ctk3b commented 7 years ago

Close in favor of #319 for now