Create a .offxml file from a .xml file #39
-
I am currently trying to run some code which has incorporated SMIRNOFF, and I want use a custom forcefield I created. This forcefield is in the .XML format (lets call it thing.xml), but when I try to use it the system_generators.py script throws the error "ValueError: No registered small molecule template generators could load force field 'thing.xml'". This makes sense, as the file is in the .XML format and not the .offxml format. Is it possible to create a .offxml file based off of a .XML file? I see that there are many ways to do the reverse, but I am yet to find a simple way to do .XML -> .offxml. I assume I have just not found the right way to do this, or is it really impossible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
No, if your force field is "OpenMM" style and written to be loaded by It's possible, though at times scientifically dubious, to use different force field representations alongside each other, applying each to different components of a chemical topology. If that's what you're trying to do, please share some code that reproduces this error and we may be able to guide you towards a solution. |
Beta Was this translation helpful? Give feedback.
-
I see, thank you for your response. I will look if I can find a workaround for the error ValueError: No registered small molecule template generators could load force field 'thing.xml'", perhaps by circumventing the use of Smirnoff. I am not trying to use multiple force field representations alongside each other, so I will close this comment. |
Beta Was this translation helpful? Give feedback.
No, if your force field is "OpenMM" style and written to be loaded by
openmm.app.ForceField
, that force field is not a SMIRNOFF force field and can't be meaningfully rewritten to.offxml
format. (It's not just a matter of inter-converting files, the actual contents thereof are meaningfully different. For starters, SMIRNOFF force fields do not use atom types which are central to all other force fields. It's sometimes possible to port force fields between representations but that's not a path we recommend going down.)It's possible, though at times scientifically dubious, to use different force field representations alongsi…