shirtsgroup / InterMol

Conversion tool for molecular simulations
MIT License
185 stars 53 forks source link

Issue when converting from Desmond input to LAMMPS output #383

Open dadrion opened 2 years ago

dadrion commented 2 years ago

Hello, I am reaching out about an issue that I am having with converting from the MD output from a Desmond calculation (.cms format) to the trajectory output from LAMMPS (.lammpstrj format), which I want to use for some post processing. I am getting the following error:

Traceback (most recent call last):
  File "/Users/lopezlab/Downloads/InterMol/intermol/convert.py", line 811, in <module>
    main()
  File "/Users/lopezlab/Downloads/InterMol/intermol/convert.py", line 226, in main
    system, prefix = _load_desmond(cms_in=cms_in)
  File "/Users/lopezlab/Downloads/InterMol/intermol/convert.py", line 589, in _load_desmond
    system = des.load(cms_file=cms_in)
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 40, in load
    return parser.read()
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 1170, in read
    self.load_ffio_block(molname, self.ffio_blockpos[i], self.fmct_blockpos[i+1]-1)
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 925, in load_ffio_block
    self.sysDirective[type](*params)
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 579, in parse_bonds
    new_bond = self.create_forcetype(self.desmond_bonds[key], atoms, params)

I have tried using the --energy option when running also just to test if this would help, but it did not. I am happy to answer any follow up questions. I have also attached my .cms file in text format for reference. Thanks! cyp_dmso_nvt-out.txt

ctk3b commented 2 years ago

Hi @dadrion - could you post the full traceback? I don't see an error

dadrion commented 2 years ago

@ctk3b my apologies, I seem to have left out the error part, here is all of the output that I get after the command line

INFO 2022-03-02 16:29:38 Beginning InterMol conversion

INFO 2022-03-02 16:29:38 InterMol is research software. If you make use of InterMol in scientific publications please cite the following reference:
Shirts, M.R., Klein, C., Swails, J.M. et al. J Comput Aided Mol Des (2016). doi:10.1007/s10822-016-9977-1

Traceback (most recent call last):
  File "/Users/lopezlab/Downloads/InterMol/intermol/convert.py", line 811, in <module>
    main()
  File "/Users/lopezlab/Downloads/InterMol/intermol/convert.py", line 226, in main
    system, prefix = _load_desmond(cms_in=cms_in)
  File "/Users/lopezlab/Downloads/InterMol/intermol/convert.py", line 589, in _load_desmond
    system = des.load(cms_file=cms_in)
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 40, in load
    return parser.read()
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 1170, in read
    self.load_ffio_block(molname, self.ffio_blockpos[i], self.fmct_blockpos[i+1]-1)
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 925, in load_ffio_block
    self.sysDirective[type](*params)
  File "/Users/lopezlab/miniconda3/envs/AmberTools21/lib/python3.9/site-packages/intermol/desmond/desmond_parser.py", line 579, in parse_bonds
    new_bond = self.create_forcetype(self.desmond_bonds[key], atoms, params)
KeyError: 'INVALID'
ctk3b commented 2 years ago

I'm not very familiar with the .cms format anymore but the error message is telling you that the bond type INVALID is not supported. We only support HARM and HARM_CONSTRAINTED

Looking at your .cms file, there appear to be a bunch of bond types labeled INVALID or INVALID_CONSTRAINED