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] Binary AMBER rst files need a "title" attribute #99

Closed
lohedges opened this issue Aug 22, 2023 · 6 comments
Closed

[BUG] Binary AMBER rst files need a "title" attribute #99

lohedges opened this issue Aug 22, 2023 · 6 comments
Labels
bug Something isn't working exscientia Related to work with Exscientia

Comments

@lohedges
Copy link
Contributor

As discovered in Exscientia/biosimspace#22, the binary AMBER restart file requires a title attribute to be used with pmemd for certain simulation types, specifically FEP. (No idea why this is the case.) From testing here all that seems to be required is that a title is present, i.e. it doesn't need to be anything specific.

@lohedges lohedges added bug Something isn't working exscientia Related to work with Exscientia labels Aug 22, 2023
@lohedges
Copy link
Contributor Author

Looking at the code it looks like the title is read. It is also created from the system and appears to be set in the globals section along with the other information that I'm seeing in the file, e.g. applicatiion, program, programVersion, etc? Will try to figure out why it's not appearing. Perhaps the title, which is generated from the system name, is empty, so isn't being written?

@lohedges
Copy link
Contributor Author

Yes, it's because the system name is empty, so no title is written. This patch fixes things. (Feel free to add whatever title you think suitable.) I'll backport to 2023.2.3 so Exs can move forward.

diff --git a/corelib/src/libs/SireIO/amberrst.cpp b/corelib/src/libs/SireIO/amberrst.cpp
index 04f7b93e..39cc87f4 100644
--- a/corelib/src/libs/SireIO/amberrst.cpp
+++ b/corelib/src/libs/SireIO/amberrst.cpp
@@ -293,6 +293,10 @@ void AmberRstFile::writeHeader(const QString &title, int nframes, int natoms,
     {
         globals.insert("title", title);
     }
+    else
+    {
+        globals.insert("title", "sire restart file");
+    }

     // now create the descriptions of all of the dimensions
     QHash<QString, NetCDFDataInfo> dimensions;

@chryswoods
Copy link
Contributor

Thanks - yes, that's the right solution. I think sire restart file is a good enough title :-)

I'll check and test this locally, and will then push it into main and devel without CI/CD as it should all work, and I want to save the GH Actions. It will be ready for a 2023.3.2 release, if we make one, and will definitely be in 2023.4.0.

chryswoods added a commit that referenced this issue Aug 22, 2023
chryswoods added a commit that referenced this issue Aug 22, 2023
…at it is there

in case we make a `2023.3.2` release before `2023.4.0`.

[ci skip]
@chryswoods
Copy link
Contributor

Ok - this is now in main and devel (above two commits). It is a slightly different fix because of the different way the new AmberRst parser constructs the title.

@chryswoods
Copy link
Contributor

also, next issue is #100 :-)

@lohedges
Copy link
Contributor Author

I'm guessing this happened for FEP due to the way that the system was created in BioSimSpace. We do set a default name, but perhaps the route bypassed this somehow. (This happens on conversion from any object to a system.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exscientia Related to work with Exscientia
Projects
None yet
Development

No branches or pull requests

2 participants