-
Notifications
You must be signed in to change notification settings - Fork 19
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
Problem when converting Gro/Top to Rst7 #404
Comments
Hi there, we still only have write support for GROMACS alchemical topologies (at least ones set up within BioSimSpace), so this is likely the issue. I'll try to debug this afternoon. Cheers. |
Hmmm, I can't even read the files, which isn't surprising if the topology corresponds to an alchemical system: import BioSimSpace.Sandpit.Exscientia as BSS
BSS.setVerbose(True)
system = BSS.IO.readMolecules(["gromacs.top", "gromacs_out.gro"]) gives:
|
The new sire load interface will give you more information about any warnings or errors when reading files. Add
|
This what I get when I try to read it
|
Ah apologies, I should have attached the |
Okay, I now see the same error. I'll try to work out what term isn't fitting within the AMBER formatting restrictions following conversion. |
It happens if you just use the |
Yes, that's it: import BioSimSpace as BSS
s = BSS.IO.readMolecules("gromacs_out.gro")
m = s[0]
# This fails.
BSS.IO.saveMolecules("test", m, "rst7")
OSError: SireError::io_error: Cannot write the (perhaps some of the ) files as the following errors occurred:
Failed to write the file '/home/lester/Downloads/Archive/test.rst7' using the parser for fileformat 'RST7'. Errors reported by the parser are:
Errors converting the system to a Amber Rst7 format...
Could not write the float at index 126, value '-1039.54' into the specified format AmberFormat( 6 x float[width = 12, precision = 7] ). (call sire.error.get_last_error_details() for more info)
# Delete the velocity property.
m._sire_object = m._sire_object.edit().removeProperty("velocity").molecule().commit()
# Try again. This now works.
BSS.IO.saveMolecules("test", m, "rst7")
['/home/lester/Downloads/Archive/test.rst7'] Does your |
Also, for a quick hack, you could just use the s = BSS.IO.readMolecules(["gromacs.top", "gromacs_out.gro"])
BSS.IO.saveMolecules("test", s, "rst7", property_map={"velocity" : "cheese"})
['/home/lester/Downloads/Archive/test.rst7'] (Obviously this isn't helpful if the velocities are important.) For dealing with the issue more generally, it might be possible to cap the velocities to some maximum value. I'll also check to see whether the unit conversion between GROMACS and AMBER is correct. Cheers. |
Thanks @lohedges, I think I should be handling the velocities correctly, so I guess that means nothing out of the ordinary is happening, just that the velocities are too big for the AMBER format? It might be nice to automatically cap these on write out if there is no other way of doing it. |
I think we need a better error message so that you know the velocities don't fit, and you can choose to cap the velocities (i.e. via a function to cap the velocities before you try to write them to a rst file). My reasoning is that we would lose information and violate our principle of symmetric read/write if we capped the velocities (the system read back in would have different velocities to that were written out). |
Yes, that's a good point. At present this is triggered by the |
Hello,
I have run into an issue when trying to load an alchemical system generated by a GROMACS run, squashing it and writing it out as an AMBER rst7 (writing out to GROMACS Gro is fine). This is the script I used for these inputs:
The most comprehensive error message I managed to get was the following:
I hope it helps to investigate the issue. Many thanks.
The text was updated successfully, but these errors were encountered: