BioSimSpace icon indicating copy to clipboard operation
BioSimSpace copied to clipboard

Fix offset when injecting position restraints into GROMACS top file

Open lohedges opened this issue 3 years ago • 3 comments

This PR fixes the offset used when injecting the inclusion of external posre*.itp files into a GROMACS topology. The logic used previously meant that the offset was incorrect, meaning that the #include ... directive was injected at the wrong position when more than one molecule type was present in the topology, potentially overwriting existing records for bonded terms.

@msuruzhon: I appreciate that this fix is applied to an outdated version of the sandpit, but at least you can copy into your development version to test. If it's easier, I could also apply to the sandpit on the merge-exs-devel branch, where I am attempting to synchronise things for the 2023 Sire API updates.

Cheers.

lohedges avatar Oct 21 '22 14:10 lohedges

Thanks @lohedges I have a couple of comments and I am also going to test it and I will approve once I have tested it on the original system I tried it on (more complex than what I shared for reproduciility). Many thanks.

msuruzhon avatar Oct 21 '22 14:10 msuruzhon

@lohedges I have tested it on a few systems and it seems to work for me. Feel free to merge once you add some tests. Many thanks.

msuruzhon avatar Oct 25 '22 15:10 msuruzhon

Thanks for confirming. I'm just trying to devise a test to cover all possible locations for the position restraint file, e.g. when the restraint applies to one, more than one, or all molecules, and when the order of molecules in the file is changed, e.g. in which case the restraint might only apply to the last molecule.

lohedges avatar Oct 25 '22 15:10 lohedges