Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG/Query: reproducer for gen_coords failure with gen_ff_clean branch #396

Closed
tylerjereddy opened this issue Nov 24, 2024 · 2 comments
Closed

Comments

@tylerjereddy
Copy link

@fgrunewald @pckroon @ricalessandri thanks for all the help with gh-390 so far--I'm now stuck on the last step--generating the final SEBS polymer coordinate file with gen_coords. I ran into an issue over the weekend so I created another minimum viable reproducer repo at https://github.com/tylerjereddy/polyply_gen_coords_sebs_repro where you can run python repro.py in a Python env that has the above polyply branch installed to reproduce the traceback below the fold.

Traceback (most recent call last):
  File "/home/treddy/rough_work/polyply_gen_coords_sebs_repro/repro.py", line 13, in <module>
    main()
  File "/home/treddy/rough_work/polyply_gen_coords_sebs_repro/repro.py", line 5, in main
    gen_coords("assets/topology.top",
  File "/home/treddy/python_venvs/py_311_hemd/lib/python3.11/site-packages/polyply/src/gen_coords.py", line 266, in gen_coords
    skip_filter=skip_filter).run_system(topology)
                             ^^^^^^^^^^^^^^^^^^^^
  File "/home/treddy/python_venvs/py_311_hemd/lib/python3.11/site-packages/polyply/src/processor.py", line 31, in run_system
    mols.append(self.run_molecule(molecule))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/treddy/python_venvs/py_311_hemd/lib/python3.11/site-packages/polyply/src/generate_templates.py", line 328, in run_molecule
    self.gen_templates(meta_molecule, template_graphs)
  File "/home/treddy/python_venvs/py_311_hemd/lib/python3.11/site-packages/polyply/src/generate_templates.py", line 306, in gen_templates
    self.volumes[graph_hash] = compute_volume(block,
                               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/treddy/python_venvs/py_311_hemd/lib/python3.11/site-packages/polyply/src/generate_templates.py", line 197, in compute_volume
    rad = float(nonbond_params[frozenset([atom_key, atom_key])]["nb1"])
                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: frozenset({'hc'})

Also, feel free to ask me to do some work here--if you think it is a bug and needs a regression test I can try to take a look with some guidance. Or maybe it is just user error?

@fgrunewald
Copy link
Member

hi @tylerjereddy the OPLS topology file does not include the same atomtype labels as referenced in the itp file. I think antechamber assign new labels when it generates an OPLS topolgy. If you use the topology from my branch it should work. Let me know if it doesn't.

Since you have all bonded interactions defined in the itp file it should also be OK to just add the missing entries on top of the OPLS force field file. The cross interactions are determined by combination rules anyways.

@tylerjereddy
Copy link
Author

@fgrunewald ah very nice, looks like I just need to add smiles_molecule.acpype/smiles_molecule_GMX.itp to my includes and it works, at least for a small test polymer. Ok, I'll close this then, that's basically user error I guess, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants