Acellera / htmd

HTMD: Programming Environment for Molecular Discovery
https://software.acellera.com/docs/latest/htmd/index.html
Other
258 stars 59 forks source link

Parameterize KeyError when starting from ParamChem parameters #170

Closed GerardBCN closed 7 years ago

GerardBCN commented 8 years ago

When using --prm and --rtf flags to start from paramchem parameters, the parameterization fails at the charge fitting step with the following output:

== Minimizing ==

Optimizer: Optimization complete!
Running QM Calculations: 100% (1/1) [#######################################################################################################################] eta --:-- -

 == Charge fitting minimization==

Traceback (most recent call last):
  File "/shared/gerard/anaconda3/bin/parameterize", line 6, in <module>
    sys.exit(htmd.newparameterization.cli.main_parameterize())
  File "/shared/gerard/anaconda3/lib/python3.5/site-packages/htmd/newparameterization/cli.py", line 135, in main_parameterize
    (score, qm_dipole, mm_dipole) = mol.fitCharges()
  File "/shared/gerard/anaconda3/lib/python3.5/site-packages/htmd/newparameterization/ffmolecule.py", line 234, in fitCharges
    self._removeCOM()
  File "/shared/gerard/anaconda3/lib/python3.5/site-packages/htmd/newparameterization/ffmolecule.py", line 208, in _removeCOM
    m =  self._rtf.mass_by_type[ self._rtf.type_by_index[i] ]
KeyError: 'OG2P1'

Working directory in http://pub.htmd.org/MES_PSI4.zip

GerardBCN commented 8 years ago

The command to run parameterization was:

parameterize -m mes.mol2 -n 12 --rtf ff.rtf --prm ff.prm --qmcode PSI4 -c -1

mj-harvey commented 7 years ago

That's working with 1.5.4

GerardBCN commented 7 years ago

I got a similar error, so seems that this bug is still not fixed:

J. Chem. Theory Comput., 2016, 12 (4), pp 1845-1852.
http://pubs.acs.org/doi/abs/10.1021/acs.jctc.6b00049

You are on the latest HTMD version (unpackaged : /shared/gerard/HTMD/htmd/htmd).

 === List of arguments used ===

      exec:  inline
    theory:  B3LYP
 notorsion:  False
     nomin:  False
   freezeq:  None
      list:  False
    qmcode:  Gaussian
     noesp:  False
forcefield:  all
     basis:  cc-pVDZ
     ncpus:  8
    vacuum:  False
    outdir:  ./
       prm:  ff.prm
       rtf:  ff.rtf
       mol:  cmpd4.mol2
   torsion:  all
    charge:  None

[...]

Traceback (most recent call last):
  File "/shared/gerard/anaconda3/bin/parameterize", line 6, in <module>
    sys.exit(htmd.parameterization.cli.main_parameterize())
  File "/shared/gerard/HTMD/htmd/htmd/parameterization/cli.py", line 191, in main_parameterize
    (score, qm_dipole, mm_dipole) = mol.fitCharges(fixed=fixq)
  File "/shared/gerard/HTMD/htmd/htmd/parameterization/ffmolecule.py", line 240, in fitCharges
    self._removeCOM()
  File "/shared/gerard/HTMD/htmd/htmd/parameterization/ffmolecule.py", line 215, in _removeCOM
    m = self._rtf.mass_by_type[self._rtf.type_by_index[i]]
KeyError: 'CLGR1'

I'm using the htmd head version. Current ligand: http://pub.htmd.org/cmpd4.zip

j3mdamas commented 7 years ago

@mj-harvey, I don't know how you fixed this before, but what is happening here is that the .rtf generated by paramchem does not have the MASS entries, and, as such, _removeCOM is failing because it relies on them. Did you make some guessing on those, if the original .rtf did not have them?

mj-harvey commented 7 years ago

Evidently I fixed a different problem! Does this match the problem I sent you earlier?

j3mdamas commented 7 years ago

It's the same problem, as I told Jana. ParamChem .rtf files does not provide MASS entries.

So, we either fail to accept such .rtf files, or use MATCH to guess the MASS entries only?

mj-harvey commented 7 years ago

Ok, I guess I can work around that. Masses aren't hard to guess...

j3mdamas commented 7 years ago

OK Matt, thanks! Let me know, so I can also update Jana.

mj-harvey commented 7 years ago

Fix commited. Please test

j3mdamas commented 7 years ago

@GerardBCN @mj-harvey, just tested with the HEAD, and it guesses fine and does not break.

I am going to answer to Jana too and close this issue.

j3mdamas commented 7 years ago

It will be available on version 1.5.5

j3mdamas commented 7 years ago

3ee96a569cffeda2d3d3aed184b7f2e2ec0ce0b9